Search code examples
twitter

Getting top twitter trends by country


I know how to get trends using API, but i want it by country and top 10.

How can I ? Is that possible?

Tried this one but not working

http://api.twitter.com/1/trends/current.json?count=50

Solution

  • Yes, you can.

    First, figure out which countries you want to get data for.

    Calling

    https://dev.twitter.com/docs/api/1/get/trends/available
    

    Will give you a list of all the countries Twitter has trends for.

    Suppose you want the trends for the UK. The above tells us that the WOEID is 23424975.

    To get the top ten trends for the UK, call

    https://api.twitter.com/1/trends/23424975.json