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/resultPelo preço do provedor
- Success rate
- 95,4%Last 30 days · 564 calls
- Latency p50
- 197 msp95 1.6 s
- Last verified
- 28 de jul. de 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
Parâmetros
each post returned is billed to the app owner at $0.005 — size max_results to what you actually need
| Parâmetro | Tipo | Obrigatório | Descrição | Exemplo |
|---|---|---|---|---|
| Parâmetros de caminho | ||||
id | string | Obrigatório | numeric user id — from x.user.profile (data.id), NOT the @handle | 44196397 |
| Parâmetros de consulta | ||||
exclude | string | Opcional | comma-separated: retweets, replies | retweets,replies |
start_time | string | Opcional | RFC 3339; the timeline reaches back at most 3,200 posts regardless | 2026-07-01T00:00:00Z |
max_results | inteiro | Opcional | 5–100, default 10 | 10 |
tweet.fields | string | Opcional | public_metrics carries likes/reposts/replies/impressions | id,text,created_at,public_metrics,referenced_tweets |
pagination_token | string | Opcional | meta.next_token from the previous response | |
- Parâmetros de caminho
idstringObrigatórionumeric user id — from x.user.profile (data.id), NOT the @handle
Exemplo:
44196397- Parâmetros de consulta
excludestringOpcionalcomma-separated: retweets, replies
Exemplo:
retweets,repliesstart_timestringOpcionalRFC 3339; the timeline reaches back at most 3,200 posts regardless
Exemplo:
2026-07-01T00:00:00Zmax_resultsinteiroOpcional5–100, default 10
Exemplo:
10tweet.fieldsstringOpcionalpublic_metrics carries likes/reposts/replies/impressions
Exemplo:
id,text,created_at,public_metrics,referenced_tweetspagination_tokenstringOpcionalmeta.next_token from the previous response
Exemplos de código
Substitua $TOOLSWITCH_KEY pela chave criada no 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());Esta API de gateway está em prévia; a URL e a autenticação podem mudar. Os parâmetros do exemplo são dados de amostra. As chamadas são cobradas a $0.005/result, incluindo a taxa de serviço.