This is the main API you’ll use for interacting with twitter accounts: getting friend and follower details, following and unfollowing, and most importantly, posting status updates.
The API is very easy to use (thanks to REST: just make GET or POST requests to various URLs), and thankfully no registration is required; just pass your twitter account details in using HTTP Basic Authentication for the actions that need it.
Although the service is rate-limited to 100 requests per hour, many of the most important actions (such as posting a status update, or following a user) are not included in the rate limits.
Although it’s also run by Twitter, it currently feels like quite a separate service, probably because it has been largely untouched since Twitter bought the Summize search application that it runs from.
The great thing about the Search API is that, within reason, there are no limits on request frequency. So, you can even use it to replace some of the rate-limited actions of the main Twitter API, such as retrieving a (public) user’s timeline.
The Search API will only serve you up to about 1,500 results from recent history. If you plan on doing serious data mining, you’ll have to periodically poll the API and store the aggregated data locally. Also be aware that it has a few little idiosyncrasies (such as how it treats IDs), so where possible use a library to make your API calls, to more easily upgrade your app when the API is made more consistent in the near future.
If you’re interested in semantically analyzing or categorizing tweets, take a look at the Yahoo! API that extracts ‘significant’ terms from text. You’ll need to register for an API key (it’s quick and painless), but once you have it, the API calls are really simple REST. The service is limited by IP address to 5,000 calls per day.
There are no limits on the number of calls you can make, but Google asks that you let them know if you intend on making more than 250,000 calls per day.
Location-based services are all the rage right now, and Twitter is becoming one of the cornerstones for this burgeoning industry. So you want to extract the ‘location’ from somebody’s tweet and convert it to latitude and longitude, ready for plotting on a Google Map? Yahoo! GeoPlanet does this really well: just pass it a string of text that includes a location, and it will intelligently return a latitude and longitude for the location, along with other useful information.
You’ll need an API key to make requests, but if you signed up for the Yahoo! Term Extractor mentioned above, then you’re halfway there already. Requests are limited to 50,000 per day.
A large proportion of tweets include links to other websites, so you may want to perform some analysis on these links. The Compete API will return some useful information about a given website, such as how trusted it is and it’s history of traffic.
As with the other APIs in this list, it’s an easy REST over GET API (just pass your parameters via the query string to a URL). You’ll need to sign-up for an API key, and there’s a limit of 1,000 calls per day unless you negotiate for more (and pass their review/audit).
http://aws.amazon.com/awis/ (paid service)
The de-facto service for embedding images into tweets offers a simple, albeit sparsely documented, API.
Uploading a photo is very simple – just POST the API the binary data associated with the image, together with the twitter username and password for the relevant account. No registration/API key is required.
Need to embed a long URL into a limited-space tweet? Bit.ly is the answer. It has a slightly shorter domain than tinyurl.com, and doesn’t have the horrible frame of ow.ly! The API is more complicated than the simple Tinyurl equivalent (see link below). You’ll need to register for a key, but it is far more feature rich, with expansion and statistics features joining the main shortening function.
Need to check those words before sending a status update, but have no local access to a dictionary or spell-checker? The Yahoo! Spelling Suggestion API is here to save you. Pass it a string of text (again, REST over either GET or POST), and it will do it’s best to return a corrected version.
As with the other Yahoo! APIs mentioned, you’ll have to register for an API key, and requests are limited to 5,000 per day per IP address.
At Box UK we have a strong team of bespoke software consultants with more than two decades of bespoke software development experience. If you’re interested in finding out more about how we can help you, contact us on +44 (0)20 7439 1900 or email firstname.lastname@example.org.