详细分析 ▾
运行时依赖
版本
opentwitter 初始发布:通过 6551 API 获取 Twitter/X 数据 - 通过 6551 API 查询 Twitter/X 用户资料、推文、搜索、关注者事件、已删推文及 KOL 粉丝。 - 需通过环境变量 `TWITTER_TOKEN` 提供 Bearer 令牌。 - 支持用户详情、ID 查用户、用户推文(含过滤)、推文搜索(含高级过滤)、关注/取关事件、已删推文及 KOL 粉丝查询端点。 - 提供所有端点的示例 cURL 用法与参数说明。 - 包含用户与推文的示例数据结构。
安装命令
点击复制技能文档
获取 token:https://6551.io/mcp
基础 URL:https://ai.6551.io
认证
所有请求都必须携带以下 header: `` Authorization: Bearer $TWITTER_TOKEN ` ---
Twitter 操作
1. 获取 Twitter 用户信息
通过用户名获取用户资料。
`bash curl -s -X POST "https://ai.6551.io/open/twitter_user_info" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"username": "elonmusk"}' ` 2. 通过 ID 获取 Twitter 用户
通过数字 ID 获取用户资料。
`bash curl -s -X POST "https://ai.6551.io/open/twitter_user_by_id" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"userId": "44196397"}' ` 3. 获取用户推文
获取某用户最近的推文。
`bash curl -s -X POST "https://ai.6551.io/open/twitter_user_tweets" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"username": "elonmusk", "maxResults": 20, "product": "Latest"}' ` | 参数 | 类型 | 默认值 | 说明 |
|------------------|---------|----------|--------------------------------|
| username | string | 必填 | Twitter 用户名(不含 @) |
| maxResults | integer | 20 | 最大推文数(1-100) |
| product | string | "Latest" | "Latest" 或 "Top" |
| includeReplies | boolean | false | 是否包含回复 |
| includeRetweets| boolean | false | 是否包含转推 |
4. 搜索 Twitter
使用多种过滤器搜索推文。
`bash curl -s -X POST "https://ai.6551.io/open/twitter_search" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"keywords": "bitcoin", "maxResults": 20, "product": "Top"}' ` 搜索指定用户推文:
`bash curl -s -X POST "https://ai.6551.io/open/twitter_search" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"fromUser": "VitalikButerin", "maxResults": 20}' `
按话题标签搜索:
`bash curl -s -X POST "https://ai.6551.io/open/twitter_search" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"hashtag": "crypto", "minLikes": 100, "maxResults": 20}' `
Twitter 搜索参数
| 参数 | 类型 | 默认值 | 说明 |
|------------------|---------|---------|-------------------------------------|
| keywords | string | - | 搜索关键词 |
| fromUser | string | - | 指定用户发的推文 |
| toUser | string | - | 发给指定用户的推文 |
| mentionUser | string | - | 提及指定用户的推文 |
| hashtag | string | - | 按话题标签过滤(不含 #) |
| excludeReplies | boolean | false | 排除回复 |
| excludeRetweets| boolean | false | 排除转推 |
| minLikes | integer | 0 | 最少点赞数 |
| minRetweets | integer | 0 | 最少转推数 |
| minReplies | integer | 0 | 最少回复数 |
| sinceDate | string | - | 起始日期(YYYY-MM-DD) |
| untilDate | string | - | 结束日期(YYYY-MM-DD) |
| lang | string | - | 语言代码(如 "en"、"zh") |
| product | string | "Top" | "Top" 或 "Latest" |
| maxResults | integer | 20 | 最大推文数(1-100) |
5. 获取关注/取关事件
获取某用户的新关注者或取关者。
`bash # 获取新关注者 curl -s -X POST "https://ai.6551.io/open/twitter_follower_events" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"username": "elonmusk", "isFollow": true, "maxResults": 20}' # 获取取关者 curl -s -X POST "https://ai.6551.io/open/twitter_follower_events" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"username": "elonmusk", "isFollow": false, "maxResults": 20}' ` | 参数 | 类型 | 默认值 | 说明 |
|-------------|---------|---------|------------------------------------------|
| username | string | 必填 | Twitter 用户名(不含 @) |
| isFollow | boolean | true | true=新关注,false=取关 |
| maxResults| integer | 20 | 最大事件数(1-100) |
6. 获取已删除推文
获取某用户已删除的推文。
`bash curl -s -X POST "https://ai.6551.io/open/twitter_deleted_tweets" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"username": "elonmusk", "maxResults": 20}' ` | 参数 | 类型 | 默认值 | 说明 |
|-------------|---------|---------|--------------------------------|
| username | string | 必填 | Twitter 用户名(不含 @) |
| maxResults| integer | 20 | 最大推文数(1-100) |
7. 获取 KOL 关注者
查看哪些 KOL(关键意见领袖)关注了某用户。
`bash curl -s -X POST "https://ai.6551.io/open/twitter_kol_followers" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"username": "elonmusk"}' ` | 参数 | 类型 | 默认值 | 说明 |
|------------|--------|---------|--------------------------------|
| username | string | 必填 | Twitter 用户名(不含 @) |
---
数据结构
Twitter 用户
`json { "userId": "44196397", "screenName": "elonmusk", "name": "Elon Musk", "description": "...", "followersCount": 170000000, "friendsCount": 500, "statusesCount": 30000, "verified": true } ` 推文
`json { "id": "1234567890", "text": "Tweet content...", "createdAt": "2024-02-20T12:00:00Z", "retweetCount": 1000, "favoriteCount": 5000, "replyCount": 200, "userScreenName": "elonmusk", "hashtags": ["crypto", "bitcoin"], "urls": [{"url": "https://..."}] } ` ---
常见工作流
加密 Twitter KOL 推文
`bash curl -s -X POST "https://ai.6551.io/open/twitter_user_tweets" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"username": "VitalikButerin", "maxResults": 10}' ` 热门加密推文
`bash curl -s -X POST "https://ai.6551.io/open/twitter_search" \ -H "Authorization: Bearer $TWITTER_TOKEN" \ -H "Content-Type: application/json" \ -d '{"keywords": "bitcoin", "minLikes": 1000, "product": "Top", "maxResults": 20}' `` 注意事项
- 在 https://6551.io/mcp 获取 API token
- 存在速率限制;每次请求最多 100 条结果
- Twitter 用户名请勿包含 @ 符号