Twitter Rate Limiting - How To Handle

From Hostek.com Wiki
Revision as of 21:38, 5 May 2013 by Jakeh (Talk | contribs) (Created page with "==Background== It is common to want to include a user's Twitter feed on your Web site, and this can easily be done by calling Twitter's anonymous ATOM search URL (eg. http://s...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Background

It is common to want to include a user's Twitter feed on your Web site, and this can easily be done by calling Twitter's anonymous ATOM search URL (eg. http://search.twitter.com/search.atom?q=Hostek). The downside to using this approach is that the anonymous search utility is rate limited to 150 searches per hour per IP. As such, if other sites on your server also call Twitter's anonymous search URL, you may eventually receive an error stating "Clients may not make more than 150 requests per hour."

How to Avoid Twitter's Rate Limits

Caching

The best way to prevent your site from reaching this limit is to cache your calls to Twitter for at least 1-5 minutes. This can be done easily using the CF caching functions described in this blog post.

Use the Twitter REST API

Additionally, you may wish to consider using Twitter's REST-base API as it will give you a higher limit for searches. More details on getting started with the Twitter API can be found at Twitter's API Documentation page. More info on getting started integrating your application with Twitter can be found at the Twitter Developers Portal.