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
30-day availability100% Live · the share of time the endpoints were serving calls
DataFetched liveboards are 5-minute snapshots

The 21 endpoints for X, and what each returns

  • X community posts: Get a page of the posts in an X community by the community's ID.
  • X list posts: Get a page of the posts on an X list's timeline by the list's ID, newest first, about 100 a page.
  • X article detail: Get the long-form article attached to an X post by the post's ID: title, full text, author, time published, and its like, reply and view counts.
  • X post detail: Get one X post by ID or link: text, author, time posted, and its like, reply, retweet, quote, bookmark and view counts.
  • X post quotes: Get a page of the X posts that quote a post, newest first or most popular first.
  • X post replies: Get a page of the replies under an X post by its ID, in the platform's order of relevance; a reply on X is itself a post and is returned as one.
  • X post retweeters: Get a page of the accounts that retweeted an X post, by the post's ID: handle, name, bio, follower count.
  • X post search: Find X posts by search terms, most popular or newest first; the terms may use X's own search operators, such as from:handle.
  • X thread context: Get the posts of an X thread by the ID of any post in it: the root post, the author's follow-ups and the replies among them.
  • X trends: Get the top 30 of what is trending on X now, with rank: worldwide, or in one country.
  • X user followers: Get a page of the accounts following an X user, up to 200 a page, newest followers first.
  • X user following: Get a page of the accounts an X user follows, up to 200 a page.
  • X user profile: Get an X user's profile by handle or ID: name, bio, follower and following counts, whether it has a badge and which (a business's gold, a government's grey), the location it gives, its website; up to 100 IDs in one request.
  • X user mentions: Get a page of the posts that mention an X user, newest first.
  • X user posts: Get a page of the posts on an X user's profile by handle, newest first; tab chooses the posts, replies or media tab. The posts tab holds the account's retweets: ext.is_retweet marks them, with the original post's ID and its author's ID.
  • X user search: Find X accounts by search terms, about 20 a page: handle, name, bio, follower count, verification.
  • X community profile: Get an X community by its ID: name, description, members, moderators, how people join, when it was created.
  • X community members: Get a page of the accounts that have joined an X community, by the community's ID, about 20 a page: handle, name, bio, follower count, verification.
  • X list followers: Get accounts that follow an X list, by the list's ID, up to 20: handle, name, bio, follower count, verification. This page only, with no further page.
  • X list members: Get a page of the accounts an X list is made of, by the list's ID, 20 a page: handle, name, bio, follower count, verification.
  • X video transcript: Get what is said in the video of an X post by ID or link, as one text; videos up to two minutes long.

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 Nov 22, 2026, 09:05 UTCRecorded
1 Boise State
2 #LasVegasGP
3 SDSU
4 #LENAMIUBDParty
5 LENAMIU BIRTHDAY PARTY
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 OneFeedAPI 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://onefeedapi.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://onefeedapi.com/agents.md and set up OneFeedAPI in this agent. My API key is dx_live_…; use it for every OneFeedAPI 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://onefeedapi.com/v1/x/posts/search" \
  --data-urlencode "query=weather forecast" \
  -H "Authorization: Bearer $ONEFEED_API_KEY"
# pip install onefeedapi
from onefeedapi import OneFeedAPI

dx = OneFeedAPI()  # reads ONEFEED_API_KEY
result = dx.x.posts.search(query="weather forecast")
print(result["data"]["items"])
// npm i @onefeedapi/sdk
import { OneFeedAPI } from "@onefeedapi/sdk";

const dx = new OneFeedAPI(); // reads ONEFEED_API_KEY
const result = await dx.x.posts.search({ query: "weather forecast" });
console.log(result.data.items);
onefeedapi call x.posts.search 'query=weather forecast'
{
  "mcpServers": {
    "onefeedapi": {
      "type": "http",
      "url": "https://onefeedapi.com/mcp",
      "headers": {
        "Authorization": "Bearer ${ONEFEED_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.
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. An account's posts, a post's replies and a list's posts answer upstream_failed 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.

What X data can I get through the API?

21 endpoints: posts, users, threads, trends, X Communities, X Lists. Each endpoint's page gives its parameters and fields, with a recorded response.

How do I call the X (Twitter) API?

Sign up for a key, send it as Authorization: Bearer <key> and call the endpoint's address, for example GET https://onefeedapi.com/v1/x/communities/posts/list. Or connect OneFeedAPI to Claude, Cursor or ChatGPT (MCP) and ask in a sentence. The free trial needs no card.

How many tokens does a X API response take in an AI?

Across 21 X endpoints, one recorded real response each, the platform's own JSON comes to 247k tokens and what an AI reads through OneFeedAPI's MCP server to 60k, 76% fewer; the JSON of a direct API call is 61% fewer (counted 2026-11-06). Every platform uses the same field names, and fields returns only the ones you name.

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 OneFeedAPI 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.

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