列表最新推文
获取Twitter公开列表频道最新推文的API
List最新推文
获取Twitter上公开List频道中的最新推文列表。
请求
URL: /api/twitter/list-latest-tweets
方法: GET 或 POST
请求参数:
| 参数名 | 类型 | 必需 | 描述 |
|---|---|---|---|
| listId | string | 是 | List频道的唯一ID |
响应
成功响应会返回List频道中的最新推文列表,包括推文内容、创建时间、作者信息等。
示例
请求示例
# GET 请求
curl --request GET \
--url 'https://www.aidir.fun/api/twitter/list-latest-tweets?listId=1234567890' \
--header 'X-API-Key: <api-key>'
# POST 请求
curl --request POST \
--url 'https://www.aidir.fun/api/twitter/list-latest-tweets' \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '{
"listId": "1234567890"
}'响应示例
{
"data": {
"list": {
"id": "1234567890",
"name": "Tech News",
"description": "Latest tech news and updates"
},
"tweets": {
"entries": [
{
"content": {
"tweet": {
"id": "1512345678901234567",
"text": "This is a tweet in the list",
"created_at": "2023-04-15T14:34:12.000Z",
"author": {
"id": "9876543210",
"name": "Tech Reporter",
"screen_name": "techreporter"
},
"favorite_count": 123,
"retweet_count": 45,
"reply_count": 6,
"quote_count": 2
}
}
}
]
}
}
}错误响应
| 状态码 | 描述 |
|---|---|
| 400 | 请求参数错误,例如缺少必需的 listId 参数 |
| 401 | 认证失败,API密钥无效或缺失 |
| 404 | List频道不存在或非公开 |
| 500 | 服务器内部错误 |
查找List ID
要使用此API,您需要知道List的ID。您可以通过以下方法获取:
- 在Twitter网页版上,List的URL通常包含其ID,如
https://twitter.com/i/lists/1234567890 - 使用Twitter开发者工具或第三方Twitter分析工具查找List ID
AIDIR文档