Getting new Twitter API consumer and secret keys

TwitterTwitter Oauth

Twitter Problem Overview

I am working on a Twitter project where I want to use OAuth but I don't know where to get the consumer and secret keys.

How can I get these?

Twitter Solutions

Solution 1 - Twitter

To get Consumer Key & Consumer Secret, you have to create an app in Twitter via

Then you'll be taken to a page containing Consumer Key & Consumer Secret.

Hopefully this information will clarify OAuth essentials for Twitter:

  1. Create a Twitter account if you don't already have one
  2. Visit ''; and follow the required prompts to create a developer project (Twitter requires you to answer some questions before they will approve your account. Approval was nearly instant in my case.)
  3. Requesting the API key and secret via the Developer Portal causes Twitter to produce the following three things:
  • API key (this is your 'consumer key')
  • API secret key (this is your 'consumer secret')
  • Bearer token
  1. Next, visit the 'Authentication Tokens' area of the Developer Portal and generate an 'Access token & secret'. This will provide you with the following two items:
  • Access token (this is your 'token key')
  • Access token secret (this is your 'token secret')
  1. The consumer key, consumer secret, token key, and token secret should be sufficient to do Twitter API calls (they were for me). Good luck!

Solution 2 - Twitter

  1. Log into the [Twitter Developers]( "") section.
  • If you don't already have an account, you can login with your normal Twitter credentials
  1. Go to "[Create an app]( "to start using the API")"

  2. Fill in the details of the application you'll be using to connect with the API

  • Your application name must be unique. If someone else is already using it, you won't be able to register your application until you can think of something that isn't being used.
  1. Click on Create your Twitter application

  2. Details of your new app will be shown along with your consumer key and consumer secret.

  3. If you need access tokens, scroll down and click Create my access token

  • The page will then refresh on the "Details" tab with your new access tokens. You can recreate these at any time if you need to.

By default your apps will be granted for read-only access. To change this, go to the Settings tab and change the access level required in the "Application Type" section.

Existing apps

To get the consumer and access tokens for an existing application, go to [My applications]( "for all your pre-existing conditions") (which is available from the menu in the upper-right).

Solution 3 - Twitter

step 1.Go to

step 2.Create app(fill up the form)

step 3.Change permissions if necessary(depending if you want to just read,write or execute)

step 4.Go To API keys section and click generate ACCESS TOKEN.

5 years late to answer :)

Now you have these tokens which is all you need.

'oauth_access_token' => Access token
'oauth_access_token_secret' => Access token secret
'consumer_key' => API key
'consumer_secret' => API secret

Solution 4 - Twitter

Simply go here: Make sure you have logged in with your Twitter account - then create - even if your just entering random (Test) Content - create your app - afterwards you will receive all the data you require :)

Solution 5 - Twitter

Go to to list all your apps. Click on the desired app to get its consumer and secret key. If you didnt yet created any app then follow to create new one.

Solution 6 - Twitter

This slide show shows how to get both keys updated June 2013.

Solution 7 - Twitter

From the Twitter FAQ:

Most integrations with the API will require you to identify your application to Twitter by way of an API key. On the Twitter platform, the term "API key" usually refers to what's called an OAuth consumer key. This string identifies your application when making requests to the API. In OAuth 1.0a, your "API keys" probably refer to the combination of this consumer key and the "consumer secret," a string that is used to securely "sign" your requests to Twitter.

Solution 8 - Twitter

consumer_key = API key

consumer_secret = API key secret

Found it hidden in Twitter API Docs

Twitter Docs screenshot

Twitter's naming is just too confusing.

Solution 9 - Twitter

FYI, from November 2018 anyone who wants access Twitter’s APIs must apply for a Twitter Development Account by visiting Once your application has been approved then only you'll be able to create Twitter apps.

Once the Twitter Developer Account is ready:

  1. Go to

  2. Click on Apps and then click on Create an app.

  3. Provide an App Name & Description.

  4. Enter a website name in the Website URL field.

  5. Click on Create.

  6. Navigate to your app, then click on Details and then go to Keys and Tokens.



All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionPankaj MishraView Question on Stackoverflow
Solution 1 - TwitterDeZignyView Answer on Stackoverflow
Solution 2 - TwitterrandomView Answer on Stackoverflow
Solution 3 - TwitterHIRA THAKURView Answer on Stackoverflow
Solution 4 - TwitterUACNAView Answer on Stackoverflow
Solution 5 - TwitterAdnanView Answer on Stackoverflow
Solution 6 - TwitterBrian PetroView Answer on Stackoverflow
Solution 7 - TwitterJeff TaylorView Answer on Stackoverflow
Solution 8 - TwitterKathirView Answer on Stackoverflow
Solution 9 - TwitterTechnocratSidView Answer on Stackoverflow