增强 · 实时数据X (Twitter) Agent

X (Twitter) 数据 Skill

通过 UnifAPI MCP 读取公开 X(推特)数据:X 研究所需的 x/... 操作、响应结构与注意事项。绝不发帖。

Agent 原生

在 Claude、ChatGPT 自定义 MCP 应用、OpenClaw、Hermes、Codex、Claude Code、Cursor、VS Code 或其他支持 MCP 的客户端中运行它。无需专门的 GUI 流程,也无需单独的 LLM API 密钥。

由实时公开数据支撑

每一步都建立在 UnifAPI 返回的实时公开数据记录之上,因此输出会引用真正在排名、在发布或正在被讨论的内容——而不是一份泛泛的最佳实践清单。

可组合且开源

Skills 相互交叉引用,并存放在一个公开的、MIT 风格的仓库中。在 GitHub 上阅读完整的 SKILL.md、fork 它,或原样在你的 Agent 中运行它。

运行提示词

把它粘贴进 Codex 或 Claude Code

这段提示词有意可自由编辑。替换其中的用户名、市场、预算与活动目标,然后让 Agent 在需要实时公开数据时调用 UnifAPI MCP。

Using the X (Twitter) Data Skill, pull the public profile and recent engagement for @vercel and @shadcn: resolve each handle, read follower count and recent-tweet public_metrics, and return a cited summary. Read-only.
这个 skill 如何运作

由 SKILL.md 渲染出的完整 skill

通过 UnifAPI 读取公开 X (Twitter) 数据的确定性读取路径。这是一个 Data Skill:它本身不运行某个营销任务——它点明具体的 x/... 操作、响应形态和坑,让任何以 X 为先的工作流(KOL 定价、创作者核查、购买信号、竞品和聆听工作)从一份已知配方读取,而非每次重新发现这个面。

只读——眼睛,而非双手。它研究公开的 X 数据并返回带引证的记录;它绝不发帖、回复、关注或发 DM,UnifAPI 也绝不持有 X 凭证。

用 unifapi skill 获取实时证据

通过共享的 unifapi skill 连接一次(OAuth MCP),然后调用下面的操作。X 集成由 RapidAPI SocialLab 支撑,但公开契约使用 X 风格的 /x/... 路径——不要使用旧版 /twitter/... 路径。保留任何 billing 元数据,以便输出能陈述记录成本。

响应契约

单实体端点在 data 中返回对象:

{
  "request_id": "unif_...",
  "data": {},
  "billing": { "records_charged": 1, "balance_remaining": 99 }
}

列表端点在 data 中返回数组,外加 pagination:

{
  "request_id": "unif_...",
  "data": [],
  "pagination": { "has_more": false, "next_cursor": null },
  "billing": { "records_charged": 1 }
}

当 pagination.has_more 为 true 时,把 pagination.next_cursor 作为下一个请求的 pagination_token(next_token 也被接受)。报告成本时始终保留 billing。

核心操作

需求操作
按 handle 取画像x/users/by/username/{username}
按多个 handle 取画像x/users/by(?usernames=a,b)
按 id 取画像x/users/{id}
按多个 id 取画像x/users(?ids=123,456)
近期原创帖子x/users/{id}/tweets(?max_results=10&exclude=replies)
搜索近期帖子x/tweets/search/recent(?query=...&max_results=10)
自动补全用户/话题x/autocomplete(?query=...)
按 id 取帖子 / 按多个 id 取帖子x/tweets/{id} · x/tweets(?ids=123,456)
谁放大了一条帖子x/tweets/{id}/retweeted_by · x/tweets/{id}/quote_tweets
谁点赞了一条帖子x/tweets/{id}/liking_users
某用户点赞了什么x/users/{id}/liked_tweets
粉丝 / 关注x/users/{id}/followers · x/users/{id}/following
已验证粉丝x/users/{id}/verified_followers
地区趋势x/trends/by/woeid/{woeid}

需要这里未列出的字段?调用前用 unifapi skill 的 get_operation 读取确切的 schema——但从这张表里挑操作,不要盲目发现。

工作流

