Recent tweets of a user by user id — engagement metrics
x.x.user.postsList the recent posts of an X user (your own or any public account)
- 价格
- $0.005/result按供应商原价
- 成功率
- 95.4%近 30 天 · 564 次
- 延迟 p50
- 197 毫秒p95 1.6 秒
- 最后验证
- 2026年7月28日实测可用
GEThttps://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metrics预览在线试用即将上线供应商文档 ↗
- 可用平台额度调用
- 同步返回
- 读取公开数据
参数
each post returned is billed to the app owner at $0.005 — size max_results to what you actually need
| 参数 | 类型 | 必填 | 说明 | 示例 |
|---|---|---|---|---|
| 路径参数 | ||||
id | 字符串 | 必填 | numeric user id — from x.user.profile (data.id), NOT the @handle | 44196397 |
| 查询参数 | ||||
exclude | 字符串 | 可选 | comma-separated: retweets, replies | retweets,replies |
start_time | 字符串 | 可选 | RFC 3339; the timeline reaches back at most 3,200 posts regardless | 2026-07-01T00:00:00Z |
max_results | 整数 | 可选 | 5–100, default 10 | 10 |
tweet.fields | 字符串 | 可选 | public_metrics carries likes/reposts/replies/impressions | id,text,created_at,public_metrics,referenced_tweets |
pagination_token | 字符串 | 可选 | meta.next_token from the previous response | |
- 路径参数
id字符串必填numeric user id — from x.user.profile (data.id), NOT the @handle
示例:
44196397- 查询参数
exclude字符串可选comma-separated: retweets, replies
示例:
retweets,repliesstart_time字符串可选RFC 3339; the timeline reaches back at most 3,200 posts regardless
示例:
2026-07-01T00:00:00Zmax_results整数可选5–100, default 10
示例:
10tweet.fields字符串可选public_metrics carries likes/reposts/replies/impressions
示例:
id,text,created_at,public_metrics,referenced_tweetspagination_token字符串可选meta.next_token from the previous response
代码示例
将 $TOOLSWITCH_KEY 替换为你在控制台创建的密钥。
预览
curl -X GET 'https://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metrics' \
-H "X-Toolswitch-Key: $TOOLSWITCH_KEY"import os
import requests
response = requests.request(
"GET",
"https://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metrics",
headers={"X-Toolswitch-Key": os.environ["TOOLSWITCH_KEY"]},
)
response.raise_for_status()
print(response.text)const response = await fetch("https://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metrics", {
method: "GET",
headers: {
"X-Toolswitch-Key": process.env.TOOLSWITCH_KEY ?? "",
},
});
if (!response.ok) throw new Error(`Request failed: ${response.status}`);
console.log(await response.text());网关接口为预览版,地址与鉴权方式可能调整。 示例参数仅为样例数据。 调用按 $0.005/result 计费,已含服务费。