Get local Instagram api credentials with Ngrok

Submitted by christophe on Thu, 12/12/2019 - 17:57

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


  2. Start Ngrok and get the forwarding url
    ./ngrok http 8000


  3. Copy this url into the security tab from the Instagram ui
    Ngrok Instagram
  4. Get the code
    Access this url from the browser:
    it will redirect then to
  5. 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' \   




Add new comment

Restricted HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.
  • Web page addresses and email addresses turn into links automatically.
This question is for testing whether or not you are a human visitor and to prevent automated spam submissions.