确定性配方。挑选与任务匹配的那个;每个都精确点明要调用什么。

  1. 把 handle 解析为画像。 去掉前导的 @,然后调用 x/users/by/username/{username}。读取 data.id(下面每个按用户的调用都需要它)和 data.public_metrics.followers_count。
  2. 读取近期互动。 用第 1 步的 id,调用 x/users/{id}/tweets?max_results=10&exclude=replies。从每条推文的 public_metrics(like_count、retweet_count、reply_count、quote_count、impression_count)计算互动。当 has_more 时用 x/users/{id}/tweets?pagination_token={next_cursor} 翻页。
  3. 追踪谁放大了一条帖子。 用第 2 步的一个推文 id,调用 x/tweets/{id}/retweeted_by、x/tweets/{id}/quote_tweets 或 x/tweets/{id}/liking_users,看谁转发、引用或点赞了它——这是购买信号、聆听和竞品工作背后的放大与意向信号。用 x/users/{id}/liked_tweets 查看某用户参与互动的内容。经由 next_cursor 翻页。
  4. 衡量受众质量。 调用 x/users/{id}/verified_followers;它把已验证粉丝作为一个分页列表返回,而不是一个现成的数字。把它的大小对照第 1 步的 data.public_metrics.followers_count 来衡量——那个已验证占比是真实 vs 注水的信号,会喂给下游定价/核查 skill 中的置信度和警告。经由 next_cursor 翻页以获得更完整的计数。
  5. 从一个话题发掘(尚无 handle)。 调用 x/tweets/search/recent?query=... 获取近期匹配的帖子,或调用 x/autocomplete?query=... 获取用户/话题建议,然后用第 1 步解析浮现的 handle。
  6. 绘制一个网络。 调用 x/users/{id}/followers 或 x/users/{id}/following 做受众重叠或触达工作;经由 next_cursor 翻页。
  7. 读取地区趋势。 调用 x/trends/by/woeid/{woeid} 获取某地点(WOEID)正在流行的内容,例如用于聆听或内容排期。
  8. 引证一切。 每个数字都回溯到它来自的帖子或画像;报告 billing.records_charged(或在 billing 元数据缺失时估算)。

形态说明

  • XUser —— 指标嵌套在 public_metrics 之下:followers_count、following_count、tweet_count、listed_count。画像标志在顶层:protected、verified、verified_type。读 public_metrics,而非旧版扁平字段。
  • XTweet —— 指标嵌套在 public_metrics 之下:like_count、retweet_count、reply_count、quote_count、bookmark_count、impression_count。可用时可能包含 author 和 media。

坑

  • 使用 /x/... 路径,绝不用 /twitter/...(旧版)。旧的 /twitter/users/{screen_name} → x/users/by/username/{username};旧的 /twitter/search → x/tweets/search/recent(用户/话题发掘用 x/autocomplete)。
  • 受保护、太旧或太单薄的时间线会降低置信度——把它浮现出来,不要掩盖。
  • 在任何 x/users/{id}/... 调用之前把 handle 解析为 data.id。
  • 余额低会悄悄截断列表页:检查 billing.truncated_due_to_balance——当为 true 时该页是部分的,所以在信任任何由它计算出的计数或占比之前先充值。

输出

返回调用方工作流所需的记录,每个都引证到它的帖子/画像,外加一行成本说明(records_charged)。当这个 skill 被直接使用时,默认是每个 handle 一份紧凑的画像 + 互动摘要:

**@handle** — followers {N}, verified {yes/no}. Recent 10 posts: avg engagement {x}% ({likes}/{reposts}/{replies}). Evidence: {post URLs}. Records: ~{N}.

相关 skills

  • kol-pricing、creator-shortlist、audience-fit-check(Influencer Marketing)—— 在这条读取路径之上为 X 创作者定价并核查。
  • buying-signal-monitor(Social Selling)、competitor-profiling(Competitive Intelligence)、social-listening-brief(Social Listening)—— 以 X 为先的意向、竞品和聆听工作。
  • unifapi —— 共享的数据 skill:连接 MCP 并用 get_operation 查找确切的 schema。

源码:GitHub 上的 x-twitter/SKILL.md——可在那里提交 PR 来改进它。

公开数据工具

这个 skill 调用的实时 API

这个 skill 提到的每个操作都属于这些 UnifAPI 平台之一——它们对于产品代码、调试与自定义 Agent 流程仍然可见、可调用。

  • 针对每个常见 X 读取任务的具体 `x/...` 操作
  • 面向用户与推文的响应契约与 `public_metrics` 结构说明
  • 确定性配方:主页、互动、发现、粉丝、趋势
  • 平台注意事项(由 RapidAPI 支撑的 `/x/...` 路径、分页、计费)