Search code examples
resthttptwitterhttp-headerstwitter4j

Getting more than the top 10 trending topics on Twitter


I'm trying to view the top 20 trending topics using Twitter REST Api

I'm using the following for testing (it's very helpful) although I'm originally using twitter4j

https://dev.twitter.com/rest/tools/console

Anyway, for testing, I sent out the following http request:

https://api.twitter.com/1.1/trends/place.json?id=1&count=20

But this still returns the top trending 10 topics and not 20 as I requested. How can I return the top 20 topics instead of 10?


Solution

  • You only get 10 with that request.

    https://dev.twitter.com/rest/reference/get/trends/place

    Returns the top 10 trending topics for a specific WOEID, if trending information is available for it.

    You could use the search API to get more results.