Skip to content

GET/v1/users/by-username/{username}

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.

GEThttps://api.handlehaul.com/v1/users/by-username/{username}

Cost: 1 credit per successful call (free if served from cache). Failed calls are free.

Try itsandbox data · no key needed

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
Instagram username, with or without @. Letters, digits, . and _, up to 30 characters. Always read as a username, even if it is all digits.
freshqueryoptional
true skips the cache and fetches live (full price).

Response

id is a string because Instagram ids can be larger than 2^53.

Errors

StatusCodeWhen
404user_not_foundNo account with that username (free)
400invalid_requestThe 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.

↑↓ to move↵ to open