Felo APIs
X Search API
搜索 X 用户、tweets、时间线和回复,并返回分页元数据。
/v2/x/tweet/search认证
Bearer API key
Content type
application/json
限流说明
1 request per 10 seconds, 3 per minute, 10 per 10 minutes.
本页介绍原 /v2 Felo APIs,沿用 Felo 账户权益与 Pro 积分规则。具体是否扣费见各能力的积分规则。需要使用平台余额时,请选择 Felo(Data API)中对应的接口;两套接口的参数和返回结构可能不同。
X Search API 可访问 X/Twitter 数据,包括用户资料、用户搜索、用户 tweets、tweet 搜索和回复。适合 Agent 研究、舆情监听、账号分析和内容洞察。
普通 JSON 成功响应的外层包含数字 status: 200、code: "OK" 和 request_id;下文列出的业务字段位于 data 中。无数据时 data 会省略。
认证
Authorization: Bearer YOUR_API_KEY1. 获取用户信息
按用户名批量获取 X 用户资料。
POST https://openapi.felo.ai/v2/x/user/info| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
usernames | array of strings | 是 | 要查询的 X 用户名列表 |
curl -X POST 'https://openapi.felo.ai/v2/x/user/info' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"usernames":["elonmusk","OpenAI"]}'2. 搜索用户
按关键词搜索 X 用户。
POST https://openapi.felo.ai/v2/x/user/search| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
query | string | 是 | 搜索关键词 |
cursor | string | 否 | 上一页响应返回的分页 cursor |
3. 获取用户 Tweets
获取指定 X 用户发布的 tweets。
POST https://openapi.felo.ai/v2/x/user/tweets| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
x_user_id | string | 否 | X 用户 ID;x_user_id 和 username 二选一 |
username | string | 否 | X 用户名;x_user_id 和 username 二选一 |
limit | integer | 否 | 返回结果数量 |
cursor | string | 否 | 上一页响应返回的分页 cursor |
include_replies | boolean | 否 | 是否包含回复 |
curl -X POST 'https://openapi.felo.ai/v2/x/user/tweets' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"username":"elonmusk","limit":20}'4. 搜索 Tweets
按关键词搜索 X tweets,并支持高级查询语法。
POST https://openapi.felo.ai/v2/x/tweet/search| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
query | string | 是 | 搜索查询,支持高级搜索语法 |
query_type | string | 否 | 查询类型筛选 |
since_time | integer | 否 | 开始时间筛选,Unix 秒级时间戳 |
until_time | integer | 否 | 结束时间筛选,Unix 秒级时间戳 |
limit | integer | 否 | 返回结果数量 |
cursor | string | 否 | 上一页响应返回的分页 cursor |
5. 获取 Tweet 回复
获取指定 tweets 的回复。
POST https://openapi.felo.ai/v2/x/tweet/replies| 参数 | 类型 | 必填 | 说明 |
|---|---|---|---|
tweet_ids | array of strings | 是 | 要获取回复的 Tweet ID |
cursor | string | 否 | 上一页响应返回的分页 cursor |
since_time | integer | 否 | 开始时间筛选,Unix 秒级时间戳 |
until_time | integer | 否 | 结束时间筛选,Unix 秒级时间戳 |
通用响应字段
| 字段 | 类型 | 说明 |
|---|---|---|
total | integer | 返回或可用的结果数量 |
has_next | boolean | 是否还有更多结果 |
next_cursor | string | 下一页 cursor |
users | array | 用户 endpoint 返回的用户对象 |
tweets | array | tweet endpoint 返回的 tweet 对象 |
results | array | 回复 endpoint 返回的结果对象 |
用户对象可能包含 user_id、username、display_name、description、followers_count、following_count、tweet_count、verified、blue_verified、profile_image_url、created_at、location 和 url。
Tweet 对象可能包含 id、content、author、created_at、metrics、conversation_id、media_urls、hashtags、mentions、urls、url、lang、回复字段、quoted tweet 和 retweeted tweet。
错误码
| Code | HTTP Status | 说明 |
|---|---|---|
UNAUTHORIZED | 401 | API key 无效或已撤销 |
X_SEARCH_FAILED | 400/500 | X search 请求失败;请检查参数或下游错误 |
RATE_LIMIT_EXCEEDED | 429 | 请求过多;请稍后重试 |