How to get access to the Twitter API
Step one: Apply and receive approval for a developer account
To make any request to the Twitter API, you must first apply for a developer account and have your use case approved.
You can choose to apply for the Standard or Academic Research product tracks, which offer tailored support, access levels, and pricing.
- Standard - The default product track for most developers, including those building something for fun, for a good cause, to learn or teach. All approved developers will be able to create and use a Standard Project.
- Academic Research - This product track provides qualified academic researchers access to elevated access and enhanced functionality, including access to the full-archive search endpoint, a higher monthly Tweet cap, and enhanced filtering capabilities with the filtered stream and recent search endpoints.
Once approved, you can create a Standard or Academic Research Project and an associated developer App which will provide you a set of credentials that you will use to authenticate all requests to the API.
We require an approved use case to use the Twitter API to protect the people that use Twitter. Before you apply, we strongly encourage you to understand our developer policy, and to review our list of restricted use cases. If your use case does not adhere to our policy, we will reject your application.
Step two: Save your App's key and tokens and keep them secure
- API Key - This is essentially a username, and allows you to make a request on behalf of your App.
- API Key Secret - This is a password, and allows you to make a request on behalf of your App.
- Access Token - This token represents the Twitter account that owns the App, and allows you to make a request on behalf of that Twitter account.
- Access Token Secret - This token also represents the Twitter account that owns the App, and allows you to make a request on behalf of that Twitter account.
- Bearer Token - This token represents your App and enables you to authenticate requests that require OAuth 2.0 Bearer Token authentication.
You will use your API Key, API Key Secret, Access Token, and Access Token Secret to make requests that require OAuth 1.0a User Context authentication. If you would like to make requests on behalf of another user, you will need to use the 3-legged OAuth flow for them to authorize you.
Since these keys and tokens do not expire unless regenerated, we suggest creating environment variables or using a secure password manager once you've received your credentials.
Please note: Your keys and tokens will only display once in the developer portal, so it is important that you store these credentials in your password management system as soon as you generate them.
If you misplace or forget the keys and tokens, you will need to regenerate them, which creates new credentials and invalidates the old ones. This means that you will have to update any integrations that you may have set up with your prior credentials.
Learn more about our authentication best practices.
Step three: Set up your access
At this point in time, there are a few different access tiers across two different versions of Twitter API endpoints that require different provisioning and authentication methods. Please see the below table for more details on how to get access to the different tiers and versions:
|Version or tier||Provisioning method|
|Twitter API v2: Early Access||
You must have an approved developer account, and have activated the new developer portal experience.
Want to use an existing App?
You can add an existing App to your new Project. Keep in mind that you may only have one primary or production App per approved use case. See our Developer Policy for more information, including guidelines around additional apps for development or testing.
To create a new developer App, you must have an approved developer account.
To access, you must authenticate your requests with keys and tokens from a developer App that is assigned to a premium dev environment. You can do all of this from the developer portal. The level of access is determined by the monthly subscription level tier.
To use premium, You must have an approved developer account.
To access, you must have an approved enterprise data licensing contract and set up by a sales representative. The level of access is determined by the contract and account terms.
Step four: Make your first request
Once you have access, you’re ready to get started using the Twitter API! We have quick start guides for many of our endpoints, useful tools and libraries and sample code, and the following tutorials that describe how to build solutions around different use cases: