# How do I get an Instagram user ID from a username?

There is no official lookup for arbitrary accounts any more: the old `api.instagram.com/v1/users/search` answer needed a legacy access token, and the most-voted Stack Overflow answers now rely on unofficial web endpoints such as `web_profile_info` with an `X-IG-App-ID` header or `web/search/topsearch`, which Instagram changes without notice. XTikAPI's `instagram.accounts.detail` takes the username and returns the numeric user ID with the profile, $0.004 a call.

Updated 2026-11-21

## What the Stack Overflow answers say

| Answer | Method | Status |
| --- | --- | --- |
| Oldest | `api.instagram.com/v1/users/search?q=<name>&access_token=...` | Legacy API, needs a token |
| "Working solution without access token" (checked April 2023) | `instagram.com/web/search/topsearch/?query=<name>` | Unofficial |
| Top answer (updated June 2022) | `i.instagram.com/api/v1/users/web_profile_info/?username=<name>` plus `X-IG-App-ID` | Unofficial, rate-limited |

For professional accounts, Meta's Business Discovery returns the target's ID, but only for Business or Creator accounts and only through your own professional account.

## With XTikAPI

1. `instagram.accounts.detail` with `id` set to the username returns `id` (the numeric user ID), name, bio, avatar and followers.
2. Use that ID with `instagram.posts.list` or `instagram.reels.list`.
3. Don't know the exact username? `instagram.accounts.search` with `keyword`.

Cost: converting 1,000 usernames = 1,000 × $0.004 = $4.

## Why XTikAPI

- XTikAPI reads Instagram with 9 endpoints from $0.002 a call, and a failed call is not charged.
- Fewer tokens for AI: across 8 recorded live Instagram calls (2026-11-18), raw platform JSON is ~280k tokens vs ~39k via XTikAPI REST (86.1% fewer) and ~29k via MCP (89.7% fewer).
- See before you pay: 192 of 229 endpoints show a recorded real response on their page (8 of 9 for Instagram).
- Made for AI: hosted OAuth MCP server (/v1/mcp), Markdown twin per page, llms.txt and OpenAPI for ChatGPT, Claude and Cursor.
- Free trial: a verified account gets $0.50, no card.

## Endpoints

- [Instagram account details API](https://xtikapi.com/apis/instagram/accounts/detail) ($0.004 a call): An Instagram account profile.
- [Instagram post list API](https://xtikapi.com/apis/instagram/posts/list) ($0.002 a call): An Instagram account's posts.
- [Instagram Reels list API](https://xtikapi.com/apis/instagram/reels/list) ($0.002 a call): An Instagram account's Reels.
- [Instagram account search API](https://xtikapi.com/apis/instagram/accounts/search) ($0.004 a call): Instagram accounts that match a keyword.

## More about Instagram

- [Instagram API](https://xtikapi.com/apis/instagram)
- [Agent Reach Instagram profile and followers return HTTP 400: why?](https://xtikapi.com/answers/agent-reach-instagram-http-400)
- [Instaloader errors (401/429, hashtag 404, get_reels empty, get_comments fail): how do I fix them?](https://xtikapi.com/answers/instaloader-errors-and-fixes)
- [My Instagram account keeps getting temporarily locked when scraping with Instaloader: what can I do?](https://xtikapi.com/answers/instagram-account-temporarily-locked)
- [Can the Instagram Graph API get another account's followers and posts?](https://xtikapi.com/answers/instagram-graph-api-other-accounts-business-discovery)

## Sources

What this page says about other products comes from their own pages and docs, read on 2026-11-21.

- [Stack Overflow: Instagram how to get my user id from username?](https://stackoverflow.com/questions/11796349)
- [Meta: Business Discovery](https://developers.facebook.com/documentation/instagram-platform/instagram-api-with-facebook-login/business-discovery)

## Questions

### Does the user ID change when someone renames their account?

No. The username can change; the numeric ID stays, so store the ID.

---

XTikAPI: one API key for public social media data, prepaid per call. [HTML version](https://xtikapi.com/answers/instagram-username-to-user-id) · [llms.txt](https://xtikapi.com/llms.txt) · [OpenAPI](https://xtikapi.com/openapi.json)
