How do you get a Twitter user ID from the API?
Last updated July 25, 2026
To get a Twitter user ID, call GET /twitter/user/info with a userName and read the numeric id field in the JSON response. That id is a stable Snowflake identifier that never changes even when the handle does. On TwitterAPIs the lookup is $0.0008 per call, needs no developer account, and every new account starts with a $0.50 credit for around 625 lookups.
Every rate here is the pricing TwitterAPIs publishes, $0.0008 per call and $0.04 per 1,000 tweets (source: twitterapis.com/pricing).
What is a Twitter user ID?
A Twitter user ID is a permanent numeric identifier, a Snowflake ID, assigned to every account. Unlike the @handle, which a person can change at any time, the numeric id stays fixed for the life of the account. Storing the id rather than the username keeps your data pointed at the right account after a rename.
Getting a user ID from a username
Send GET /twitter/user/info with the userName parameter. The JSON response returns the full profile, including the id field, which is the numeric user ID. One call at $0.0008 resolves any public handle to its permanent id, and the same response also carries follower counts, the bio, and verification status.
Going the other way, ID to profile
If you already hold the numeric id, GET /twitter/user/info_by_id returns the matching profile. This is the pair to the username lookup and is how you refresh a stored account: keep the id, then resolve the current handle and stats whenever you need them, each request at the same flat $0.0008 per call.
Resolving many IDs at scale
Because each lookup is one flat-priced call with no monthly plan, resolving a large list stays predictable. A batch of 1,000 handles is about 1,000 calls, roughly $0.80. There is no developer account and no platform rate limit to work around, and every response is clean JSON ready for a database or a CSV.
Ways to get a Twitter user ID
| Method | Input | Scriptable in bulk | Cost |
|---|---|---|---|
| GET /twitter/user/info | Username | Yes, one call each | $0.0008 per call |
| GET /twitter/user/info_by_id | Numeric ID | Yes, one call each | $0.0008 per call |
| Manual lookup tool | One username at a time | No | Free but not scriptable |
Snowflake IDs, or snowflakes, are a form of unique identifier used in distributed computing. The format was created by X (formerly Twitter).
Questions and answers
- Which endpoint returns a Twitter user ID?
- GET /twitter/user/info returns it. Pass the userName parameter and read the id field in the JSON response, which is the account's numeric user ID. The call costs $0.0008 and also returns the bio, follower counts, and verification status in the same payload.
- Why use the numeric ID instead of the handle?
- Because handles change and IDs do not. The numeric user ID is a Snowflake identifier fixed for the life of the account, so storing it keeps your records pointed at the right person even after a rename. The current handle can be re-resolved from the id anytime.
- Can I convert a user ID back to a username?
- Yes. GET /twitter/user/info_by_id takes the numeric id and returns the current profile, including the present handle. It is the reverse of the username lookup and costs the same flat $0.0008 per call, with no developer account required.
- How much does it cost to resolve a list of user IDs?
- Each lookup is one call at $0.0008, so 1,000 usernames is about 1,000 calls, roughly $0.80. There is no monthly plan and no per-account rate limit, so a large batch stays predictable, and a $0.50 signup credit covers around 625 lookups for free.
- Do I need a developer account to look up user IDs?
- No. TwitterAPIs issues a Bearer key on signup with no developer-account application and no review queue. One key reaches the user lookup endpoints and the rest of the 51 endpoints, and every response comes back as clean JSON.
- Is the user ID the same as the tweet ID?
- They are different values but the same format. Both are Snowflake IDs, numeric identifiers created by X. A user ID identifies an account for its lifetime, while a tweet ID identifies a single post. Each is returned as the id field on its own object.
Keep reading
Start with $0.50 in free credits
No credit card. Roughly 12,500 tweets to test every endpoint.