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

Oldest

Method: api.instagram.com/v1/users/search?q=<name>&access_token=...

Status: Legacy API, needs a token

"Working solution without access token" (checked April 2023)

Method: instagram.com/web/search/topsearch/?query=<name>

Status: Unofficial

Top answer (updated June 2022)

Method: i.instagram.com/api/v1/users/web_profile_info/?username=<name> plus X-IG-App-ID

Status: 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

Each with its price; the endpoint page has parameters, fields and a recorded response.

Sources

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

More about Instagram

Questions

Does the user ID change when someone renames their account?

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

One key. Start now.

19 platforms, 229 endpoints, from $0.002 a call. Errors and timeouts are free.

Start free