轻量级个人使用的Twitter API代理服务
GET /api/tweet?id=推文ID
示例: /api/tweet?id=1234567890
POST /api/tweets
Body: {"ids": ["1234567890", "0987654321"]}
GET /api/search?q=搜索词&count=数量
示例: /api/search?q="CleanShot X"&count=20 count 会被限制在 1...20;支持精确短语和 @mention。
GET /api/user/timeline?username=用户名&count=数量&type=类型&exclude_retweets=true&exclude_replies=true
示例: /api/user/timeline?username=elonmusk&count=20&type=tweets&exclude_retweets=true&exclude_replies=true 参数说明: - username: X 用户名(支持带或不带 @);也可改用 user_id=数字ID - count: 推文数量(1...20,默认20) - type: tweets(默认), media, replies - exclude_retweets: 排除转推 (true/false) - exclude_replies: 排除回复 (true/false) ✨ 新功能: 自动标记置顶推文 每条推文包含 isPinned 字段标识是否为置顶
GET /api/user/info?username=用户ID或用户名
示例: /api/user/info?username=44196397 或: /api/user/info?username=elonmusk
GET /api/user/id?username=用户名
示例: /api/user/id?username=elonmusk 返回用户ID,可用于timeline接口
GET /api/user/pinned?username=用户名&count=数量
示例: /api/user/pinned?username=elonmusk&count=5 专门获取用户的置顶推文
GET /api/status
GET /api/status/live
/api/status 检查配置;/api/status/live 真实验证 X 链路。
需要设置以下环境变量:
wrangler secret put API_KEY
{
"success": true,
"data": { ... }
}
简单轻量 | 方便扩展 | 个人使用