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.
Instagram ID to username
Find the current username of an account from its numeric user ID, with the profile: full name, bio, follower, following and post counts.
- Input: user_id
- $0.008 per successful call
- Re-check stored IDs to spot username changes
Instagram username to ID
Look up the numeric user ID (pk) of an account. Most Instagram profile, posts and followers APIs take this ID, and it stays the same when the username changes.
- Input: username, without @
- $0.008 per successful call
- Returns user_id as a string
Instagram shortcode to media ID
Turn the shortcode of a post or reel (the part after /p/ or /reel/ in the link) into its numeric media ID.
- Input: shortcode
- $0.002 per successful call
- Keep media_id as a string
Instagram media ID to shortcode
Turn a numeric media ID back into the shortcode, so you can rebuild the public link instagram.com/p/<shortcode>/.
- Input: media_id
- $0.002 per successful call
- Returns the shortcode
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.
Instagram user ID to username lookup
One call per ID, what a bad ID looks like, and how to batch-convert a CSV of IDs. Tested on 18 brand accounts.
- Step by step
- CSV batch
- What to store
Instagram user ID API tutorial
Convert usernames to IDs and back with curl and Python, then batch the lookups and handle errors.
- Both directions
- curl and Python
Instagram engagement rate checker
Check a public account's engagement rate before working with a creator.
- Free daily checks
- Public numbers only
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.
SandBase is not affiliated with Instagram or Meta. Lookups use public data only.
