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/resultAu prix du fournisseur
- Success rate
- 95,4 %Last 30 days · 564 calls
- Latency p50
- 197 msp95 1.6 s
- Last verified
- 28 juil. 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
Paramètres
each post returned is billed to the app owner at $0.005 — size max_results to what you actually need
| Paramètre | Type | Obligatoire | Description | Exemple |
|---|---|---|---|---|
| Paramètres de chemin | ||||
id | chaîne | Obligatoire | numeric user id — from x.user.profile (data.id), NOT the @handle | 44196397 |
| Paramètres de requête | ||||
exclude | chaîne | Facultatif | comma-separated: retweets, replies | retweets,replies |
start_time | chaîne | Facultatif | RFC 3339; the timeline reaches back at most 3,200 posts regardless | 2026-07-01T00:00:00Z |
max_results | entier | Facultatif | 5–100, default 10 | 10 |
tweet.fields | chaîne | Facultatif | public_metrics carries likes/reposts/replies/impressions | id,text,created_at,public_metrics,referenced_tweets |
pagination_token | chaîne | Facultatif | meta.next_token from the previous response | |
- Paramètres de chemin
idchaîneObligatoirenumeric user id — from x.user.profile (data.id), NOT the @handle
Exemple :
44196397- Paramètres de requête
excludechaîneFacultatifcomma-separated: retweets, replies
Exemple :
retweets,repliesstart_timechaîneFacultatifRFC 3339; the timeline reaches back at most 3,200 posts regardless
Exemple :
2026-07-01T00:00:00Zmax_resultsentierFacultatif5–100, default 10
Exemple :
10tweet.fieldschaîneFacultatifpublic_metrics carries likes/reposts/replies/impressions
Exemple :
id,text,created_at,public_metrics,referenced_tweetspagination_tokenchaîneFacultatifmeta.next_token from the previous response
Exemples de code
Remplacez $TOOLSWITCH_KEY par la clé créée dans la 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());Cette API de passerelle est en préversion ; son URL et son authentification peuvent changer. Les paramètres de l’exemple sont des données fictives. Les appels sont facturés à $0.005/result, frais de service inclus.