xdataapi: X (Twitter) data

io.xdataapi由 xdataapi.io 发布官方发布者v0.3.2更新于 Oct 28, 2026

Read-only public X (Twitter) data: profiles, tweets, threads, followers, search. Pay per result.

已验证Streamable HTTP可网页运行网页搜索与抓取数据与分析

概览

AI 生成的概览

托管式 MCP 服务器,提供只读的 X(Twitter)公开数据:用户资料、推文、话题串、关注关系与搜索,按返回结果以预付额度计费。

可以做什么
  • 按用户名查询单个用户资料,或一次查询最多 100 个用户
  • 读取用户的最新推文、粉丝、关注列表与粉丝数字 ID
  • 按 ID 获取单条或批量推文,以及话题串、回复、引用推文和转发者
  • 使用 x.com 运算符执行 X 高级搜索
  • 查询该密钥剩余额度与速率限制
适用场景
当助手需要获取 X 上的最新公开数据时适用,例如调研账号、通过搜索跟踪某个话题、或拉取一段对话串,而无需自行搭建 X API 集成。它只读,适合分析与研究,不适合发帖或互动运营。
运行要求
远程 MCP 端点,使用 Streamable HTTP,无需本地运行时。首次使用时通过 OAuth 登录;不支持 OAuth 的客户端改用 x-api-key 请求头;仅支持 stdio 的客户端可用 mcp-remote 桥接。需要预付额度余额,因为每返回一条推文或一个资料都会扣费。
安装前请注意
每返回一条推文或一个资料都会消耗额度,大范围搜索或大批量粉丝分页可能很快用完余额,建议先查余额并限制结果数量。粉丝、关注、转发者以及 Top 搜索等接口可能因账号等级返回 403,此类请求免费。请求会发送给与 X Corp. 无关联的第三方服务;仅涉及公开数据,且没有写入接口。

安装

在 SourceWeft 中

  1. 打开 控制台中的 xdataapi: X (Twitter) data,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。

交给智能体安装

把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。

阅读 https://sourceweft.com/mcp/io.xdataapi%2Fxdataapi/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。

查看智能体所依据的安装指南

其他 MCP 客户端

把它添加到你客户端的 mcpServers 配置中。

{
  "mcpServers": {
    "xdataapi-x-twitter-data": {
      "type": "http",
      "url": "https://api.xdataapi.io/mcp"
    }
  }
}

README

xdataapi

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.

Not affiliated with X Corp. Public data only. No write endpoints.

MCP

Claude Code, as a plugin — the server plus a skill that teaches the search operators and the cost rules:

bash
claude plugin marketplace add xdataapi/xdataapiclaude plugin install xdataapi@xdataapi

Or the server on its own, in any MCP client:

bash
claude mcp add --transport http xdataapi https://api.xdataapi.io/mcp

The server signs you in with OAuth on first use. Clients without OAuth pass a key instead:

json
{  "mcpServers": {    "xdataapi": {      "url": "https://api.xdataapi.io/mcp",      "headers": { "x-api-key": "xd_live_..." }    }  }}

Stdio-only clients can bridge with mcp-remote:

json
{  "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.

REST

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

SDKs

TypeScript, npm install xdataapi:

ts
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:

python
from xdataapi import AuthenticatedClientfrom xdataapi.api.tweets import search_tweetsclient = 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.

Framework packages

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.

PackageInstallSource
LangChain and LangGraphpip install langchain-xdataapipackages/langchain
LlamaIndexpip install llama-index-tools-xdataapipackages/llama-index
n8ncommunity node n8n-nodes-xdataapipackages/n8n
Claude Codeclaude plugin install xdataapi@xdataapiplugins/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.

Pricing

Prepaid credit packs from $10. Credits never expire. No per-call minimum. Rate limit rises with lifetime spend. Details: https://xdataapi.io/#pricing

Support

[email protected]. Security reports: https://xdataapi.io/.well-known/security.txt

来源:README.md,提交 31f4716

工具

14

get_user

Profile

Profile of one X user by handle. 1 credit.

输入参数freshhandle必填

get_users

Profiles, batch

Profiles of up to 100 X users by handle in one call. 1 credit per profile found.

输入参数freshhandles必填

get_user_tweets

User tweets

Latest tweets of a user, newest first. 1 credit per tweet.

输入参数user必填countfreshcursor

get_followers

Followers

Followers of a user. 0.1 credit per profile. Not every account tier can read this; a 403 is free.

输入参数user必填countfreshcursor

get_follower_ids

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.

输入参数user必填countfreshcursor

get_following

Following

Accounts a user follows. 0.1 credit per profile. Not every account tier can read this; a 403 is free.

输入参数user必填countfreshcursor

search_tweets

Search

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

输入参数q必填countfreshcursorproduct

get_tweet

Tweet

One tweet by numeric id, with its author. 1 credit.

输入参数id必填fresh

get_tweets

Tweets, batch

Up to 100 tweets by numeric id in one call. 1 credit per tweet found.

输入参数ids必填fresh

get_thread

Thread

A tweet with its thread and replies; the focal tweet comes first. 1 credit per tweet returned.

输入参数id必填freshcursor

get_replies

Replies

Direct replies to a tweet, one page. 1 credit per reply.

输入参数id必填freshcursor

get_quotes

Quotes

Tweets that quote a tweet, newest first. 1 credit per tweet.

输入参数id必填countfreshcursor

get_retweeters

Retweeters

Accounts that retweeted a tweet. 0.5 credit per profile. Not every account tier can read this; a 403 is free.

输入参数id必填countfreshcursor

get_balance

Balance

Credits left on this key and its rate limit. Free.

无需输入参数。

版本历史

2
  1. v0.3.2最新Sep 21, 2026
  2. v0.3.1Sep 20, 2026

评分

已满足适用检查项的 100%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通必需25 分
  • 已声明认证方式必需10 分
  • 已列出工具必需15 分
  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分