X (Twitter) API

Also known asX(推特)推特

21 endpoints read X (Twitter): posts, users, threads, trends, X Communities, X Lists. From $0.0003 a call. No X login and no cookie; a failed call is free.

Endpoints21 endpointsin 6 groups, one response shape
PriceFrom $0.0003per call. Failed calls are free
When an upstream failsRetried for youChecked every day with real calls · 4 days on record
DataFetched liveboards are 5-minute snapshots

One call, as it came back

A recorded call, fields already tidied up: ready for an AI or a spreadsheet.
Recorded
GET/v1/x/posts/search$0.0020
FieldValue
typevideo
langen
published_at2026-10-12 00:44 UTC
author.verifiedtrue
author.followers7,425
metrics.likes238
metrics.comments37
metrics.favorites145

The first 8 rows of a response recorded 2026-10-12 19:10 UTC.

Run it in the Playground · $0.0020
Recorded response
{
  "code": "ok",
  "request_id": "f56e2410-206b-4506-a850-44cf2be4613e",
  "data": {
    "items": [
      {
        "id": "1860387339653354774",
        "url": "https://x.com/i/status/1860387339653354774",
        "type": "video",
        "text": "My honest take on weather forecast, a month in.",
        "lang": "en",
        "published_at": "2026-10-12T00:44:12.000Z",
        "author": {
          "id": "118815899823132376",
          "username": "trail_and_lens",
          "name": "Maya Chen",
          "avatar_url": "https://pbs.twimg.com/profile_images/1838837416644987075/31t9r3Fm_normal.jpg",
          "verified": true,
          "followers": 7425
        },
        "metrics": {
          "likes": 238,
          "comments": 37,
          "favorites": 145,
          "views": 8357,
          "reposts": 121
        },
        "images": [],
        "hashtags": [],
        "mentions": [
          {
            "id": "124366312906800227",
            "username": "fieldnotes_studio",
            "name": "Field Notes Studio"
          }
        ],
        "post_id": null,
        "parent_id": null
      },
      // … 19 more
    ]
  },
  "page": {
    "next_cursor": "c1.0BcduLiC6vViwQfDR_nS6Twlb6kjko4Qpbx3fUDt",
    "cursor_expires_at": "2026-10-12T20:10:39.000Z",
    "has_more": true,
    "returned": 20
  },
  "warnings": [],
  "meta": {
    "capability": "x.posts.search",
    "result_status": "complete",
    "fetched_at": "2026-10-12T19:10:39.000Z",
    "cached": false,
    "replayed": false,
    "unavailable": {
      "title": "platform",
      "metrics.shares": "platform",
      "is_pinned": "capability",
      "root_id": "platform"
    },
    "billing": {
      "amount": "0.002",
      "currency": "USD",
      "balance_after": "9.998"
    }
  }
}

