RequestBeam Docs
Get User By ID
Query a Twitter user profile by user ID and return a normalized X API v2-style user object.
https://api.requestbeam.com/v1/twitter/users/{id}When you already have a normalized user ID, query this resource directly instead of resolving a username again.
GET https://api.requestbeam.com/v1/twitter/users/{id}Authentication
All Twitter API endpoints require Bearer Token authentication.
Authorization: Bearer YOUR_API_KEYPath Parameters
idstringrequiredTwitter user ID, such as 44196397.
Query Parameters
user.fieldsstringComma-separated user fields, such as verified,public_metrics,profile_image_url.
Request Example
curl --request GET \
"$API_BASE_URL/v1/twitter/users/44196397?user.fields=verified,public_metrics,profile_image_url" \
--header "Authorization: Bearer YOUR_API_KEY"Response
dataobjectrequiredNormalized user object.
data fields
idstringrequiredUnique user identifier.
namestringrequiredDisplay name.
usernamestringrequiredUsername without @.
created_atstringISO 8601 timestamp, returned when user.fields=created_at is requested.
descriptionstringUser bio.
entitiesobjectProfile entities, such as URL descriptions and links.
locationstringLocation in the user profile.
pinned_tweet_idstringID of the pinned tweet.
profile_banner_urlstringProfile banner URL.
profile_image_urlstringProfile image URL.
protectedbooleanWhether the account is protected.
public_metricsobjectPublic user metrics.
public_metrics fields
followers_countintegerNumber of followers.
following_countintegerNumber of accounts followed.
tweet_countintegerTotal number of tweets.
listed_countintegerNumber of lists containing the user. May be absent when the data source does not provide it.
urlstringWebsite URL in the user profile.
verifiedbooleanWhether the account is verified.
verified_typestringVerification type, such as Business.
Success Example
{
"data": {
"id": "44196397",
"name": "Elon Musk",
"username": "elonmusk",
"profile_image_url": "https://img.example/profile.jpg",
"public_metrics": {
"followers_count": 10,
"following_count": 20,
"tweet_count": 40
},
"verified": true
}
}Error Response
See Error Codes and Troubleshooting for the full code reference, protocol differences, and diagnostic steps.
{
"success": false,
"error": {
"code": 40000,
"message": "Insufficient credit. Required: 100000, Available: 99999"
},
"requestId": "req_xxx"
}When To Use
- You already have the user's
id - You want to avoid username changes
- You want to treat
User Infoas a standard/users/{id}resource