How to get Twitter API tokens
October 15, 2015
It maybe seems that start playing with Twitter API can be hard to start, but actually it’s not. First of all, you need to get tokens, to start. And this process is very easy.
- Go to "Create new Twitter App" form.
- Fill it. Callback URL is not required.
- Agree to "Developer Agreement", submit form.
- Go to "Keys and Access Tokens" tab
- At the bottom, you will find empty "Your Access Token" with "Create my access token" button, go ahead and click it.
- Click "Test OAuth" button in the top right corner.
Tokens are "Consumer Key", "Consumer Secret" and "Access Token" with "Access Token Secret":
or TWITTER_CONSUMER_KEY
, TWITTER_CONSUMER_SECRET
and TWITTER_ACCESS_TOKEN_KEY
, TWITTER_ACCESS_TOKEN_SECRET
if you will use them as environment variables.
Congratulations, you have Twitter API tokens.
Be careful with them. Pay attention to small gray warning on the page:
Keep the "Consumer Secret" a secret. This key should never be human-readable in your application.
and
This access token can be used to make API requests on your own account's behalf. Do not share your access token secret with anyone.
Don’t commit it in your repo. Use environment variables instead.
140 symbols ought to be enough for anybody,
your Vladimir Starkov