RequestBeam Docs
Twitter API
Use a unified Twitter API to query user profiles and timelines with X API v2-style response shapes.
This service provides a unified Twitter REST API. Callers receive consistent X API v2-style response structures.
text
/v1/twitterAuthentication
All Twitter API endpoints require Bearer Token authentication.
http
Authorization: Bearer YOUR_API_KEYBase Path
Call these relative paths under your API Base URL.
text
GET https://api.requestbeam.com/v1/twitter/users
GET https://api.requestbeam.com/v1/twitter/users/{id}
GET https://api.requestbeam.com/v1/twitter/users/{id}/tweetsResponse Shape
Successful Twitter API responses are not wrapped in success/data; they directly return normalized data, includes, and meta fields.
Supported Capabilities
User InfoQuery a Twitter user by username, or query a user resource directly by id.User TimelineQuery a user's timeline by id, including normalized tweets, expanded authors, and pagination metadata.
Recommended Flow
- If you only have a
username, call Get User By Username first and readdata.id. - Use
data.idto call Get User Timeline. - If you need author profile data in timeline responses, pass
expansions=author_id.
Normalization Rules
- User endpoints return one user object:
{ "data": { ... } } - Timeline endpoints return a tweet array:
{ "data": [ ... ], "meta": { ... } } - When
expansions=author_idis requested, timeline responses includeincludes.users user.fieldsandtweet.fieldscontrol optional field projection- User objects always keep
id,name, andusername - Tweet objects always keep
idandtext
Optional Fields
user.fields
Supported normalized user fields:
created_atdescriptionentitieslocationpinned_tweet_idprofile_banner_urlprofile_image_urlprotectedpublic_metricsurlverifiedverified_type
tweet.fields
Supported normalized tweet fields:
attachmentsauthor_idconversation_idcreated_atedit_history_tweet_idsentitiesin_reply_to_user_idlangpossibly_sensitivepublic_metricsreferenced_tweetssource
Debugging
- Every response includes
X-Request-Id - Record it when calls fail, results look abnormal, or the service returns rate limits
- For billing questions, keep
X-Request-Idand the request time