Skip to main content

Get the Instagram ID of a user without an access token

Details#

  1. The easiest way to get the instagram id of a given username.
  2. Access token is not needed.
  3. Only a few lines of code.
  4. PHP example available on github: https://github.com/anakornk/Get-Instagram-ID-From-Username-PHP/

Usage#

Send a get request with the parameter “username”

ig id 3

How it works#

  1. username = $_GET["username"]
  2. Send a get request to: https://www.instagram.com/username/?__a=1
  3. The returned JSON contains the user id.

Structure of the returned JSON (may have changed):

ig id 1

Code#

ig id 2

Resources#

http://stackoverflow.com/a/38342137/5334285