Instagram ID lookup

Instagram ID to username. And every other way round.

Instagram uses numeric IDs for accounts and posts. These four lookups turn them into usernames and links, and back again.

Pick the lookup by what you have.

Each one is a single API call with one input. Failed calls, including IDs or usernames that do not exist, are not charged.

Which ID is which.

Instagram shows usernames and links, but its data uses numbers. Knowing which number you hold tells you which lookup to run.

User ID (pk)
A number that identifies an account. It does not change when the account changes its username, which makes it the safe key to store.
Username
The handle in the profile URL. It can change, so a username stored months ago may now point to nobody or to another account.
Shortcode
The letters after /p/ or /reel/ in a post link. It is what you can copy from the browser.
Media ID
The numeric ID of a post or reel that media APIs ask for. It is longer than JavaScript can hold exactly, so keep it as a string.

Guides and tools.

Questions people ask.

How do I find a username from an Instagram ID?

Send the numeric user ID to the Instagram ID to username API. It returns the account's current username with its full name, bio and follower, following and post counts, for $0.008 per successful call.

How do I find the Instagram user ID of an account?

Send the username, without the @, to the username to ID API. It returns the numeric user ID as a string. Usernames that do not exist fail and are not charged.

Does an Instagram user ID change when the username changes?

No. The user ID stays the same, which is why it is the right value to store. Look it up again with the ID to username API to get the current handle.

What is an Instagram shortcode?

It is the part of a post or reel link after /p/ or /reel/. Convert it to the numeric media ID with the shortcode to media ID API, or turn a media ID back into a link with media ID to shortcode.

One key for every Instagram lookup.

Create a SandBase key and run the lookup you need. Every endpoint page has a Playground.

Get API key

SandBase is not affiliated with Instagram or Meta. Lookups use public data only.