mcpField
A
agentbox-twitter

agentbox-twitter

github.com/cascade-protocol生产力1341 次安装31 周前更新
代码仓库

关于 agentbox-twitter

通过付费数据 API 搜索 Twitter/X 内容并获取推文和用户信息的研究技能。支持高级搜索运算符、分页,以及检索对话上下文或相关用户数据。

主要功能

  1. 01使用高级运算符搜索推文
  2. 02按 ID 或 URL 获取推文
  3. 03获取用户资料及相关数据
  4. 04包含串文、回复和引用推文
  5. 05使用游标翻页获取结果

适用场景

  1. 01监测某个主题的近期帖子
  2. 02结合串文与回复查看推文上下文
  3. 03研究用户的帖子和资料

安装

复制下面的命令,在终端中运行。

$npx skills add https://github.com/cascade-protocol/agentbox --skill agentbox-twitter

安装后在 Claude Code 中输入/agentbox-twitter确认已加载。

详细介绍

Twitter 研究

付费 Twitter/X 数据 API,地址为 https://twitter.surf.cascade.fyi。通过 x402 在 Solana 或 Base 上支付,每次调用费用为 $0.003 USDC。所有请求均使用 x_payment 工具。

端点

搜索推文

使用 50 多种高级运算符查找符合查询条件的推文。

x_payment({
  "url": "https://twitter.surf.cascade.fyi/search",
  "method": "GET",
  "params": "{\"q\": \"from:elonmusk AI\", \"type\": \"Latest\", \"limit\": 20}"
})

参数:

参数类型默认值说明
qstring必填带运算符的搜索查询
type"Latest" or "Top"Latest按时间新近度或受欢迎程度排序
limit1-20020要返回的推文数量上限
cursorstring-上一条响应中的分页游标

搜索运算符:

运算符示例说明
from:userfrom:elonmusk用户发布的推文
to:userto:elonmusk回复给该用户的推文
@user@solana提及该用户
min_faves:Nmin_faves:100最低点赞数
min_retweets:Nmin_retweets:50最低转推数
min_replies:Nmin_replies:10最低回复数
filter:mediafilter:media含媒体
filter:imagesfilter:images含图片
filter:videosfilter:videos含视频
filter:linksfilter:links含链接
filter:repliesfilter:replies仅回复
-filter:replies-filter:replies排除回复
since:datesince:2025-01-01指定日期之后
until:dateuntil:2025-12-31指定日期之前
within_time:Nhwithin_time:24h最近 N 小时
lang:codelang:en语言筛选
conversation_id:IDconversation_id:123指定对话中的推文
filter:self_threadsfrom:user filter:self_threads用户在串文中的回复

组合运算符:from:elonmusk AI min_faves:100 -filter:replies within_time:7d

响应: { query, tweets[], count, hasMore, nextCursor, summary }

summary 对象包含:totalLikes、totalRetweets、totalReplies、avgLikes、maxLikes、topTweetId。

获取推文

按 ID 或 URL 获取推文(可选获取串文、回复和引用推文)。

x_payment({
  "url": "https://twitter.surf.cascade.fyi/tweet/1585841080431321088",
  "method": "GET",
  "params": "{\"include\": \"thread,replies\", \"limit\": 50}"
})

URL 格式: /tweet/{ref},其中 ref 可以是:

  • 推文 ID:1585841080431321088
  • 以逗号分隔的 ID:123,456,789(批量获取,不含附加内容)

参数:

参数类型默认值说明
includestring-以逗号分隔:thread、replies、quotes
limit1-20050要返回的回复/引用推文数量上限

附加内容选项(仅限单条推文):

  • thread - 对话中作者的自我回复链
  • replies - 其他用户的回复
  • quotes - 引用该推文的推文

响应: { tweets[], count, parent?, thread?, replies?, quotes? }

如果获取的推文是一条回复,则会自动包含被回复的推文 parent。

获取用户

获取用户资料(可选获取推文、关注者或正在关注的用户)。

x_payment({
  "url": "https://twitter.surf.cascade.fyi/user/elonmusk",
  "method": "GET",
  "params": "{\"include\": \"tweets\", \"limit\": 20}"
})

URL 格式: /user/{ref},其中 ref 可以是:

  • 用户名:elonmusk 或 @elonmusk
  • 用户 ID:44196397
  • 以逗号分隔的 ID:123,456(批量获取,不含附加内容)

参数:

参数类型默认值说明
includestring-以逗号分隔:tweets、followers、following
limit1-20050要返回的推文/关注者/正在关注的用户数量上限
include_repliesbooleanfalse在用户的推文中包含回复

响应(单个): { user, tweets?, followers?, following? } 响应(批量): { users[], count, hasMore }

使用模式

监控某个话题
x_payment({
  "url": "https://twitter.surf.cascade.fyi/search",
  "method": "GET",
  "params": "{\"q\": \"x402 OR \\\"402 payment\\\" min_faves:5 within_time:24h\", \"type\": \"Latest\"}"
})
获取带完整上下文的推文
x_payment({
  "url": "https://twitter.surf.cascade.fyi/tweet/1585841080431321088",
  "method": "GET",
  "params": "{\"include\": \"thread,replies,quotes\", \"limit\": 20}"
})
研究某位用户
x_payment({
  "url": "https://twitter.surf.cascade.fyi/user/CoinbaseDev",
  "method": "GET",
  "params": "{\"include\": \"tweets\", \"limit\": 50}"
})
对结果分页

使用上一条响应中的 nextCursor:

x_payment({
  "url": "https://twitter.surf.cascade.fyi/search",
  "method": "GET",
  "params": "{\"q\": \"from:elonmusk\", \"cursor\": \"DAABCgAB...\"}"
})

费用

在 Solana 主网或 Base 主网上,每次调用费用均为 $0.003 USDC。每个分页请求都单独计费。请规划查询以尽量减少调用次数——使用具体的运算符和合理的数量上限。

错误

HTTP含义
400参数无效(请检查查询语法)
402需要付费(由 x_payment 自动处理)
404未找到推文或用户
502上游 API 错误

评论

支持 Markdown