# X (Twitter) API for AI agents and LLMs: fewer tokens, called from Claude and Cursor (2026)

OneFeedAPI has 21 X (Twitter) endpoints, and what an AI reads of them through MCP takes 76% fewer tokens than the platform's raw JSON: a page of post search results is 36k tokens raw and 4,385 as the AI reads it. One key, no X (Twitter) account of yours. OneFeedAPI reads X (Twitter) with 21 endpoints, from $0.0003 a call; a failed call is not charged, and the free trial covers up to 333 calls.

Updated 2026-11-06

## Why does an agent care how big an answer is?

Every token of a tool's answer goes into the agent's context and is paid for as input. X (Twitter)'s raw JSON is made for its own app, with many fields nested deep. Across OneFeedAPI's 21 X (Twitter) endpoints, one recorded real response each, the raw JSON comes to 247k tokens and what an AI reads through MCP to 60k. With the context saved, an agent reads more pages and takes more steps in one conversation, and sooner.

Every platform uses the same names: the author in `author`, counts in `metrics`, the time in `published_at` as UTC, the next page in `page.next_cursor`. A field the platform does not give is listed in `meta.unavailable`, so the AI does not read it as 0.

## How do I connect it?

To connect: paste this to your AI assistant: “Read https://onefeedapi.com/agents.md and set up OneFeedAPI here. My API key is dx_…; use it for every OneFeedAPI call.” A client that takes a remote MCP server can be given `https://onefeedapi.com/mcp` with the header `Authorization: Bearer <key>` instead.

## What to ask once it is connected

Say what you want: the agent finds the endpoint and its price, then calls it; finding and reading parameters are free.

| You say | What it calls |
| --- | --- |
| Recent posts on X about this product | `x.posts.search` |
| This post's reposts, likes and views (a link) | `x.posts.get` |
| The replies to this post | `x.posts.replies.list` |
| This account's recent posts | `x.users.posts.list` |

## What does it cost?

Paid per call; a failed call is not charged. A page of post search results is $0.0020; the free trial covers up to 333 calls. Give the agent its own key with a limit; `X-Max-Price` caps what one call may cost.

## Why OneFeedAPI

- Steady: endpoints were available 100% of the last 30 days, on a public status page you can check.
- Fast: a paid call took 2.1 seconds at the median over the last 7 days (counted 2026-11-06).
- Fewer tokens: across 21 endpoints on X (Twitter), 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 too (counted 2026-11-06). Every platform answers in one shape: the author in `author`, counts in `metrics`, the next page in `page.next_cursor`, so another platform needs no new parser.
- See before you pay: every endpoint's page shows a recorded real response, field by field.
- Spending you control: a failed call is not charged; each key can have a limit, `X-Max-Price` caps one call, and the same `Idempotency-Key` within 24 hours is never charged twice.
- Ready for AI: a remote MCP server listed in the official MCP registry as `com.onefeedapi/mcp`, usable from Claude, Cursor and ChatGPT.
- Free trial of up to 333 calls, no card.

## Endpoints

- [X post search](https://onefeedapi.com/apis/x/posts/search/) ($0.0020 / a call): 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 post detail](https://onefeedapi.com/apis/x/posts/get/) ($0.0003 / a call): Get one X post by ID or link: text, author, time posted, and its like, reply, retweet, quote, bookmark and view counts.
- [X post replies](https://onefeedapi.com/apis/x/posts/replies/list/) ($0.0020 / a call): 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 user posts](https://onefeedapi.com/apis/x/users/posts/list/) ($0.0020 / a call): 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.

## More about X (Twitter)

- [X (Twitter) API](https://onefeedapi.com/apis/x/)
- [How do I get X (Twitter) trends for a country?](https://onefeedapi.com/answers/how-to-get-x-trends-for-a-country/)
- [Watching X (Twitter) accounts, and the official API costs too much: what now? (2026)](https://onefeedapi.com/answers/watch-x-accounts-official-api-too-expensive/)
- [How to get only an X account's own posts, without retweets (2026)](https://onefeedapi.com/answers/x-own-posts-without-retweets/)
- [How to search X (Twitter) posts by keyword](https://onefeedapi.com/guides/x-search-posts-by-keyword/)
- [How to get X (Twitter) trending topics by country](https://onefeedapi.com/guides/x-trends-by-country/)
- [How to get replies to an X (Twitter) post](https://onefeedapi.com/guides/x-post-replies/)

---

Catalog revision dc959672dd18e2d0. [HTML version](https://onefeedapi.com/answers/x-twitter-api-for-ai-agents/)
