RequestBeam Docs
Get User Timeline
Query a Twitter user's timeline by user ID and return normalized tweets, author expansions, and pagination metadata.
https://api.requestbeam.com/v1/twitter/users/{id}/tweetsQuery a user's timeline by normalized user ID. The endpoint returns X API v2-style data / includes / meta structures.
GET https://api.requestbeam.com/v1/twitter/users/{id}/tweetsAuthentication
All Twitter API endpoints require Bearer Token authentication.
Authorization: Bearer YOUR_API_KEYPath Parameters
idstringrequiredTwitter user ID, such as 44196397.
Query Parameters
max_resultsintegerDefault: 10Number of tweets to return in one page, from 1 to 100.
pagination_tokenstringCursor for the next page, copied from the previous response's meta.next_token.
excludestringComma-separated exclusion policy. Supported values include replies and retweets.
expansionsstringComma-separated expansion fields. Use author_id to include includes.users.
tweet.fieldsstringComma-separated tweet fields, such as created_at,public_metrics,attachments,source.
user.fieldsstringControls fields in includes.users when expansions=author_id is requested.
Request Example
curl --request GET \
"$API_BASE_URL/v1/twitter/users/44196397/tweets?max_results=5&exclude=retweets,replies&expansions=author_id&tweet.fields=created_at,public_metrics,attachments,author_id,conversation_id&user.fields=public_metrics" \
--header "Authorization: Bearer YOUR_API_KEY"Response
dataobject[]requiredTimeline tweet list.
Tweet fields
idstringrequiredTweet ID.
textstringrequiredTweet text content.
attachmentsobjectMedia references, currently returned as media_keys.
author_idstringAuthor ID. When expansions=author_id is requested, it corresponds to includes.users.
conversation_idstringConversation ID.
created_atstringTweet creation time in ISO 8601 format.
edit_history_tweet_idsstring[]Tweet IDs in the edit history.
entitiesobjectParsed tweet entities, such as hashtags, URLs, and mentions.
in_reply_to_user_idstringID of the user being replied to.
langstringTweet language.
possibly_sensitivebooleanWhether the content is sensitive.
public_metricsobjectPublic tweet metrics.
public_metrics fields
retweet_countintegerNumber of retweets.
reply_countintegerNumber of replies.
like_countintegerNumber of likes.
quote_countintegerNumber of quotes.
bookmark_countintegerNumber of bookmarks.
impression_countintegerNumber of impressions.
referenced_tweetsobject[]Referenced tweets. type may be retweeted, quoted, or replied_to.
sourcestringTweet source, such as a client or the Web.
includesobjectExpanded objects. Appears when expansions includes author_id.
includes fields
usersobject[]Author list corresponding to author_id.
metaobjectrequiredPagination and result metadata.
meta fields
newest_idstringNewest tweet ID in the current page.
oldest_idstringOldest tweet ID in the current page.
next_tokenstringCursor for the next page. Send it as pagination_token.
result_countintegerrequiredNumber of tweets in the current page.
Success Example
{
"data": [
{
"id": "tweet-1",
"text": "Hello Mars",
"author_id": "44196397",
"created_at": "2025-04-22T10:00:00.000Z",
"public_metrics": {
"retweet_count": 3,
"reply_count": 2,
"like_count": 7
}
}
],
"includes": {
"users": [
{
"id": "44196397",
"name": "Elon Musk",
"username": "elonmusk"
}
]
},
"meta": {
"newest_id": "tweet-1",
"oldest_id": "tweet-1",
"next_token": "cursor-123",
"result_count": 1
}
}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"
}Pagination
If meta.next_token is present, pass it as pagination_token to fetch the next page.