Instagram User ID vs Username: The Difference

Published

Instagram gives every account a permanent numeric ID, an editable @username and a free-text display name. Here is which one the API wants and why links break.

An Instagram user ID is a permanent number the platform assigns to an account and the owner cannot change it. A username is the editable @handle that appears in the profile URL. A display name is the free-text label shown above the bio. Instagram's API expects the numeric ID; links and mentions are built on the username, which is why they break after a rename.

Three identifiers, three different jobs

Instagram attaches at least three distinct labels to every account, and conflating them is the root of most confusion about Instagram integrations.

The numeric user ID is the account's internal key. It is a string of digits, assigned when the account is created, and it stays fixed for the account's entire life. Rename yourself, change your display name, switch to a business account, hand the account to a new owner: the number does not move. In older Instagram private API documentation and in community tooling you will often see this value referred to as the pk, short for primary key, which is a fair description of what it is.

The username is the @handle. It appears in the profile URL as instagram.com/username, it is what people type to mention you, and it must be unique across the platform at any given moment. Crucially, it is editable by the account holder, and once released it can eventually be claimed by somebody else.

The display name is the line of text above the bio. It has no uniqueness requirement at all, so any number of accounts can use the same display name simultaneously. It is a presentation field and nothing in the system depends on it.

Side by side

Property Numeric user ID (pk) Username (@handle) Display name
Example form A long digit string natgeo National Geographic
Can the owner change it? No Yes Yes
Unique across Instagram? Yes Yes, at any one time No
Appears in the profile URL? No Yes No
Accepted by the Instagram Graph API? Yes, as the primary reference Only in limited lookup endpoints No
Safe to store as a database key? Yes No No
Visible in the app interface? No Yes Yes
Survives a rename? Yes No, it is the thing that changed No

Why does the API want the numeric ID?

Instagram's official developer surface is the Instagram Graph API, part of Meta's platform, and it addresses accounts by their numeric identifier. An endpoint such as /{ig-user-id}/media returns that account's media; the identifier in that path is a number, not a handle.

The reason is the same architectural reason that applies across every platform. The API returns references to objects, and those references have to remain valid. If a media object's owner were recorded as a handle, every rename would invalidate historic data. Recording the ID means the reference holds forever, and the current handle is just a field you can read when you want to display something to a human. Meta's Instagram Platform documentation is the authoritative reference for which endpoint takes which identifier, and it is worth checking there rather than relying on blog posts, since Meta reorganises these products regularly.

There is a wrinkle specific to Instagram that trips up newcomers. Business Discovery lets an app look up another business or creator account by username, which looks like evidence that the API accepts handles. It does, for that one narrow purpose, and the response includes the account's numeric ID. The correct reading is that the username lookup is a bootstrap step: you use it once to obtain the ID, then you work with the ID. Building a pipeline that resolves a username on every single call inherits all the handle's instability and burns rate limit for no benefit.

A second wrinkle concerns which account types are reachable at all. Instagram's official API is built around Business and Creator accounts connected to a Facebook Page, and personal accounts are largely outside its scope. If you are trying to pull data about an arbitrary personal account through official channels, the limitation is the account type, not the identifier you chose.

What is an Instagram user ID, precisely?

An Instagram user ID is the immutable numeric primary key Instagram assigns to an account at the moment it is created. It exists so that every piece of data associated with that account, each post, comment, like, follow relationship, story and insight record, can point at something that will never change. The value is not shown anywhere in the Instagram app or on the web profile, which is why people assume it does not exist, but it is present in API responses, in the page source of a public profile, and in the embed markup Instagram generates for posts. Length has grown over the years as Instagram's ID space expanded, so you should store it as a string rather than an integer and avoid validating it against a fixed digit count. Treat it the way you would treat a customer number: meaningless to look at, authoritative in every other respect, and the one value worth writing down first.

What breaks when somebody changes their handle

Renaming is cheap for the account holder and expensive for everyone who referenced them. The failures sort into a few categories.

Links in your own content

Any URL you published in the form instagram.com/oldhandle stops resolving to that account. If the handle is later claimed by someone else, your link silently resolves to a stranger, which is worse than a 404 because nothing alerts you. This applies to website footers, email signatures, press releases, PDF media kits and printed material.

