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/resultAt provider cost
- Success rate
- 95.4%Last 30 days · 564 calls
- Latency p50
- 197 msp95 1.6 s
- Last verified
- Jul 28, 2026Verified working
GEThttps://toolswitch.dev/v1/tools/x.x.user.posts?max_results=5&tweet.fields=id%2Ctext%2Ccreated_at%2Cpublic_metricsPreview- Uses platform quota
- Synchronous response
- Reads public data
Parameters
each post returned is billed to the app owner at $0.005 — size max_results to what you actually need
| Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| Path parameters | ||||
id | string | Required | numeric user id — from x.user.profile (data.id), NOT the @handle | 44196397 |
| Query parameters | ||||
exclude | string | Optional | comma-separated: retweets, replies | retweets,replies |
start_time | string | Optional | RFC 3339; the timeline reaches back at most 3,200 posts regardless | 2026-07-01T00:00:00Z |
max_results | integer | Optional | 5–100, default 10 | 10 |
tweet.fields | string | Optional | public_metrics carries likes/reposts/replies/impressions | id,text,created_at,public_metrics,referenced_tweets |
pagination_token | string | Optional | meta.next_token from the previous response | |
- Path parameters
idstringRequirednumeric user id — from x.user.profile (data.id), NOT the @handle
Example:
44196397- Query parameters
excludestringOptionalcomma-separated: retweets, replies
Example:
retweets,repliesstart_timestringOptionalRFC 3339; the timeline reaches back at most 3,200 posts regardless
Example:
2026-07-01T00:00:00Zmax_resultsintegerOptional5–100, default 10
Example:
10tweet.fieldsstringOptionalpublic_metrics carries likes/reposts/replies/impressions
Example:
id,text,created_at,public_metrics,referenced_tweetspagination_tokenstringOptionalmeta.next_token from the previous response
Code samples
Replace $TOOLSWITCH_KEY with the key you created in the console.
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());This gateway API is in preview; its URL and authentication may change. The example parameters are sample data. Calls are billed at $0.005/result, including the service fee.