Is there an endpoint for topics, similar to how they show up in our home feed when you have selected topics to follow?

3 Likes

Thanks for reaching out @seeminglee

There is no dedicated endpoint for Topics currently. However, you can get information about topics using the context and entity operators in the new Twitter API v2, currently available with the recent search endpoint and the filtered stream endpoint

A list of supported context_annotations can be found here

So for example, if you want Tweets about the Baltimore Ravens, you can use this search query (with recent search or filtered stream endpoint)

entity:Baltimore Ravens

4 Likes

Interesting — thank you — will try that out!

1 Like

Cool! Is there a list of v2 operators for search? I could only find the v1 operators. Also, I haven’t found a current on monthly requests for the Early Access V2, what is it, if I may ask? Thank you in advance.

1 Like

Yes. Operators for recent search: Search Tweets - How to build a query | Docs | Twitter Developer Platform and operators for filtered stream Filtered stream - How to build a rule | Docs | Twitter Developer Platform

2 Likes

@suhemparack Thanks for leading us into the right direction.

I tried using both the context and the entity to get the tweets of a particular topic, but couldn’t get the tweets that are showing up in the twitter feed for that particular topic.

For example, I used this as the query: “lang:en entity:Bitcoin context:47.1007360414114435072”

Is there a way to get the exact same tweets as in the feed for that topic?

1 Like

@suhemparack Also curious about this.

Using the Baltimore Ravens example, is it possible to fetch the exact feed at the topic url (twitter-dot-com/i/topics/689566310217359360) through API v2? Or just a close approximation using context and entity?

1 Like

I’ve been able to extract what I think is a comprehensive list of Topics (as of right now) at twitter topics list - Google Sheets . No idea how to get at their titles/ names in bulk though…

4 Likes

This is awesome! thanks for sharing! How exactly did you generate this list?

1 Like

There’s no endpoint for retrieving the “topic timeline” as you might see on the topic page - you can use annotations to retrieve Tweets that have been labelled with the topic, though.

3 Likes

Thanks!