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.
GET https://api.klupt.io/v1/users/by-username/{username}
Cost: 1 credit per successful call (0.5 if served from cache). Failed calls are free.
GET /v1/users/by-username/natgeo
Sample data in the live schema. Use private_x, ghost_x or hidden_x to see errors.
Parameters
| Parameter | In | Description |
|---|---|---|
username | path | Instagram username, with or without @. Letters, digits, . and _, up to 30 characters. Always read as a username, even if it is all digits. |
fresh | query | true skips the cache and fetches live (full price). |
Response
{
"data": {
"id": "25025320",
"username": "instagram",
"full_name": "Instagram",
"is_private": false,
"is_verified": true,
"profile_pic_url": "https://scontent.cdninstagram.com/…/profile.jpg",
"biography": "Bringing you closer to the people and things you love.",
"external_url": "https://about.instagram.com",
"category": "Product/service",
"is_business": true,
"profile_pic_url_hd": "https://scontent.cdninstagram.com/…",
"counts": { "followers": 690000000, "following": 180, "posts": 7900 }
},
"meta": { "request_id": "req_8Hn2…", "cached": false, "cache_age_seconds": 0, "credits_charged": 1, "credits_remaining": 26949 }
}
id is a string because Instagram ids can be larger than 2^53.
Examples
curl "https://api.klupt.io/v1/users/by-username/instagram" -H "X-Api-Key: $KLUPT_API_KEY"
import os, requests
r = requests.get("https://api.klupt.io/v1/users/by-username/instagram",
headers={"X-Api-Key": os.environ["KLUPT_API_KEY"]}, timeout=30)
user_id = r.json()["data"]["id"]
const r = await fetch("https://api.klupt.io/v1/users/by-username/instagram", {
headers: { "X-Api-Key": process.env.KLUPT_API_KEY },
});
const { data } = await r.json();
console.log(data.id);
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.
Updated 2026-11-29 · Markdown · Questions? [email protected]
