用户推文
拉取指定用户时间线。路径里的 user_id 必须是数字 ID(不要用 screen_name)。可先用 用户资料 拿到 id_str。
仅支持公开账号;protected: true 通常取不到。
仅原创推文
GET /twitter/user/{user_id}/tweets
推文 + 回复
GET /twitter/user/{user_id}/tweets-and-replies
此接口会包含用户自己的推文与回复,不支持额外过滤条件。若要更灵活筛选,改用 搜索 并设 query=from:USERNAME ...。
参数
| 位置 | 参数 | 必填 | 说明 |
|---|---|---|---|
| path | user_id | 是 | 数字用户 ID(字符串传递更安全) |
| query | cursor | 否 | 上一页的 next_cursor,需 URL 编码 |
请求示例
bash
curl "https://twidata.wvovw.com/twitter/user/44196397/tweets" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Accept: application/json"
# 翻页
curl "https://twidata.wvovw.com/twitter/user/44196397/tweets?cursor=URLENCODED_CURSOR" \
-H "Authorization: Bearer YOUR_API_KEY"成功响应(结构)
json
{
"next_cursor": "...",
"tweets": [
{
"tweet_created_at": "2023-12-13T05:39:09.000000Z",
"id_str": "1734810168053956719",
"full_text": "...",
"user": { "id_str": "44196397", "screen_name": "elonmusk" },
"retweet_count": 78,
"favorite_count": 977
}
]
}一页通常约 20 条。字段含义与 搜索推文 中的 tweet 对象一致。
计费
按本页 tweets.length 扣点(默认 1 条 = 1 点)。空结果不扣。
错误码
| HTTP | 含义 |
|---|---|
| 200 | 成功 |
| 401 / 402 | 鉴权 / 余额 |
| 404 | 用户不存在 |
| 422 | 参数错误(常见:用了用户名而不是数字 ID) |
| 500 | 上游失败 |