<< Back to Twitter API Documentation
trends/location
Returns the top 10 trending topics for a specific location Twitter has trending topic information for. The response is an array of "trend" objects that encode the name of the trending topic, the query parameter that can be used to search for the topic on Search, and the direct URL that can be issued against Search. This information is cached for five minutes, and therefore users are discouraged from querying these endpoints faster than once every five minutes. Global trends information is also available from this API by using a WOEID of 1.
method status | report a bug
URL:
http://api.twitter.com/1/trends/woeid.format
Format:
xml, json
HTTP Method:
GET
Requires Authentication (about authentication):
false
API rate limited (about rate limiting):
true
Parameters:
- woeid. The WOEID of the location to be querying for.
Response (about return values):
XML example:
<?xml version="1.0" encoding="UTF-8"?>
<matching_trends type="array">
<trends as_of="2009-11-09T21:14:09Z">
<locations>
<location>
<woeid>2487956</woeid>
<name>San Francisco</name>
</location>
</locations>
<trend url="http://search.twitter.com/search?q=Canon+5DMKII" query="Canon+5DMKII">Canon 5DMKII</trend>
<trend url="http://search.twitter.com/search?q=Berlin+Wall" query="Berlin+Wall">Berlin Wall</trend>
<trend url="http://search.twitter.com/search?q=Veterans+Day" query="Veterans+Day">Veterans Day</trend>
<trend url="http://search.twitter.com/search?q=Gizmo5" query="Gizmo5">Gizmo5</trend>
<trend url="http://search.twitter.com/search?q=Monday+Night+Football" query="Monday+Night+Football">Monday Night Football</trend>
<trend url="http://search.twitter.com/search?q=Katt+Williams" query="Katt+Williams">Katt Williams</trend>
<trend url="http://search.twitter.com/search?q=Dragon+Age" query="Dragon+Age">Dragon Age</trend>
<trend url="http://search.twitter.com/search?q=Robert+Pattinson" query="Robert+Pattinson">Robert Pattinson</trend>
<trend url="http://search.twitter.com/search?q=Gift+Cert" query="Gift+Cert">Gift Cert</trend>
<trend url="http://search.twitter.com/search?q=Steven+Tyler" query="Steven+Tyler">Steven Tyler</trend>
</trends>
</matching_trends>
JSON example (truncated):
[
{
"locations":
[
{
"woeid":44418,
"name":"London"
}
],
"as_of":"2009-11-09T21:18:42Z",
"trends":
[
{
"url":"http://search.twitter.com/search?q=Jedward",
"name":"Jedward",
"query":"Jedward"
},
{
"url":"http://search.twitter.com/search?q=Ngog",
"name":"Ngog",
"query":"Ngog"
},
{
"url":"http://search.twitter.com/search?q=University+Challenge",
"name":"University Challenge",
"query":"University+Challenge"
},
{
"url":"http://search.twitter.com/search?q=Berlin+Wall",
"name":"Berlin Wall",
"query":"Berlin+Wall"
},
{
"url":"http://search.twitter.com/search?q=FlashForward",
"name":"FlashForward",
"query":"FlashForward"
},
{
"url":"http://search.twitter.com/search?q=Katt+Williams",
"name":"Katt Williams",
"query":"Katt+Williams"
},
{
"url":"http://search.twitter.com/search?q=JLS",
"name":"JLS",
"query":"JLS"
},
{
"url":"http://search.twitter.com/search?q=Modern+Warfare",
"name":"Modern Warfare",
"query":"Modern+Warfare"
},
{
"url":"http://search.twitter.com/search?q=Simon+Cowell",
"name":"Simon Cowell",
"query":"Simon+Cowell"
},
{
"url":"http://search.twitter.com/search?q=%23musicmonday",
"name":"#musicmonday",
"query":"%23musicmonday"
}
]
}
]
Usage examples:
cURL (about cURL):
curl http://api.twitter.com/1/trends/44418.json
Do you have an example to share in the language of your choice? Please share!
<< Back to Twitter API Documentation
Comments (0)
You don't have permission to comment on this page.