Skip to content
cheapxapi
All endpoints

Documentation

X API documentation

31 endpoints for reading public X data and 23 account actions, priced per request. Everything on these pages is generated from our OpenAPI spec, which you can also load into Postman or any OpenAPI client.

Quickstart

  1. 01

    Create an account

    Sign up with Google or an email address.

  2. 02

    Copy your API key

    Your dashboard shows the key once, the first time you open it. Store it somewhere safe; you can generate a new one at any time.

  3. 03

    Send your first request

    Pass the key in the x-api-key header.

    curl "https://api.cheapxapi.com/twitter/user/info?userName=NASA" \
      -H "x-api-key: YOUR_KEY"

Essentials

API for public X (Twitter) data and account actions.

Authentication — send your API key in the x-api-key request header. Keys in the URL are rejected.

Pricing (data endpoints) — $0.0006 per request, pay as you go. Every request is charged except when the failure is on our side:
charged: successful responses, "not found" style responses (e.g. user does not exist), invalid parameters, unknown endpoints;
not charged: rate-limited requests (429), insufficient balance (402), invalid key (401), items reported as not found with HTTP 404, and service errors (503).
Each charged response carries x-balance-remaining (USD); every response carries x-request-id.

Rate limits — 2 requests per second for new accounts, 10 per second for paid accounts; at most 10 requests in flight per account.

Not found results — most endpoints report a missing user, tweet or list as HTTP 200 with "status": "error" (charged). Always check the status field, not only the HTTP status code.

Pagination — paginated endpoints return has_next_page and next_cursor. Pass next_cursor as cursor to get the next page.
Stop when has_next_page is false or next_cursor is empty; the API sets both when the end is reached. Use has_next_page (some endpoints also return a legacy has_next field; ignore it).

Timeouts — most requests return in under a second, some take several seconds; set your client timeout to at least 75 seconds.

Account actions — post, like, retweet, follow, message and more as an X account you control.
First call Log in to an X account to get login_cookies, then send login_cookies and the same proxy with every action.
We pass these values through for the request only and never store or log your password, two-factor secret, login_cookies or proxy credentials.
Pricing: login $0.1 per request, every other action $0.0006 per request. HTTP 200 is charged, including when X rejects the action ("status": "error", the reason is in message); invalid fields (400), rate limits and service errors are not.
Do not retry an action automatically after a timeout: it may already have been applied on X.
X limits how often each account may act; we cap posts and messages at 5 per minute and follows at 15 per minute per X account to protect it.

X API endpoints

Account actions