Twitter User ID Lookup: Username to ID and Back (2026)
How to do a Twitter user ID lookup without code or in bulk: the banner trick, the x.com/i/user link, a 100-ID API call, real output and 2026 prices.
Tarun Khatri
Published · Updated · 7 min read
A Twitter user ID lookup turns a username like @github into its numeric ID, 13334762, or an ID back into today's username.
This guide is for developers, researchers and marketers who match X (Twitter) accounts across tools. You get two no-code tricks, the API calls for one or 100 accounts, and real output. We run Weir, the API in the examples.
Get any account's ID in one call:
curl https://api.weirapp.io/v1/x/users/github \
--header "Authorization: Bearer $WEIR_API_KEY"
Here is the plan:
- Copy the banner addressThe number after profile_banners/ is the ID.
- Open x.com/i/user/IDX redirects to the current username.
- Look up one usernameGET /v1/x/users/{user} returns the id.
- Convert 100 IDs at onceGET /v1/x/users?ids= returns the usernames.
Step 1: How to find a Twitter user ID without code
The ID hides in the address of the profile's banner image. Every banner we checked was filed under the account's ID:
- Open the profile on x.com in a desktop browser.
- Right-click the banner, the wide image at the top, and choose Copy image address.
- Read the number after
profile_banners/. That's the user ID.
For @github, the address begins like this:
https://pbs.twimg.com/profile_banners/13334762/1780668208
That matches the ID our API returned on 22 October 2026. The trick fails for accounts with no banner.
You can also ask an AI assistant. With Weir's MCP server for X connected, ask Claude "What is the user ID of @github?" The answer comes from the get_x_user tool, which returned 13334762 for 3 credits when we called it.
Step 2: Twitter user ID to username: open x.com/i/user/ID
Paste https://x.com/i/user/ plus the ID into your browser, and X sends you to the current profile.
We checked on 22 October 2026. X answered x.com/i/user/12 with a redirect to x.com/jack, and the intent link, x.com/intent/user?user_id=12, went to the same profile.
This is the link to save in a spreadsheet, because it follows the account through a rename. For a list of IDs, use the bulk call in Step 4.
Step 3: Twitter username to ID with one API call
Weir's profile endpoint, GET /v1/x/users/{user}, takes a username and returns the ID with the rest of the profile. Here is the curl from the top, trimmed:
{
"id": "13334762",
"username": "github",
"createdAt": "2008-02-11T04:41:50.000Z",
"profileBannerUrl": "https://pbs.twimg.com/profile_banners/13334762/1780668208",
"protected": false
}
It cost 3 credits: 1 for the call and 2 for the profile. Keep id as a string, as X's own ID docs advise.
The same endpoint also takes an ID, so it works both ways. A protected account still returns its profile; a suspended one returns 404.
For a Python session with the key set up, see how to get tweets with Python.
Step 4: Twitter user ID lookup for 100 accounts at once
GET /v1/x/users takes up to 100 comma-separated IDs and returns the profiles in the order you asked:
import os, requests
ids = ["12", "783214", "2244994945", "2999999999999999999"]
r = requests.get(
"https://api.weirapp.io/v1/x/users",
params={"ids": ",".join(ids)},
headers={"Authorization": f"Bearer {os.environ['WEIR_API_KEY']}"},
timeout=60,
)
r.raise_for_status()
for user in r.json()["data"]:
print(user["id"], "@" + user["username"])
print("not found:", r.json()["meta"]["notFound"])
We ran this lookup on 22 October 2026, with one made-up ID at the end:
12 @jack
783214 @X
2244994945 @XDevelopers
not found: ['2999999999999999999']
Three profiles came back for 7 credits. IDs that are deleted, suspended or made up land in meta.notFound and cost nothing.
Have a follower list? The followers endpoint already returns usernames and IDs together; see export Twitter followers to CSV.
Why store the ID, not the handle?
A username is a label on the account. The ID is the account.
X's help center says a renamed account keeps its followers, Direct Messages and replies. It also says the old username "will immediately be available for use by someone else".
So a saved handle can point to a stranger next year. @XDevelopers was @TwitterDev until July 2023, per MobileSyrup, and its ID, 2244994945, stayed the same.
Our guide to Twitter username history logs renames with the same bulk call.
What does a Twitter user ID lookup cost?
Pick the method by how many accounts you have. Prices are as of October 2026:
| Method | Direction | Cost | Best for |
|---|---|---|---|
| Banner image address | Username to ID | Free | One account |
| x.com/i/user/ID | ID to username | Free | One account |
| Weir profile call | Both ways | 3 credits | Scripts, AI chats |
| Weir bulk call | ID to username | 1 + 2 per profile | Up to 100 IDs |
| X API user lookup | Both ways | $0.010 per user | Official terms |
| TwitterAPI.io batch | ID to username | $0.01 per 1,000 at 100+ | Huge lists |
For a list of 1,000 IDs, the gap is wide:
X's pricing page lists $0.010 per user read. Weir charges 1 credit per call plus 2 per profile, so 1,000 IDs take 10 calls and 2,010 credits.
TwitterAPI.io is cheaper per profile, and far cheaper in bulk. Its pricing page lists at most 18 credits per profile, or 1 each when a batch returns 100 or more. A dollar buys 100,000 credits.
One username on Weir costs 3 credits. The 5,000 free credits each month cover about 1,600 single lookups.
If it doesn't work
- A
404means the account is suspended or doesn't exist. - A username made only of digits is read as an ID, so you get a different account or a
404. - A
400on the bulk call usually means a space or a handle inids. Send digits only, comma-separated. - Excel shows an ID in scientific notation. Import the ID column as text; the file still holds every digit.
When not to use Weir
- You convert IDs by the hundred thousand. TwitterAPI.io's bulk rate is 20 to 40 times lower than ours.
- You need 100 usernames per call. X's API takes them in one request; Weir takes one username per call.
- You need X's own terms or a contract. Use X's user lookup endpoints.
- You check one or two accounts. The banner trick and the
x.com/i/userlink are free.
Weir reads public data only and can't post. It isn't licensed by X, and X's Terms of Service bar scraping without X's written permission, so check what applies to you. This isn't legal advice.
FAQ
How do I find someone's Twitter user ID?
Open their profile on x.com, right-click the banner and copy the image address. The number after profile_banners/ is the ID. If there's no banner, Weir's GET /v1/x/users/{user} returns it for 3 credits.
Can I convert Twitter handles to IDs in bulk?
Yes. X's API takes up to 100 usernames per request, at $0.010 per user as of October 2026. Weir looks up one username per call at 3 credits, and converts IDs to usernames 100 at a time.
Does a Twitter user ID ever change?
Not when the username changes. X says a renamed account keeps its followers, messages and replies. @XDevelopers kept ID 2244994945 after it stopped being @TwitterDev.
What is the Twitter URL with a user ID?
https://x.com/i/user/ followed by the ID. On 22 October 2026, X redirected x.com/i/user/12 to x.com/jack. The intent link x.com/intent/user?user_id=12 works too.
Is there a free Twitter username to ID converter?
The banner trick is free and works in any desktop browser. Weir's 5,000 free credits a month cover about 1,600 lookups. Skip converter sites that ask you to sign in with your X account.
Sources
- X API user lookup introduction (checked 22 October 2026): https://docs.x.com/x-api/users/lookup/introduction
- X API pay-per-usage pricing (checked 22 October 2026): https://docs.x.com/x-api/getting-started/pricing
- X IDs (checked 22 October 2026): https://docs.x.com/fundamentals/x-ids
- X Help Center, change your username (checked 22 October 2026): https://help.x.com/en/managing-your-account/change-x-handle
- MobileSyrup, X renames its official handles (26 July 2023): https://mobilesyrup.com/2023/07/26/twitters-old-handle-goes-private-as-company-takes-over-x-username/
- X Terms of Service, effective 9 October 2026 (checked 22 October 2026): https://x.com/en/tos
- TwitterAPI.io pricing (checked 22 October 2026): https://twitterapi.io/pricing
- Weir getXUser reference: https://docs.weirapp.io/reference/x/getXUser
- Weir getXUsers reference: https://docs.weirapp.io/reference/x/getXUsers
- Weir billing: https://docs.weirapp.io/billing
- Our live lookups with the Weir API, and x.com redirect checks, 22 October 2026