
Read-only X (Twitter) data API for developers and AI agents: REST, hosted MCP server, TypeScript and
Read-only X (Twitter) data API for developers and AI agents: REST, hosted MCP server, TypeScript and Python SDKs.
·
Read-only public X (Twitter) data for developers and AI agents. Profiles, tweets, timelines, threads, followers, and search with the x.com operators. One credit per tweet or profile returned. Empty results and errors are free.
https://api.xdataapi.io (OpenAPI 3.1: openapi.yaml, also at https://api.xdataapi.io/openapi.yaml)https://api.xdataapi.io/mcp (Streamable HTTP, OAuth or x-api-key)Not affiliated with X Corp. Public data only. No write endpoints.
Claude Code, as a plugin — the server plus a skill that teaches the search operators and the cost rules:
claude plugin marketplace add xdataapi/xdataapi
claude plugin install xdataapi@xdataapiOr the server on its own, in any MCP client:
claude mcp add --transport http xdataapi https://api.xdataapi.io/mcpThe server signs you in with OAuth on first use. Clients without OAuth pass a key instead:
{
"mcpServers": {
"xdataapi": {
"url": "https://api.xdataapi.io/mcp",
"headers": { "x-api-key": "xd_live_..." }
}
}
}Stdio-only clients can bridge with mcp-remote:
{
"mcpServers": {
"xdataapi": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://api.xdataapi.io/mcp", "--header", "x-api-key:${XDATAAPI_KEY}"],
"env": { "XDATAAPI_KEY": "xd_live_..." }
}
}
}Tools: get_user, get_users, get_user_tweets, get_followers, get_following, get_follower_ids,
search_tweets, get_tweet, get_tweets, get_thread, get_replies, get_quotes, get_retweeters,
get_balance. All read-only. Listed on the official MCP Registry as io.xdataapi/xdataapi.
curl "https://api.xdataapi.io/v1/tweets/search?q=from:x%20since:2026-09-01&count=20" \
-H "x-api-key: xd_live_..."Every response carries credits_charged and balance_remaining. Pages return next_cursor; pass it back as cursor.
TypeScript, npm install xdataapi:
import { xdataapi } from 'xdataapi';
const api = xdataapi({ apiKey: process.env.XDATAAPI_KEY! });
const { data } = await api.searchTweets({ query: { q: 'from:x', count: 20 } });Python, pip install xdataapi:
from xdataapi import AuthenticatedClient
from xdataapi.api.tweets import search_tweets
client = AuthenticatedClient(base_url="https://api.xdataapi.io", token=KEY, prefix="", auth_header_name="x-api-key")
page = search_tweets.sync(client=client, q="from:x", count=20)The TypeScript client has no runtime dependencies; npm install xdataapi pulls one package.
Both are generated from openapi.yaml by sdk/generate.sh; the source
is in sdk/typescript and sdk/python. Nothing in them is hand-written
except the small wrapper in sdk/typescript/src/index.ts and the READMEs, so an API change means
regenerating rather than editing.
Installable tools for agent frameworks. Each one carries the credit cost in every tool description, so
the model can see what a plan costs before it runs it, and each takes a max_results cap so one agent
step cannot empty the balance.
| Package | Install | Source |
|---|---|---|
| LangChain and LangGraph | pip install langchain-xdataapi | packages/langchain |
| LlamaIndex | pip install llama-index-tools-xdataapi | packages/llama-index |
| n8n | community node n8n-nodes-xdataapi | packages/n8n |
| Claude Code | claude plugin install xdataapi@xdataapi | plugins/xdataapi |
For anything else, see examples/: CrewAI, the Vercel AI SDK, and the OpenAI Agents SDK. An agent that speaks MCP needs none of them.
Prepaid credit packs from $10. Credits never expire. No per-call minimum. Rate limit rises with lifetime spend. Details: https://xdataapi.io/#pricing
[email protected]. Security reports: https://xdataapi.io/.well-known/security.txt
Pick your client and paste the snippet. Each one is the same server, written the way that client expects it.
claude mcp add xdataapi --transport http https://api.xdataapi.io/mcp{
"mcpServers": {
"xdataapi": {
"url": "https://api.xdataapi.io/mcp",
"headers": {
"x-api-key": ""
}
}
}
}code --add-mcp '{"name":"xdataapi","url":"https://api.xdataapi.io/mcp","headers":{"x-api-key":""}}'Runs as a hosted service. Your client connects over the network and nothing is installed locally.
Paste this prompt into your agent. It reads this page and does the setup for you.
Read https://aiagentslisting.com/mcp/xdataapi to learn what the "xdataapi" MCP server does and how to install it. Add it to my coding agent's MCP configuration as documented on that page, then confirm the server connects and list the tools it exposes.Agents can also browse this directory over MCP at https://aiagentslisting.com/api/mcp
claude mcp add --transport http xdataapi https://api.xdataapi.io/mcp| Name | What it does |
|---|---|
get_user | Profile of one X user by handle or by numeric user id. Give one of the two. The id stays the same when the user changes the handle. 1 credit. |
get_users | Profiles of up to 100 X users in one call, by handle (handles) or by numeric user id (ids). Give one of the two lists. 1 credit per profile found. |
get_user_tweets | Latest tweets of a user, newest first. 1 credit per tweet. |
get_followers | Followers of a user. 0.1 credit per profile. Not every account tier can read this; a 403 is free. |
get_follower_ids | Numeric ids of the followers of a user, no profiles. 0.02 credit per id. Same page as get_followers, so a page read there is a cache hit here. A 403 is free. |
get_following | Accounts a user follows. 0.1 credit per profile. Not every account tier can read this; a 403 is free. |
search_tweets | X advanced search. q takes the x.com operators. 1 credit per tweet or profile. product Latest is always available; Top may answer 403 (free). |
get_tweet | One tweet by numeric id, with its author. 1 credit. |
get_tweets | Up to 100 tweets by numeric id in one call. 1 credit per tweet found. |
get_thread | A tweet with its thread and replies; the focal tweet comes first. 1 credit per tweet returned. |
get_replies | Direct replies to a tweet, one page. 1 credit per reply. |
get_quotes | Tweets that quote a tweet, newest first. 1 credit per tweet. |
get_retweeters | Accounts that retweeted a tweet. 0.5 credit per profile. Not every account tier can read this; a 403 is free. |
get_balance | Credits left on this key and its rate limit. Free. |
Read live from the server on November 15, 2026.
Maintain this server? Claiming proves you own the listing and earns the last 4 points.
Claim this listingPaste this line near the top of your repository's README. The badge always renders the current score.
[](https://aiagentslisting.com/mcp/xdataapi)Nothing comparable is listed yet.
No tagged releases on record.
Connect to the AI Agents Listing MCP server at https://aiagentslisting.com/api/mcp using the HTTP transport and complete the sign-in when it asks. Then call the submit_review tool for the listing "xdataapi" with a rating from 1 to 5 and a short note on what worked and what did not.No reviews yet
Be the first to share your experience with this tool.
One email a week. New agents, MCP servers and skills, and what is actually getting traction.