Twitter Api

Sniki Wiki: your social networking, social marketing, and social media tracking wiki.

Sniki Wiki> Social Media > categories >

About Twitter's API

twitter.png?1217271008

The official Twitter API documentation is part of the Twitter Development Talk Google Group. Join the group, read the docs, and create neat stuff like the apps, hacks, and mashups listed on the Twitter Fan Wiki!
Get linked!

Want us to say "from MyCoolApplication" at the end of updates sent from your application? Just fill out this form.
Hitting the rate limit?

You can request to be on our whitelist. Please submit a detailed description of why you're hitting our rate limits, what your application does, and what sort of volume of requests you expect to generate. We don't approve every request, but we try to be helpful.

MORE

Twitter Search API
Attention Summize clients: API request URLs hitting "summize.com" will continue to work until further notice. However, please migrate to "search.twitter.com" at your earliest convenience. Thank you!

You can use our API to integrate Twitter search results with your own apps, clients, and readers. Check out these great examples of apps utilizing our API.

We serve two flavors of our Search API: Atom and JSON.
Atom API

You can grab the search results for any query as a standard Atom feed. For example, this is the Atom feed for the query twitter.

To construct a request URL, simply append your URL-encoded query to our Atom service URL:

http://search.twitter.com/search.atom?q=<query>

You can use any of our search operators in your query. Here are a few examples:

* Find tweets containing a word: http://search.twitter.com/search.atom?q=twitter
* Find tweets from a user: http://search.twitter.com/search.atom?q=from%3Aalexiskold
* Find tweets to a user: http://search.twitter.com/search.atom?q=to%3Atechcrunch
* Find tweets referencing a user: http://search.twitter.com/search.atom?q=%40mashable
* Find tweets containing a hashtag: http://search.twitter.com/search.atom?q=%23haiku
* Combine any of the operators together: http://search.twitter.com/search.atom?q=movie+%3A%29

Alternatively, if you perform a search on our site, you can click the Feed for this query link in the sidebar to obtain its Atom feed URL. You can also use the advanced search page to easily incorporate any search operators.

The API also supports the following optional URL parameters:

* lang: restricts tweets to the given language, given by an ISO 639-1 code. E.g., http://search.twitter.com/search.atom?lang=en&q=devo
* rpp: the number of tweets to return per page, up to a max of 100. E.g., http://search.twitter.com/search.atom?lang=en&q=devo&rpp=15
* since_id: returns tweets with status ids greater than the given id.
* geocode: returns tweets by users located within a given radius of the given latitude/longitude, where the user's location is taken from their Twitter profile. The parameter value is specified by "latitide,longitude,radius", where radius units must be specified as either "mi" (miles) or "km" (kilometers). E.g., http://search.twitter.com/search.atom?geocode=40.757929%2C-73.985506%2C25km. Note that you cannot use the near operator via the API to geocode arbitrary locations; however you can use this geocode parameter to search near geocodes directly.
* show_user: when "true", adds "<user>:" to the beginning of the tweet. This is useful for readers that do not display Atom's author field. The default is "false".

JSON API

The JSON API works exactly like the Atom API, but returns the results in JSON format. For example, this is the JSON response for the query twitter.

To construct a request URL, append your URL-encoded query to our JSON service URL:

http://search.twitter.com/search.json?q=<query>

The JSON API also supports an additional URL parameter:

* callback: if supplied, the response will use the JSONP format with a callback of the given name. E.g., http://search.twitter.com/search.json?callback=foo&q=twitter

Terms of Service

We delight in all manifestations of our API. Only a few guidelines:

* Set the user agent of the request to something meaningful. This helps us answer any questions about your use of the API.
* If possible, use the since_id request parameter described above to only retrieve new tweets.
* Please give us a nod in your app, perhaps by including one of these stylish "Powered by Twitter" badges:

Powered-by-twitter-sig Powered-by-twitter-badge
* Finally, let us know what you're up to so we can check it out!

Learn more:

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License