Mentions in captions and comments

Mentions that Instagram stored as structured references generally continue to work, because the platform resolved them to an account at the time. Plain text that merely looks like a mention, typed into a caption, a bio, a comment or a link-in-bio page, does not update. Old captions therefore keep pointing at a handle that no longer belongs to the person they meant.

Your spreadsheets and CRM records

A creator list keyed on handles degrades steadily. After enough renames you hold duplicates you cannot detect, accounts you cannot find, and names that now belong to other people. Keyed on numeric IDs, none of that happens. The practical workflow is set out in tracking social accounts across platforms using IDs.

Integrations and automations

Anything configured with a handle, from a scheduling tool to a reporting dashboard, has a latent failure waiting for the next rename. The fix is always the same: resolve once, store the ID, address by ID.

Where to find the numeric ID

The app does not show it, so you need another route. If you have API access to the account, the ID is in the response and that is the authoritative source. For a public profile, the ID is present in the page source, which is findable but fiddly and changes whenever Instagram reworks its front end. The embed code Instagram generates for a public post also contains identifiers.

For a single lookup from a profile URL, a tool is quicker: the 2uid.net Instagram user ID finder returns the numeric ID for a public account without a login. Our step-by-step walkthrough is in how to find an Instagram user ID. 2uid.net covers the equivalent identifiers on other platforms too, including the Facebook UID Finder, TikTok, YouTube and X.

Worth saying plainly: looking up an ID reads metadata Instagram already publishes for a public account. It does not and cannot reveal anything about a private account, which is covered in what others can see of a private Instagram account. Any service claiming otherwise is misrepresenting what is technically possible.

Which identifier should you use, and when?

The decision is simple once the roles are clear. Use the numeric ID whenever a machine is doing the work: database keys, API calls, deduplication, joining data across time periods, anything that has to stay correct without supervision. Use the username whenever a human is reading: profile links you expect people to click, labels in a report, the column in your spreadsheet that lets a colleague recognise the account. Use the display name for nothing structural, since it is neither unique nor stable.

Stated as one rule: the ID is the key, the username is the address, the display name is decoration. The wider principle generalises across every platform, and we unpack it in why usernames change but user IDs never do and map it platform by platform in social media user IDs explained.

Frequently asked questions

Can an Instagram user ID change?

No. The numeric ID is set when the account is created and remains fixed for as long as the account exists, through username changes, display name changes, account type switches and ownership transfers. Deleting the account and creating a new one produces a different ID, since that is a different account as far as Instagram is concerned.

What does pk mean in relation to Instagram?

It is short for primary key, and it refers to the same numeric user ID. The term comes from Instagram's internal and private API responses and persists in community tooling and older documentation. If a guide mentions a pk, read it as the numeric user ID.

Does the Instagram Graph API accept a username instead of an ID?

Only in limited cases, most notably Business Discovery, which lets you look up a business or creator account by username. The response includes the numeric ID, and that ID is what you should store and use for subsequent calls. Everything else in the API is addressed by ID.

What happens to my old username after I change it?

It is released from your account and becomes available again. Instagram may hold it for a period first, but you should assume another account can eventually claim it. That is precisely why old links and typed mentions pointing at your former handle are unsafe to rely on.

Can two accounts have the same display name?

Yes. The display name has no uniqueness constraint, so any number of accounts can present the same name at the same time. This is why impersonation often copies the display name exactly while the username differs by a character or two, and why the username and ID matter more than the name on the profile.

Is the Instagram user ID private data?

For a public account it is public metadata, present in the page source and in API responses. It is still an identifier tied to an account, so if you are collecting them at scale and they relate to individuals, the data protection rules of your jurisdiction govern how you store and use them. A single lookup of a public business profile is ordinary use.

I changed my handle and my website link broke. How do I prevent that next time?

Link through something you control rather than something Instagram controls. A redirect on your own domain, pointing at your current profile, means a future rename needs one edit in one place instead of a hunt through everything you ever published. Store the numeric ID in your records so you can always identify the account regardless of its current handle.