Third Party Topics Fetch

Skip to first unread message

Pavas Goswami

Aug 22, 2023, 11:24:34 AM8/22/23
to Topics API announcements, Himanshu Agrawal
Not able to fetch topics from third party sites.
please share some code to fetch topics from third party domains. 
I am using document.browsingTopics(), which only sets the Topics but i can only get the topics if i am visiting origin or subdomains, but not able to fetch topics from different domains.

For Eg. 
1. Visiting   topics set ---- News
2. now visiting topics set ----- Entertainment
so how can i get topics of into server
Note: I am owning both domains: and

please share the code which can implement this, either by header or js approach.

Sam Dutton

Aug 30, 2023, 10:50:48 AM8/30/23
to Topics API announcements,, Himanshu Agrawal
Hi Pavas

This group is for Topics API announcements. The best place to ask questions about API usage is our privacy-sandbox-dev-support repo.

I've added an issue there for your question, with the same answer as below. If you have more questions, ask on the dev-support issue rather than on this thread.




You need to observe topics with code from the same origin as the code you call to access topics.

To access topics from that you've observed on, you'll need to call document.browsingTopics() from an iframe embedded on that has a src with origin

Alternatively, you could use headers to observe and access topics.

You might find the following two demos useful as a starting point:

Reply all
Reply to author
0 new messages