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)
- Price
- $0.005/resultプロバイダー原価
- Success rate
- 95.4%Last 30 days · 564 calls
- Latency p50
- 197 msp95 1.6 s
- Last verified
- 2026/07/28Verified working
GEThttps://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metricsPreviewTry online近日公開Provider docs ↗
- Uses platform quota
- Synchronous response
- Reads public data
パラメータ
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 をコンソールで作成したキーに置き換えてください。
Preview
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());このゲートウェイ API はプレビュー版です。URL や認証方式は変更される場合があります。 パラメータはサンプルデータです。 呼び出し料金は $0.005/result です。サービス料を含みます。