How to generate an instagram access token

Instagram recently made some changes to its API where new apps will require an access_token. If you plan on using the API without requiring users to auth, you can still easily get the token so you can make API calls. Just following the steps below.

Step 1 - Register for a developer account

If you don't already have one -

Step 2 - Register a new client

If you haven't already, register here. Fill in the all the fields. If you're not familiar with oauth (learn!), you may be a little confused with the Valid redirect URIs field. Just enter any random url for your website, it need not exist, for example, We will use this shortly to get our code parameter.

Step 3 - Get your code parameter

In your browser load the following url: &redirect_uri=THAT_REDIRECT_URI_YOU_GAVE&response_type=code

So it should look something like: redirect_uri=

After loading it, check the current url in the browser as you've been redirected! You should see something like

Nice, we have our code.

Step 4 - Request the access token

Load up a terminal and enter the following command with your creds (text in Caps):

curl -F 'client_id=CLIENT_ID' \ -F 'client_secret=CLIENT_SECRET' \ -F 'grant_type=authorization_code' \ -F 'redirect_uri=AUTHORIZATION_REDIRECT_URI' \ -F 'code=CODE' \

And Boom Goes the Dynamite. You should get a response like so:


If you run into any issues, feel free to comment below. \m/.

Questions, comments, improvements?