RequestBeam

Documentation

RequestBeam Docs

Get User By ID

Query a Twitter user profile by user ID and return a normalized X API v2-style user object.

GEThttps://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.

text
GET https://api.requestbeam.com/v1/twitter/users/{id}

Authentication

All Twitter API endpoints require Bearer Token authentication.

http
Authorization: Bearer YOUR_API_KEY

Path Parameters

idstringrequired

Twitter user ID, such as 44196397.

Query Parameters

user.fieldsstring

Comma-separated user fields, such as verified,public_metrics,profile_image_url.

Request Example

bash
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

dataobjectrequired

Normalized user object.

data fields
idstringrequired

Unique user identifier.

namestringrequired

Display name.

usernamestringrequired

Username without @.

created_atstring

ISO 8601 timestamp, returned when user.fields=created_at is requested.

descriptionstring

User bio.

entitiesobject

Profile entities, such as URL descriptions and links.

locationstring

Location in the user profile.

pinned_tweet_idstring

ID of the pinned tweet.

profile_banner_urlstring

Profile banner URL.

profile_image_urlstring

Profile image URL.

protectedboolean

Whether the account is protected.

public_metricsobject

Public user metrics.

public_metrics fields
followers_countinteger

Number of followers.

following_countinteger

Number of accounts followed.

tweet_countinteger

Total number of tweets.

listed_countinteger

Number of lists containing the user. May be absent when the data source does not provide it.

urlstring

Website URL in the user profile.

verifiedboolean

Whether the account is verified.

verified_typestring

Verification type, such as Business.

Success Example

json
{
  "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.

json
{
  "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 Info as a standard /users/{id} resource