From a response recorded 2026-10-12 19:10 UTC. Names, text and IDs are examples, and so are the links: none is the recorded one (the page shows no one's personal data); the figures are as recorded. Long lists are cut. The request ID, cursor and balance are made up.

What you can get

Each row is an endpoint: what it returns and what one call costs.

EndpointPathReturnsPrice
Posts7
X post searchGET/v1/x/posts/searchPost list$0.0020
X article detailGET/v1/x/posts/article/getPost$0.0020
X post detailGET/v1/x/posts/getPost$0.0003
X video transcriptGET/v1/x/posts/transcript/getTranscript$0.0020
X post quotesGET/v1/x/posts/quotes/listPost list$0.0003 / item
X post repliesGET/v1/x/posts/replies/listPost list$0.0020
X post retweetersGET/v1/x/posts/retweeters/listAccount list$0.0020
Users6
X user searchGET/v1/x/users/searchAccount list$0.0004 / item
X user profileGET/v1/x/users/getAccount$0.0004 / item
X user followersGET/v1/x/users/followers/listAccount list$0.0001 / item
X user followingGET/v1/x/users/following/listAccount list$0.0001 / item
X user mentionsGET/v1/x/users/mentions/listPost list$0.0003 / item
X user postsGET/v1/x/users/posts/listPost list$0.0020
Threads1
X thread contextGET/v1/x/threads/posts/listPost list$0.0003 / item
X trendsGET/v1/x/trends/listTrend list$0.0090
X community profileGET/v1/x/communities/getCommunity$0.0004
X community membersGET/v1/x/communities/members/listAccount list$0.0004 / item
X community postsGET/v1/x/communities/posts/listPost list$0.0003 / item
X list followersGET/v1/x/lists/followers/listAccount list$0.0004 / item
X list membersGET/v1/x/lists/members/listAccount list$0.0004 / item
X list postsGET/v1/x/lists/posts/listPost list$0.0020
Prices are the prices in force. A call that fails, or whose result is uncertain, costs nothing.X (Twitter) API pricing →X (Twitter) data in your AI →See live status →

Only on X

X Communities, X Lists: data that sits behind X's own dashboards and sign-ins. Here each is one GET.

X Communities API →

Community profile, posts, members

Communities on X: a community's profile, its posts and its members.

GET /v1/x/communities/posts/list$0.00033 endpoints · from $0.0003 →
X Lists API →

List posts, members, followers

Lists on X: the posts of a list, its members and its followers.

GET /v1/x/lists/posts/list$0.00203 endpoints · from $0.0004 →
X (Twitter) trending topics in the US →

What X is watching now

The platform's own list at the moment of the call, with its heat figures. The free board page shows it all.

Top 5 · read Oct 21, 2026, 09:05 UTCRecorded
1 Wemby
2 Spurs
3 Shai
4 #MyanmarCulture
5 Chet
GET /v1/x/trends/list$0.0090

What people build with it

Ready-made tasks your AI can run on X data. Each is a few calls under a spending cap.

Ask about X right inside Claude or Cursor

Add the DataXAPI MCP server and the AI finds the X endpoint it needs and calls it; answers link back to the source. You pay for the calls it makes.

X MCP setup →
https://api.dataxapi.com/mcp

Start in three steps

The call shown here is X post search. Every other X endpoint is called the same way and answers in the same envelope.

Get a key

Sign in with an emailed code or Google. Free trial, no card needed.

Call it, or let your AI call it

One GET from your code. Or paste this prompt into your agent with your key in it: it sets itself up, then finds and calls these endpoints by itself.

Read https://dataxapi.com/agents.md and set up DataXAPI in this agent. My API key is dx_live_…; use it for every DataXAPI call.

Sign in to copy it with your key

Read the same shape every time

Items are in data.items (one object in data.item), the next page in page.next_cursor, the charge in meta.billing.amount. A failed call is not charged.

Read the quickstart →
curl -G "https://api.dataxapi.com/v1/x/posts/search" \
  --data-urlencode "query=weather forecast" \
  -H "Authorization: Bearer $DATAXAPI_API_KEY"
from dataxapi import DataXAPI

dx = DataXAPI()  # reads DATAXAPI_API_KEY
result = dx.x.posts.search(query="weather forecast")
print(result["data"]["items"])
import { DataXAPI } from "@dataxapi/sdk";

const dx = new DataXAPI(); // reads DATAXAPI_API_KEY
const result = await dx.x.posts.search({ query: "weather forecast" });
console.log(result.data.items);
dataxapi call x.posts.search 'query=weather forecast'
{
  "mcpServers": {
    "dataxapi": {
      "type": "http",
      "url": "https://api.dataxapi.com/mcp",
      "headers": {
        "Authorization": "Bearer ${DATAXAPI_API_KEY}"
      }
    }
  }
}

Add this to your MCP client, then ask your agent to call x.posts.search.

Edge cases

What the X endpoints do at their edges, and what to check when a call does not return what you expected.

Page sizes
A list returns 20 to 200 items a page, depending on the endpoint. 14 of the 16 lists go on to a next page: page.next_cursor, passed back as cursor, each page a call of its own. The others return one page only.
Fields it cannot give
16 of the 21 endpoints cannot fill every field of the object they return. Each endpoint's page lists which, and every answer repeats them in meta.unavailable: a missing field is never a silent zero.
A missing object that reads as empty
X community posts, X list posts, X post quotes, X post replies, X post retweeters, X thread context, X user followers, X user following, X user mentions, X user posts, X community members, X list followers, X list members: an object that does not exist cannot be told from one with nothing under it, so the answer is an empty result, not a 404, and is charged as an empty result is.
Several in one request
With ids, one request reads several: X user profile (up to 100).
Preview structures
1 endpoint returns a preview structure whose fields may still change; the others return a standard object, the same on every platform.
Snapshots
X trends: a board is a snapshot refreshed every 5 minutes, and meta.fetched_at says when it was taken.
Handle or ID
Followers, following, mentions and an account's posts take username, the handle without the @. The profile takes a handle, an ID, or up to 100 ids.
When the account or post is not there
Followers, following, mentions, quotes and retweeters of something that does not exist come back empty and are charged as an empty result. An account's posts, a post's replies and a list's posts answer upstream_unclear instead: not charged, and worth one retry.
What the counts mean
metrics.comments is replies, metrics.favorites bookmarks and metrics.reposts retweets; quotes are counted apart, in ext.quotes.
A list's followers: one page
x.lists.followers.list returns up to 20 accounts and no further page.
Transcripts: two minutes at most
A video longer than two minutes is refused as invalid input. A video in which nothing is said, a post without a video and a post that does not exist all read as not found. Neither is charged.

Questions about the X (Twitter) API

Short answers. The details are on each endpoint's page.

How is the X (Twitter) API priced?

Per call, no subscription. From $0.0003 to $0.0400 a call; each endpoint's page shows its own price. 11 endpoints are charged by the item returned, with a least and a most a call. You are charged when data comes back; a failed call costs nothing.

Do I need a X account or a cookie?

No. One DataXAPI key is all you hold: no X login, no cookie, no device to keep alive. The endpoints return publicly visible data only.

Is the data live?

A call fetches from X at that moment, and meta.fetched_at says when. X trends: a board is a snapshot refreshed every 5 minutes. A result is kept for 24 hours, so a retry with the same Idempotency-Key is not charged again.

Is an empty result charged?

15 of the 16 endpoints charge their price when a list comes back empty: the search was run. Reading one object that does not exist answers not_found and is free.

What happens when X changes something?

A call that fails is not charged, whatever the reason. An endpoint that is paused answers capability_paused, also free, and GET /v1/catalog/status says what is up right now.

Related

Call X with one key.

Free trial on sign-up: up to 333 calls at $0.0003. No card. No X login, no cookie, no subscription. A failed call is free.

Start free