Instagram User ID Lookup API
Turn an Instagram username into its numeric user id with one call. You get the id together with the full public profile (name, bio, counts, picture). Ids never change when an account renames itself, so store the id and use it in later calls, for example with profile by id.
Cost: 1 credit per successful call (free if served from cache). Failed calls are free.
Every example on this page follows what you type here.
GET /v1/users/by-username/natgeo
Sample data in the live schema. Use private_x, ghost_x or hidden_x to see errors.
Parameters
usernamepathrequired@. Letters, digits, . and _, up to 30 characters. Always read as a username, even if it is all digits.freshqueryoptionaltrue skips the cache and fetches live (full price).Response
id is a string because Instagram ids can be larger than 2^53.
Errors
| Status | Code | When |
|---|---|---|
| 404 | user_not_found | No account with that username (free) |
| 400 | invalid_request | The username has characters Instagram does not allow |
See all error codes.
FAQ
How do I find an Instagram user id from a username?
Call GET /v1/users/by-username/{username} with your API key. The data.id field is the numeric Instagram user id.
Does the user id change when someone changes their username?
No. The numeric id stays the same for the life of the account, which is why it is the best key to store.