Docs menu: Overview

TwitterXAPI documentation

Profiles, posts, threads, followers, search, Lists, trends and communities as JSON, with one API key.

Quickstart

1Sign up with GoogleYour key is on the dashboard.
2Save it as an env varTWITTERXAPI_KEY
3Make your first requestFetch a profile below.
curl "https://twitterxapi.com/api/v1/users/marclou" \
  -H "Authorization: Bearer $TWITTERXAPI_KEY"
  1. Read the next page. Pass pagination.next_cursor as cursor until has_more is false. Pagination

Basics

Base URLhttps://twitterxapi.com/api. REST routes are under /v1; the MCP server is /mcp.
AuthenticationAuthorization: Bearer <key> on every request. Quickstart
Response formatJSON. Choose level=moderate (default), contentful or raw. Response levels
PaginationOne page per request, continued with a cursor. Pagination
BillingPrepaid credit, per record returned. Lookups cost $0.001. Failed requests are refunded. Errors and billing
Larger readsQueue an account's posts or a search and download one NDJSON file. Queued jobs

All endpoints

Posts — Post details, replies, threads and retweeters
/v1/posts/{postId}Post details
/v1/posts/{postId}/repliesDirect replies
/v1/posts/{postId}/threadConversation thread
/v1/posts/{postId}/retweetersRetweeters
Search — Posts, accounts and trend searches
/v1/searchSearch posts
/v1/search/usersSearch accounts
/v1/search/trendSearch a trend
Lists — List posts and members
/v1/lists/{listId}/postsList posts
/v1/lists/{listId}/membersList members
Trends — Trend pages by category
/v1/trends/{category}Trends
Communities — Community records, posts, members, moderators
/v1/communities/{communityId}Community information
/v1/communities/{communityId}/postsCommunity posts
/v1/communities/{communityId}/membersCommunity members
/v1/communities/{communityId}/moderatorsCommunity moderators

Status codes

StatusMeaning
200Success. Collection routes return one page.
202Queued job accepted.
400Invalid parameter, or a limit parameter on a live route.
401Missing or invalid API key.
402Balance too low for the request or queued job.
404The account, post, List, community or job was not found.
429Busy or rate limited. Wait for Retry-After when present, then retry.
5xxTemporary upstream or service failure. Retry with backoff.

Error bodies carry a stable code and a request ID. Errors and billing