Twitter Research
Paid Twitter/X data API at https://twitter.x402.agentbox.fyi. Costs $0.003 USDC per call via x402 on Solana. Use the x402_payment tool for all requests.
Endpoints
Search Tweets
Find tweets matching a query with 50+ advanced operators.
CODEBLOCK0
Parameters:
| Param | Type | Default | Description |
|---|
| q | string | required | Search query with operators |
| type |
"Latest" or "Top" | Latest | Sort by recency or popularity |
| limit | 1-200 | 20 | Max tweets to return |
| cursor | string | - | Pagination cursor from previous response |
Search operators:
| Operator | Example | Description |
|---|
| from:user | INLINECODE2 | Tweets by user |
| to:user |
to:elonmusk | Replies to user |
| @user |
@solana | Mentioning user |
| min_faves:N |
min_faves:100 | Minimum likes |
| min_retweets:N |
min_retweets:50 | Minimum retweets |
| min_replies:N |
min_replies:10 | Minimum replies |
| filter:media |
filter:media | Has media |
| filter:images |
filter:images | Has images |
| filter:videos |
filter:videos | Has video |
| filter:links |
filter:links | Has links |
| filter:replies |
filter:replies | Only replies |
| -filter:replies |
-filter:replies | Exclude replies |
| since:date |
since:2025-01-01 | After date |
| until:date |
until:2025-12-31 | Before date |
| within_time:Nh |
within_time:24h | Last N hours |
| lang:code |
lang:en | Language filter |
| conversation_id:ID |
conversation_id:123 | In conversation |
| filter:self_threads |
from:user filter:self_threads | User's thread replies |
Combine operators: INLINECODE20
Response: INLINECODE21
The summary object includes: totalLikes, totalRetweets, totalReplies, avgLikes, maxLikes, topTweetId.
Fetch Tweets
Get tweet(s) by ID or URL with optional thread, replies, and quotes.
CODEBLOCK1
URL format: /tweet/{ref} where ref is:
- - Tweet ID: INLINECODE30
- Comma-separated IDs:
123,456,789 (batch fetch, no includes)
Parameters:
| Param | Type | Default | Description |
|---|
| include | string | - | Comma-separated: thread, replies, INLINECODE34 |
| limit |
1-200 | 50 | Max replies/quotes to return |
Include options (single tweet only):
- -
thread - author's self-reply chain in the conversation - INLINECODE36 - replies from other users
- INLINECODE37 - quote tweets of this tweet
Response: INLINECODE38
If the fetched tweet is a reply, parent is auto-included with the replied-to tweet.
Fetch Users
Get user profile(s) with optional tweets, followers, or following.
CODEBLOCK2
URL format: /user/{ref} where ref is:
- - Username:
elonmusk or INLINECODE42 - User ID: INLINECODE43
- Comma-separated IDs:
123,456 (batch fetch, no includes)
Parameters:
| Param | Type | Default | Description |
|---|
| include | string | - | Comma-separated: tweets, followers, INLINECODE47 |
| limit |
1-200 | 50 | Max tweets/followers/following to return |
| include_replies | boolean | false | Include replies in user's tweets |
Response (single): { user, tweets?, followers?, following? }
Response (batch): INLINECODE49
Usage Patterns
Monitor a topic
CODEBLOCK3
Get a tweet with full context
CODEBLOCK4
Research a user
CODEBLOCK5
Paginate results
Use nextCursor from a previous response:
CODEBLOCK6
Cost
Every call costs $0.003 USDC on Solana mainnet. Each paginated request is a separate call. Plan queries to minimize calls - use specific operators and reasonable limits.
Errors
| HTTP | Meaning |
|---|
| 400 | Invalid parameters (check query syntax) |
| 402 |
Payment required (handled automatically by x402_payment) |
| 404 | Tweet or user not found |
| 502 | Upstream API error |
Twitter研究
付费Twitter/X数据API,地址为https://twitter.x402.agentbox.fyi。每次调用通过Solana上的x402支付0.003 USDC。所有请求均使用x402_payment工具。
端点
搜索推文
使用50多个高级运算符查找匹配查询的推文。
x402_payment({
url: https://twitter.x402.agentbox.fyi/search,
method: GET,
params: {\q\: \from:elonmusk AI\, \type\: \Latest\, \limit\: 20}
})
参数:
| 参数 | 类型 | 默认值 | 描述 |
|---|
| q | 字符串 | 必填 | 带运算符的搜索查询 |
| type |
Latest或Top | Latest | 按时间或热度排序 |
| limit | 1-200 | 20 | 返回的最大推文数 |
| cursor | 字符串 | - | 来自前一次响应的分页游标 |
搜索运算符:
| 运算符 | 示例 | 描述 |
|---|
| from:user | from:elonmusk | 用户发布的推文 |
| to:user |
to:elonmusk | 回复用户的推文 |
| @user | @solana | 提及用户 |
| min
faves:N | minfaves:100 | 最低点赞数 |
| min
retweets:N | minretweets:50 | 最低转发数 |
| min
replies:N | minreplies: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 | withintime:24h | 最近N小时 |
| lang:code | lang:en | 语言过滤 |
| conversation
id:ID | conversationid:123 | 在对话中 |
| filter:self
threads | from:user filter:selfthreads | 用户的帖子回复链 |
组合运算符:from:elonmusk AI minfaves:100 -filter:replies withintime:7d
响应: { query, tweets[], count, hasMore, nextCursor, summary }
summary对象包含:totalLikes、totalRetweets、totalReplies、avgLikes、maxLikes、topTweetId。
获取推文
通过ID或URL获取推文,可选包含帖子链、回复和引用。
x402_payment({
url: https://twitter.x402.agentbox.fyi/tweet/1585841080431321088,
method: GET,
params: {\include\: \thread,replies\, \limit\: 50}
})
URL格式: /tweet/{ref},其中ref为:
- - 推文ID:1585841080431321088
- 逗号分隔的ID:123,456,789(批量获取,不包含其他内容)
参数:
| 参数 | 类型 | 默认值 | 描述 |
|---|
| include | 字符串 | - | 逗号分隔:thread、replies、quotes |
| limit |
1-200 | 50 | 返回的最大回复/引用数 |
包含选项(仅单条推文):
- - thread - 作者在对话中的自回复链
- replies - 其他用户的回复
- quotes - 引用该推文的推文
响应: { tweets[], count, parent?, thread?, replies?, quotes? }
如果获取的推文是回复,则自动包含parent,即被回复的推文。
获取用户
获取用户资料,可选包含推文、粉丝或关注。
x402_payment({
url: https://twitter.x402.agentbox.fyi/user/elonmusk,
method: GET,
params: {\include\: \tweets\, \limit\: 20}
})
URL格式: /user/{ref},其中ref为:
- - 用户名:elonmusk或@elonmusk
- 用户ID:44196397
- 逗号分隔的ID:123,456(批量获取,不包含其他内容)
参数:
| 参数 | 类型 | 默认值 | 描述 |
|---|
| include | 字符串 | - | 逗号分隔:tweets、followers、following |
| limit |
1-200 | 50 | 返回的最大推文/粉丝/关注数 |
| include_replies | 布尔值 | false | 在用户推文中包含回复 |
响应(单个): { user, tweets?, followers?, following? }
响应(批量): { users[], count, hasMore }
使用模式
监控话题
x402_payment({
url: https://twitter.x402.agentbox.fyi/search,
method: GET,
params: {\q\: \x402 OR \\\402 payment\\\ minfaves:5 withintime:24h\, \type\: \Latest\}
})
获取带完整上下文的推文
x402_payment({
url: https://twitter.x402.agentbox.fyi/tweet/1585841080431321088,
method: GET,
params: {\include\: \thread,replies,quotes\, \limit\: 20}
})
研究用户
x402_payment({
url: https://twitter.x402.agentbox.fyi/user/CoinbaseDev,
method: GET,
params: {\include\: \tweets\, \limit\: 50}
})
分页结果
使用前一次响应中的nextCursor:
x402_payment({
url: https://twitter.x402.agentbox.fyi/search,
method: GET,
params: {\q\: \from:elonmusk\, \cursor\: \DAABCgAB...\}
})
费用
每次调用在Solana主网上花费0.003 USDC。每个分页请求都是独立的调用。合理规划查询以最小化调用次数——使用具体的运算符和合理的限制。
错误
需要支付(由x402_payment自动处理) |
| 404 | 推文或用户未找到 |
| 502 | 上游API错误 |