Twitter User API (X Profile API)
Twitter User API (X Profile API) — get an X profile by username with follower, following, tweet, and like counts, bio, avatar, and verification. JSON, $0.01 per call.
/v1/twitter/userThe Twitter User API (X Profile API) returns a public X profile from a handle: display name, bio, location, website, follower and following counts, tweet and media counts, avatar and banner, blue-check and verification type, and pinned tweet IDs. The id it returns works as user_id on User Tweets, Followers, and the other timeline endpoints.
Usage
const res = await fetch('https://api.yepapi.com/v1/twitter/user', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({"username": "NASA"}),
});
const { data } = await res.json();
console.log(data);curl -X POST https://api.yepapi.com/v1/twitter/user \
-H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"username": "NASA"}'import requests
res = requests.post(
"https://api.yepapi.com/v1/twitter/user",
headers={"x-api-key": "YOUR_API_KEY"},
json={"username": "NASA"},
)
print(res.json()["data"])Request Body
| Parameter | Type | Required | Description | Default |
|---|---|---|---|---|
username | string | Yes | X handle — NASA, @NASA, or an x.com / twitter.com profile URL | — |
Response
{
"ok": true,
"data": {
"avatar": "https://pbs.twimg.com/profile_images/1321163587679784960/0ZxKlEKB_400x400.jpg",
"banner": "https://pbs.twimg.com/profile_banners/11348282/1788992290",
"created_at": "2007-12-19T20:20:32+00:00",
"description": "Making the seemingly impossible, possible. ✨",
"followers_count": 92298682,
"following_count": 115,
"id": "11348282",
"is_blue_verified": true,
"likes_count": 17049,
"listed_count": 96844,
"location": "Pale Blue Dot",
"media_count": 28221,
"name": "NASA",
"pinned_tweet_ids": [
"2116263878807998722"
],
"protected": false,
"tweet_count": 74477,
"url": "https://x.com/NASA",
"username": "NASA",
"verified": false,
"verified_type": "Government",
"website": "http://www.nasa.gov/"
}
}Response Fields
| Field | Type | Description |
|---|---|---|
ok | boolean | Whether the request succeeded |
data.id | string | Numeric user ID — use it as user_id on timeline endpoints |
data.username | string | Handle without @ |
data.name | string | Display name |
data.description | string | null | Bio |
data.location | string | null | Location from the profile |
data.website | string | null | Website link from the profile |
data.created_at | string | Account creation, ISO 8601 |
data.avatar | string | null | Profile image URL (400×400) |
data.banner | string | null | Banner image URL |
data.url | string | x.com profile URL |
data.followers_count | number | Followers |
data.following_count | number | Accounts followed |
data.tweet_count | number | Posts, including replies and reposts |
data.likes_count | number | Posts liked |
data.media_count | number | Photos and videos posted |
data.listed_count | number | Lists the account is on |
data.is_blue_verified | boolean | Has a blue check |
data.verified | boolean | Legacy verification flag |
data.verified_type | string | null | Business, Government, or null |
data.protected | boolean | Posts are protected (private) |
data.pinned_tweet_ids | string[] | IDs of pinned posts |
Caching
Responses are cached for 1 hour.
Errors
| Status | Code | When |
|---|---|---|
400 | VALIDATION_ERROR | username is missing or not a valid X handle |
404 | NOT_FOUND | User not found or suspended |
429 | RATE_LIMITED_UPSTREAM | Too many requests in a short burst — retry after a few seconds |
502 / 503 | UPSTREAM_ERROR / SERVICE_UNAVAILABLE | Temporary problem fetching data from X — retry later |
Failed calls are not charged.
Related Endpoints
- Tweet Scraper API — this account's tweets
- About Account — the "About this account" panel: country, username changes, verified since
- Users Lookup — up to 100 profiles by ID in one call
Twitter Search API (X Search API)
Twitter Search API (X Search API) — search tweets with every X search operator, or search accounts. Top, latest, people, or media results as JSON for $0.01 per call.
X / Twitter About Account API
Get the About this account panel for any X (Twitter) profile — country the account is based in, username changes, verified since, connection type, and affiliation. JSON, $0.01 per call.