X: Get Public Profile by Username
View all X (Twitter) Public Data API endpoints →Resolve a public X (Twitter) handle with required screenname, without the @ prefix. Optional rest_id is the numeric account ID and takes precedence over screenname; screenname remains required by the request schema. An observed successful response has status=active, profile, rest_id, id, name, desc, website, avatar, header_image, location, created_at, protected, blue_verified and verification_type. Account counters include sub_count (followers), friends (following), statuses_count and media_count; affiliates and business_account may also be present. A nonexistent handle returned status=notfound with null identity and count fields, rather than a profile or numeric zero. Preserve IDs as strings, allow nullable fields and store the collection time with changing public counters. Verification labels are platform metadata, not proof of identity or ownership.
API Features
Live API Demo
🔒 Sign in to try it live
Log in to call this API with your own API key. New accounts get 100 free credits — no card required.
Log in / Sign upNo active API key found. Create one in your Dashboard, then reload this page. Dashboard →
/api/project/twitter/user-info API Response (JSON)
{} curl -X GET 'https://api.opendata-api.com/api/project/twitter/user-info?key=<API_KEY>&screenname=NASA'
Query Result
Use Cases
- Enrich an opt-in directory of public handles with returned names, biographies, avatar links and stable account IDs.
- Record dated profile-count snapshots for competitor research while keeping missing accounts separate from numeric zero.
- Resolve a supplied username into a string account ID before joining its posts to an existing research dataset.
- Validate social-profile links during onboarding and route notfound results for correction without treating a verification label as identity proof.
Frequently asked questions
How do I turn a Twitter username into a user ID?
Call user-info with required screenname without the @ prefix. An observed active profile includes rest_id and id; preserve them as strings. Optional rest_id takes precedence over screenname, but the request schema still requires screenname.
What should I do when a profile has status=notfound?
Treat it as an unavailable handle rather than a profile with zero activity. The verified notfound response has null identity and count fields. Preserve those nulls and correct or review the input before requesting an account timeline.