Colorfield logo


Published on

Get local Instagram api credentials with ngrok

ngrok logo

It can be long to find the way through the documentation for these simple steps, so here is a shortcut.
Go to and get a Client ID and Client Secret.

  1. Start a local server
php -S localhost:8000
  1. Start Ngrok and get the forwarding url
./ngrok http 8000
  1. Copy this url into the security tab from the Instagram ui

    Ngrok Instagram
  2. Get the code
    Access this url from the browser:\_id=CLIENT-ID&redirect\_uri=\_type=code
    it will redirect then to

  3. Get the access token

curl -F 'client_id=CLIENT-ID' \
-F 'client_secret=CLIENT-SECRET' \
-F 'grant_type=authorization_code' \
-F 'redirect_uri=' \
-F 'code=CODE' \