关于 agentbox-twitter
通过付费数据 API 搜索 Twitter/X 内容并获取推文和用户信息的研究技能。支持高级搜索运算符、分页,以及检索对话上下文或相关用户数据。
主要功能
- 01使用高级运算符搜索推文
- 02按 ID 或 URL 获取推文
- 03获取用户资料及相关数据
- 04包含串文、回复和引用推文
- 05使用游标翻页获取结果
适用场景
- 01监测某个主题的近期帖子
- 02结合串文与回复查看推文上下文
- 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}"
})
参数:
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| q | string | 必填 | 带运算符的搜索查询 |
| type | "Latest" or "Top" | Latest | 按时间新近度或受欢迎程度排序 |
| limit | 1-200 | 20 | 要返回的推文数量上限 |
| cursor | string | - | 上一条响应中的分页游标 |
搜索运算符:
| 运算符 | 示例 | 说明 |
|---|---|---|
| from:user | from:elonmusk | 用户发布的推文 |
| to:user | to:elonmusk | 回复给该用户的推文 |
| @user | @solana | 提及该用户 |
| min_faves:N | min_faves:100 | 最低点赞数 |
| min_retweets:N | min_retweets:50 | 最低转推数 |
| min_replies:N | min_replies:10 | 最低回复数 |
| filter:media | filter:media | 含媒体 |
| filter:images | filter:images | 含图片 |
| filter:videos | filter:videos | 含视频 |
| filter:links | filter:links | 含链接 |
| filter:replies | filter:replies | 仅回复 |
| -filter:replies | -filter:replies | 排除回复 |
| since:date | since:2025-01-01 | 指定日期之后 |
| until:date | until:2025-12-31 | 指定日期之前 |
| within_time:Nh | within_time:24h | 最近 N 小时 |
| lang:code | lang:en | 语言筛选 |
| conversation_id:ID | conversation_id:123 | 指定对话中的推文 |
| filter:self_threads | from: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(批量获取,不含附加内容)
参数:
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| include | string | - | 以逗号分隔:thread、replies、quotes |
| limit | 1-200 | 50 | 要返回的回复/引用推文数量上限 |
附加内容选项(仅限单条推文):
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(批量获取,不含附加内容)
参数:
| 参数 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| include | string | - | 以逗号分隔:tweets、followers、following |
| limit | 1-200 | 50 | 要返回的推文/关注者/正在关注的用户数量上限 |
| include_replies | boolean | false | 在用户的推文中包含回复 |
响应(单个): { 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 错误 |