RequestBeam

Documentation

RequestBeam Docs

Get User By Username

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

GEThttps://api.requestbeam.com/v1/twitter/users

Use username to query a user profile. This endpoint is useful when you only know a username and need the normalized data.id for timeline requests.

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

Authentication

All Twitter API endpoints require Bearer Token authentication.

http
Authorization: Bearer YOUR_API_KEY

Query Parameters

usernamestringrequired

Twitter username. Both elonmusk and @elonmusk are accepted; the leading @ is removed server-side.

user.fieldsstring

Comma-separated user fields, such as created_at,description,public_metrics,verified.

Request Example

bash
curl --request GET \
  "$API_BASE_URL/v1/twitter/users?username=elonmusk&user.fields=created_at,description,public_metrics,verified" \
  --header "Authorization: Bearer YOUR_API_KEY"

Response

dataobjectrequired

Normalized user object.

data fields
idstringrequired

Unique user identifier. Prefer this value for timeline queries.

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",
    "created_at": "2009-06-02T20:12:29.000Z",
    "description": "Mars and cars",
    "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"
}

Usage Tips

  • If you only know username, call this endpoint first
  • If you plan to query a timeline, use the returned data.id
  • If you only need avatar, bio, or follower counts, pass user.fields explicitly