🎉 Requestly joins BrowserStack to build the future of application testing. Read more

HTTP Headers

Sec Browsing Topics

HTTP Header

Experimental: This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

Non-standard: This feature is non-standard and is not on a standards track. Do not use it on production sites facing the Web: it will not work for every user. There may also be large incompatibilities between implementations and the behavior may change in the future.

Warning:
This feature is currently opposed by two browser vendors. See the Standards positions section for details of opposition.

Note:
An Enrollment process is required to use this feature in your applications.

The HTTP <strong>Sec-Browsing-Topics</strong> request header sends the selected topics for the current user along with the associated request, which are used by an ad tech platform to choose a personalized ad to display.

If the calling site does not have the Topics API included in a successful privacy sandbox enrollment process, attempting to create or modify <strong>Sec-Browsing-Topics</strong> fails silently, and any existing <strong>Sec-Browsing-Topics</strong> header is deleted.

See Using the Topics API for more details.

Syntax

Syntax

http
Sec-Browsing-Topics: <array-of-observed-topics>

Directives

The directives are represented as a JSON object containing an array of up to three objects. Each object details the user’s selected topics over the last three epochs. These objects include several key properties:

configVersion: A string identifying the specific algorithm (excluding the model component) used to compute the topic.

modelVersion: A string indicating the model employed to categorize a string, such as a webpage’s hostname, into topic identifiers.

taxonomyVersion: A string denoting the version of the taxonomy utilized.

topic: A numerical ID corresponding to a topic, which can be used by the browser to retrieve detailed information about the topic from the taxonomy (see an example taxonomy of interests).

version: A combination of the configVersion, modelVersion, and taxonomyVersion strings, concatenated with colons (:) to form a comprehensive version string.

Example

The exact property values may vary depending on the browser implementation. For instance, a header received from Chrome might appear as follows:

http
Sec-Browsing-Topics: [{configVersion: "chrome.1", modelVersion: "1", taxonomyVersion: "1", topic: 43, version: "chrome.1:1:1"}]

This feature is not part of an official standard, although it is described in the Topics API Unofficial Proposal Draft.

How to Modify Header using Requestly

Requestly is a useful Chrome extension that lets you modify HTTP headers, including the Sec-Browsing-Topics header. This can help developers test and debug how their applications handle privacy and user interest topics shared by browsers. Steps to Modify the Sec-Browsing-Topics Header:

  1. Install and open the Requestly Chrome extension. You can find it on the Chrome Web Store.
  2. Create a new rule: Click on “Create Rule” and choose “Modify Headers” from the list of available rule types.
  3. Add a new header modification:
    • Under “Action”, select “Add” or “Override”.
    • In the “Header Name” field, enter Sec-Browsing-Topics.
    • In the “Header Value” field, enter the topics data you want to send (e.g., sports,technology,travel).
  4. Set the URL condition: Specify the URL or pattern where this header change should apply (e.g., https://your-api.com/*).
  5. Save the rule.

Once configured, Requestly will inject the modified Sec-Browsing-Topics header into matching requests, helping you simulate different browsing contexts and test how your backend manages user interest topics. You might need to modify this header to test privacy and content personalization features in your application. Changing it helps ensure your service handles user interests correctly without actually browsing different sites.