RequestBeam

Twitter API

Twitter API: user lookup, timelines, and pagination

Integrate RequestBeam Twitter / X endpoints with Bearer authentication, user and tweet field selection, cursor pagination, and validation-error handling.

Resolve a username to a user ID, fetch that user's timeline, and pass the returned next token to request another page. Successful calls return JSON directly; there is no Jobs polling step for these endpoints.

Built for a specific job

Implement the three supported GET operations and handle their results.

01

Resolve an account by username and select the profile fields to return.

02

Refresh a known account by user ID without another username lookup.

03

Retrieve timeline pages with a page-size limit and a pagination token.

Billing unit

Know how usage is measured

USD per request.

Operational limits

  • Returned fields depend on the documented query parameters and upstream response.
  • max_results must be an integer from 1 to 100. A page may contain fewer results.
  • Keep user IDs and tweet IDs as strings to avoid numeric precision loss.

Integration guides

Choose your next step

Current catalog coverage

Available APIs and billing units

Compare API IDs, operations, providers, protocols, and prices. Check the catalog date and each operation's billing unit before estimating usage costs.

Data API

Twitter User Data

twitter-user-data
active

Retrieve public Twitter / X user profiles and user timelines.

Provider
Twitter / X Data
Catalog protocol
REST
Billing unit
request
Published operations
  • GET /v1/twitter/users Get user by username
  • GET /v1/twitter/users/{id} Get user by ID
  • GET /v1/twitter/users/{id}/tweets Get user tweets

Our price

Request
$0.0020 /request

Get user by username

GET /v1/twitter/users

Our price

Request
$0.0020 /request

Get user by ID

GET /v1/twitter/users/{id}

Our price

Request
$0.0020 /request

Get user tweets

GET /v1/twitter/users/{id}/tweets

Our price

Request
$0.0020 /request

Request example

Start from the documented operation

GET /v1/twitter/users?username=OpenAI&user.fields=description,public_metrics
curl "https://api.requestbeam.com/v1/twitter/users?username=OpenAI&user.fields=description,public_metrics" \
  -H "Authorization: Bearer <API_KEY>"

Use the API base URL from your account documentation and replace the example placeholders. Send your API key in the Authorization header; never include it in a URL or committed file.

Endpoints

Three operations for accounts and timelines

Find by username GET /v1/twitter/users?username=<USERNAME>

Read the returned data.id as a string for subsequent requests.

Find by user ID GET /v1/twitter/users/<USER_ID>

Retrieve a known account and optionally select its profile fields.

User timeline GET /v1/twitter/users/<USER_ID>/tweets

Set max_results and pass pagination_token for subsequent pages.

Query parameters

Select fields and paginate a timeline

Account lookup
username is required on /v1/twitter/users. Both lookup endpoints accept a comma-separated user.fields list, such as description,public_metrics.
Page size
max_results accepts integers from 1 to 100. It is an upper bound on the page size, not a guarantee of that many posts.
Timeline fields
Use tweet.fields=created_at,public_metrics for timestamps and metrics. Request expansions=author_id with user.fields when you need available author details. Use exclude=replies,retweets to exclude those post types.
Next page
Pass meta.next_token from the response as pagination_token on the next request. Treat the token as opaque and URL-encode it. Stop when no next token is returned, your page budget is reached, or a token repeats.

Response handling

Read JSON results directly

User lookups return the account in data. Timeline responses contain a data array and meta.result_count, with meta.next_token when another cursor is available. Author expansions may appear in includes.users.

{
  "data": [],
  "meta": {
    "result_count": 0
  }
}

Illustrative empty timeline response, not a live account result. Optional fields and cursors may be absent. An empty page is not evidence that an account has never posted.

Validation errors

Correct invalid parameters before retrying

A missing username or an out-of-range max_results returns HTTP 400 with success: false, error.code: 10001, an error.message, and a requestId. Inspect the message and correct the request rather than retrying it unchanged.

Request tracing

Keep a request ID, not a credential

Retain the X-Request-Id response header for support and request tracing. Check HTTP status before reading a success payload, and keep API keys and unnecessary profile data out of application logs.