---
name: cheapxapi
description: "Read X (Twitter) data and act as X accounts through the cheapxapi REST API or its hosted MCP server. Use when a task needs tweets, tweet search, user profiles, timelines, followers, replies, lists or communities from X, or posting and liking as a logged-in account. $0.0006 per call."
version: 1.0.0
homepage: https://cheapxapi.com
documentation: https://cheapxapi.com/docs
mcp_page: https://cheapxapi.com/mcp
license: MIT
tags: [twitter, x, twitter-api, x-api, tweets, tweet-search, social-media-data, mcp, rest-api]
---

# cheapxapi: Twitter (X) API

cheapxapi is a pay-per-call REST API for X (Twitter) data and account actions. Base URL: `https://api.cheapxapi.com`.
Authenticate with an `x-api-key` header, or skip sign-up and pay per read call with x402 (see Two ways to pay).

## Two ways to pay

### Option A: no sign-up, pay per call with x402 (USDC on Base, eip155:8453)

- Call any read-only GET endpoint under `https://api.cheapxapi.com/twitter/` without an API key (or the same path under `https://api.cheapxapi.com/x402/twitter/`).
  The API answers HTTP 402 Payment Required. The `PAYMENT-REQUIRED` header (base64 JSON) holds the price:
  $0.001 per call (amount 1000, USDC has 6 decimals), scheme `exact`, network `eip155:8453`, payTo `0xc5cdb3993f49828ee85e34FF0aF1531BD6995b6d`.
- Retry the same request with the signed payment in `PAYMENT-SIGNATURE` (x402 v2) or `X-PAYMENT` (x402 v1, network `base`).
  The receipt comes back in `PAYMENT-RESPONSE` (also sent as `X-PAYMENT-RESPONSE`).
- You pay only when data comes back. Errors are not charged, and not-found or empty results come back with `x-payment-status: not-charged`.
- The same price applies to every read-only endpoint, including the batch profile lookup.
- Account actions (posting, liking, following) and the MCP server need an API key.

### Option B: API key

- Send `x-api-key: <key>`. $0.0006 per call from a prepaid balance; new accounts get a $1 promotional credit.
- Sign up: https://cheapxapi.com/signup

## MCP Registry

Official MCP Registry IDs for this server: `com.cheapxapi/twitter-x-search-tweets-mcp`, `com.cheapxapi/x402-twitter-x-search-tweets-mcp`, `com.cheapxapi/mcp-server`.

## Pricing

- $0.0006 per call ($0.60 per 1,000 calls) on every read and account action.
  The one exception: logging in to an X account for account actions costs $0.10.
- One search or timeline call returns up to 20 tweets, so 1,000 tweets cost about $0.03.
  The official X API charges $0.005 per tweet read ($5.00 per 1,000), so this is about 99% less.
- Pay as you go: prepaid balance, no monthly plan, and paid balance never expires.
- New accounts get a $1.00 promotional credit (valid for 60 days). No card needed.
- Top up with cryptocurrency. Card payments are coming soon.
- Details: https://cheapxapi.com/pricing

## Get an API key

1. Sign up at https://cheapxapi.com/signup (Google or email).
2. Copy the key from https://cheapxapi.com/dashboard. It is shown once, on your first visit.
3. Keep it in an environment variable, for example `export CHEAPXAPI_KEY=...`. Never put it in code or commits.

## Call the API

```bash
# User profile by username (data.id is the numeric user ID)
curl "https://api.cheapxapi.com/twitter/user/info?userName=NASA" \
  -H "x-api-key: $CHEAPXAPI_KEY"

# Latest tweets of a user (userName or userId), up to 20 per call
curl "https://api.cheapxapi.com/twitter/user/last_tweets?userName=NASA" \
  -H "x-api-key: $CHEAPXAPI_KEY"

# Advanced search with X query operators; queryType is Latest or Top
curl -G "https://api.cheapxapi.com/twitter/tweet/advanced_search" \
  --data-urlencode 'query=from:NASA since:2026-01-01 -filter:replies' \
  --data-urlencode 'queryType=Latest' \
  -H "x-api-key: $CHEAPXAPI_KEY"

# Several users by ID in one call
curl "https://api.cheapxapi.com/twitter/user/batch_info_by_ids?userIds=11348282,783214" \
  -H "x-api-key: $CHEAPXAPI_KEY"
```

Common endpoints (GET, all $0.0006 per call):

| Endpoint | Required parameters | Returns |
|---|---|---|
| `/twitter/user/info` | `userName` | One user profile |
| `/twitter/user/batch_info_by_ids` | `userIds` (comma-separated) | Several profiles |
| `/twitter/user/last_tweets` | `userName` or `userId` | A user's latest tweets |
| `/twitter/tweet/advanced_search` | `query`, `queryType` | Tweets matching an X search query |
| `/twitter/tweets` | `tweet_ids` (comma-separated) | Tweets by ID |
| `/twitter/tweet/replies` | `tweetId` | Replies to a tweet |
| `/twitter/user/followers` | `userName` | Followers with full profiles |
| `/twitter/user/followings` | `userName` | Accounts a user follows |
| `/twitter/user/search` | `query` | Users matching a keyword |

The full list (lists, communities, trends, quotes, retweeters, and account actions such as posting, liking,
following and direct messages) is in https://cheapxapi.com/docs and the OpenAPI spec at https://api.cheapxapi.com/openapi.json.
A plain-text reference for LLMs is at https://cheapxapi.com/llms-full.txt.

## Pagination, limits and errors

- Paginated responses include `has_next_page` and `next_cursor`. Pass `cursor=<next_cursor>` to get the next page. Each page is one call.
- New accounts can make 2 requests per second; after the first top-up, 10 per second.
- Requests over a limit get HTTP 429 and are not charged. Back off and retry.
- An invalid key or an empty balance returns an error and is not charged.

## MCP server

Hosted MCP server with read-only X data tools (profiles, tweets, search, followers, lists, communities, trends).
URL: `https://api.cheapxapi.com/mcp`, authenticated with the same `x-api-key` header. Each tool call costs $0.0006.

```bash
# Claude Code
claude mcp add --transport http cheapxapi https://api.cheapxapi.com/mcp \
  --header "x-api-key: YOUR_KEY"
```

```json
{
  "mcpServers": {
    "cheapxapi": {
      "url": "https://api.cheapxapi.com/mcp",
      "headers": { "x-api-key": "YOUR_KEY" }
    }
  }
}
```

Setup for Cursor and other clients: https://cheapxapi.com/mcp

## Install this skill

```bash
# Claude Code
mkdir -p ~/.claude/skills/cheapxapi && curl -fsSL https://cheapxapi.com/SKILL.md -o ~/.claude/skills/cheapxapi/SKILL.md
```

## Links

- Docs: https://cheapxapi.com/docs
- Pricing: https://cheapxapi.com/pricing
- MCP: https://cheapxapi.com/mcp
- AI agents (setup and three workflows): https://cheapxapi.com/agents
- Benchmarks (measured latency and success rate): https://cheapxapi.com/benchmarks
- vs the official X API: https://cheapxapi.com/vs/official-x-api
- vs Apify Twitter scrapers: https://cheapxapi.com/vs/apify-twitter-scraper
- OpenAPI: https://api.cheapxapi.com/openapi.json
- llms.txt: https://cheapxapi.com/llms.txt
