[instagram-api] Instagram how to get my user id from username?

Working Solution December 14, 2020

For simple usage like 3rd party tools that require an Instagram user ID (like embedding an image feed) I tend to use:

https://www.thekeygram.com/find-instagram-user-id/

because it makes it really easy to copy and paste the Instagram user ID that I am looking for. Unlike most tools I get the results fast, it's free and there are no ads. I recommend you watch the youtube video before using it so you can see how simple it is and get an idea of how it's used:

https://www.youtube.com/watch?v=9HvOroY-YBw

For more advanced usage I recommend:

https://www.instagram.com/{username}/?__a=1

(replace username with the requested username)

For example to find the user ID of the username "instagram" you would use:

https://www.instagram.com/instagram/?__a=1

This is the most advanced way which returns a JSON response and it's great if you are building an app that requires the raw data. You can save it in a database or build some type of front end UI to display it. Example: for a dashboard or on a website. Also, using the url is great because you can get additional attributes about users such as their total follower count and profile bio.