通用说明

服务地址:https://ai.yinghetwbot.com/v2

所有接口均需要 token 参数进行身份认证,每次调用消耗 1 次 API 额度。支持 GET 和 POST 两种请求方式。

认证方式

  • GET 请求:通过 URL query 参数传递 ?token=xxx
  • POST 请求:通过 query 参数或 form-data 传递

错误码说明

状态码说明
400参数缺失或请求失败
401token无效或用户不存在
403API调用次数已用完

接口列表

1. 获取单条推文详情

GETPOST/api/tweet/detail

参数名类型必填说明
tokenstring用户token
tweet_idstring推文ID

请求示例:

GET /api/tweet/detail?token=xxx&tweet_id=1895678901234567890

响应示例:

{ "success": true, "message": "获取成功", "tweet_id": "1895678901234567890", "data": { "legacy": { ... }, "core": { ... }, "views": { ... } } }

2. 批量获取推文详情

GETPOST/api/tweets/details

参数名类型必填说明
tokenstring用户token
tweet_idsstring推文ID列表,逗号分隔

请求示例:

GET /api/tweets/details?token=xxx&tweet_ids=123456,789012,345678

响应示例:

{ "success": true, "message": "获取成功", "count": 3, "data": [ ... ] }

3. 搜索推文

GETPOST/api/search/tweets

参数名类型必填默认值说明
tokenstring-用户token
wordsstring-搜索关键词
productstringTop搜索类型:Top(热门) / Latest(最新)
cursorstring翻页游标,从上一次响应中获取

请求示例:

GET /api/search/tweets?token=xxx&words=bitcoin&product=Latest
翻页用法:将响应中的 cursor 值作为下一次请求的 cursor 参数即可获取下一页。

4. 获取用户时间线

GETPOST/api/user/timeline

参数名类型必填默认值说明
tokenstring-用户token
user_idstring-Twitter用户ID (数字)
countint20获取数量

请求示例:

GET /api/user/timeline?token=xxx&user_id=44196397&count=10

5. 获取单个用户信息

GETPOST/api/user/info

参数名类型必填说明
tokenstring用户token
screen_namestringTwitter用户名(不含@)

请求示例:

GET /api/user/info?token=xxx&screen_name=elonmusk

6. 批量获取用户信息

GETPOST/api/users/info

user_idsscreen_names 二选一,优先使用 user_ids

参数名类型必填说明
tokenstring用户token
user_idsstring用户ID列表,逗号分隔
screen_namesstring用户名列表,逗号分隔

请求示例:

GET /api/users/info?token=xxx&user_ids=44196397,25073877
GET /api/users/info?token=xxx&screen_names=elonmusk,jack

7. 获取用户关注列表

GETPOST/api/user/following

user_idscreen_name 二选一,优先使用 user_id

参数名类型必填默认值说明
tokenstring-用户token
user_idstring-Twitter用户ID
screen_namestring-Twitter用户名
countint100获取数量,最大5000

请求示例:

GET /api/user/following?token=xxx&user_id=44196397&count=200

8. 获取用户粉丝列表

GETPOST/api/user/followers

user_idscreen_name 二选一,优先使用 user_id

参数名类型必填默认值说明
tokenstring-用户token
user_idstring-Twitter用户ID
screen_namestring-Twitter用户名
countint100获取数量,最大5000

请求示例:

GET /api/user/followers?token=xxx&screen_name=elonmusk&count=500

9. 获取KOL共同关注

GETPOST/api/user/kol-mutual-follows

参数名类型必填说明
tokenstring用户token
user_idstringTwitter用户ID

请求示例:

GET /api/user/kol-mutual-follows?token=xxx&user_id=44196397

接口速查表

接口路径必填参数说明
单条推文/api/tweet/detailtoken, tweet_id获取推文详情
批量推文/api/tweets/detailstoken, tweet_ids逗号分隔多个ID
搜索推文/api/search/tweetstoken, words支持翻页(cursor)
用户时间线/api/user/timelinetoken, user_id可指定count
单个用户/api/user/infotoken, screen_name按用户名查询
批量用户/api/users/infotoken, user_ids 或 screen_names逗号分隔
关注列表/api/user/followingtoken, user_id 或 screen_name最大5000
粉丝列表/api/user/followerstoken, user_id 或 screen_name最大5000
KOL共同关注/api/user/kol-mutual-followstoken, user_idKOL分析