Things Every Developer Should Know¶
id_str field instead of
There are several APIs¶
The public Twitter API consists of a REST API and a Streaming API. Most application developers mix and match the APIs to produce their application. The Streaming API provides low-latency high-volume access to Tweets. Additionally, there are some families of APIs (such as the Ads API) which require your application to be whitelisted in order to make use of them.
There are limits to how many calls and changes you can make in a day¶
The API is HTTP-based (over SSL)¶
Methods to retrieve data from the Twitter API require a
GET request. Methods that submit, change, or destroy data require a
DELETE request is also accepted for methods that destroy data. API methods that require a particular HTTP method will return an error if you do not make your request with the correct one. HTTP Response Codes are
The API aims to be a RESTful resource¶
With the exception of the Streaming API, the Twitter API attempts to conform to the design principles of Representational State Transfer (REST). Twitter APIs use the JSON data format for responses.
Parameters have certain expectations¶
Some API methods take optional or requisite parameters. Keep in mind when making requests with parameters:
- Parameter values should be converted to UTF-8 and URL encoded.
pageparameter begins at 1, not 0.
Where noted, some API methods will return different results based on HTTP headers sent by the client. Where the same behavior can be controlled by both a parameter and an HTTP header, the parameter will take precedence.
There are pagination limits¶
REST API Limit¶
Clients may access a theoretical maximum of 3,200 statuses via the
count parameters for the user_timeline REST API methods. Other timeline methods have a theoretical maximum of 800 statuses. Requests for more than the limit will result in a reply with a status code of 200 and an empty result in the format requested. Twitter still maintains a database of all the Tweets sent by a user. However, to ensure performance, this limit is in place on the API calls.