API para X / Twitter: Posts do usuário
Obtenha a linha do tempo da aba Posts do perfil de uma conta do X (Twitter) pelo nome de usuário. Os resultados seguem a ordem do perfil: um post fixado pode aparecer primeiro; depois vêm, em ordem cronológica inversa, os posts do autor, reposts, citações e continuações de threads do próprio autor.
Rede de provedores
Provedores ordenados por tráfego
com teto de US$ 0,0021 por requisição1 resultadoUS$ 0,000210 resultadosUS$ 0,001120 resultadosUS$ 0,0021 (teto)Você paga pelo que volta. Reduza o limite para pagar menos - e nenhuma requisição custa mais que o teto, não importa quanto volte.
Teste
Faça sua primeira requisição
{
"data": {
"nextCursor": "example",
"tweets": [
{
"authorHandle": "alex_rivera",
"authorId": "Alex Rivera",
"authorImage": "https://example.com/image.jpg",
"authorName": "Alex Rivera",
"bookmarks": 42,
"conversationId": "a1b2c3d4",
"createdUtc": 12.5,
"id": "a1b2c3d4",
"isPinned": true,
"isReply": true,
"lang": "en",
"likes": 12500,
"media": [
{
"height": 42,
"type": "general",
"url": "https://example.com/page",
"videoUrl": "https://example.com/page",
"width": 1024
}
],
"quotes": 42,
"replies": 42,
"retweets": 42,
"source": "https://example.com/page",
"text": "A short example description of this item.",
"url": "https://example.com/page",
"views": 12500
}
]
},
"found": true,
"reason": "not_found"
}interface TwitterUserPostsResponse {
data: {
nextCursor: string | null;
tweets: {
authorHandle?: string;
authorId?: string;
authorImage?: string;
authorName?: string;
bookmarks: number;
conversationId?: string;
createdUtc: number;
id: string;
isPinned: boolean | null;
isReply?: boolean;
lang?: string;
likes: number;
media?: {
height?: number;
type: string;
url: string;
videoUrl?: string;
width?: number;
}[];
quotes?: number;
replies: number;
retweets: number;
source?: string;
text: string;
url: string;
views: number;
}[];
} | null;
found: boolean;
reason?: "not_found" | "suspended";
}Referência completa de parâmetros e resposta - todos os campos, tipos e exemplos deste endpoint.
Referência
Requisição, resposta e preço
Última verificação em 2026-09-29 · disponibilidade e latência medidas em 30dcurl -X POST https://api.getanyapi.com/v1/run/twitter.user_posts \
-H "Authorization: Bearer $ANYAPI_KEY" \
-H "Content-Type: application/json" \
-d '{"handle":"levelsio"}'| Campo | Tipo | Valor de exemplo |
|---|---|---|
| Corpo da requisição | ||
| handle | string | "levelsio"Nome de usuário do Twitter/X sem o @ inicial. |
| cursor | string | Cursor de paginação opaco do nextCursor de uma resposta anterior. Omita na primeira página. |
| requireFields | array | Opcional; se omitido, o roteamento não muda e a fonte mais barata atende. Informe os campos de saída que esta requisição precisa poder retornar, por exemplo `isPinned` ou `isReply`, e ela só será atendida por uma fonte que retorne todos eles. Os campos que você não informar continuam sendo retornados sempre que a fonte que atende os tiver. Isso pode aumentar o seu preço: quando a fonte mais barata não consegue retornar um campo informado, uma fonte mais cara atende, e você recebe a cotação e é cobrado pelo preço dela. Um campo informado ainda pode vir ausente em um tweet que realmente não o tenha. Se você informar uma combinação de campos que nenhuma fonte retorna sozinha, a requisição é recusada como entrada inválida, sem cobrança. Ao paginar, vale só para a primeira página; as páginas seguintes continuam na fonte que a primeira página escolheu, pelo preço cotado. |
| Resposta | ||
| data | object | The Posts-tab timeline page, or null when the account was not found. |
| data.nextCursor | string | Opaque cursor for the next native Posts-tab page, or null when no more pages are available. |
| data.tweets | object[] | Posts in profile order. A pinned post may appear before otherwise reverse-chronological results. Populated whenever the provider has data for the entity. |
| data.tweets[].authorHandle | string | Handle of the account that posted. |
| data.tweets[].authorId | string | Numeric X user id of the account that posted, as a string. |
| data.tweets[].authorImage | string | Avatar image URL of the account that posted. |
| data.tweets[].authorName | string | Display name of the account that posted. |
| data.tweets[].bookmarks | integer | Number of bookmarks. |
| data.tweets[].conversationId | string | Id of the conversation the post belongs to, as a string. |
| data.tweets[].createdUtc | number | UTC epoch timestamp in seconds (Unix time). Multiply by 1000 for a JS Date in milliseconds. Populated whenever the provider has data for the entity. |
| data.tweets[].id | string | The post's numeric tweet ID, represented as a string. Populated whenever the provider has data for the entity. |
| data.tweets[].isPinnedpode ser exigido | boolean | Whether X marks the post as pinned on the profile, or null when the serving source does not publish it. |
| data.tweets[].isReplypode ser exigido | boolean | Whether X marks the record as a reply. Certified Posts-tab captures use this for self-thread continuations. |
| data.tweets[].lang | string | Language code reported for the post, when available. |
| data.tweets[].likes | integer | Number of likes. |
| data.tweets[].media | object[] | Photo, video, and GIF attachments on the post. Empty when the post has none. |
| data.tweets[].media[].height | integer | |
| data.tweets[].media[].type | string | One of photo, video, or gif. |
| data.tweets[].media[].url | string | Image URL. For a video or GIF this is the poster/thumbnail frame. X media URLs on pbs.twimg.com are publicly fetchable without authentication; append ?name=orig for the full-resolution original. |
| data.tweets[].media[].videoUrl | string | Playable video file URL. Present only for video and gif items. |
| data.tweets[].media[].width | integer | |
| data.tweets[].quotes | integer | Number of quote posts. |
| data.tweets[].replies | integer | Number of replies. |
| data.tweets[].retweets | integer | Number of reposts or retweets. |
| data.tweets[].source | string | Client the post was sent from, e.g. "Twitter Web App". |
| data.tweets[].text | string | The post text. Empty for media-only posts. Populated whenever the provider has data for the entity. |
| data.tweets[].url | string | Canonical x.com URL of the post. Populated whenever the provider has data for the entity. |
| data.tweets[].views | integer | Number of views. |
| found | boolean | Whether the account's Posts-tab timeline was returned. |
| reason | "not_found" | "suspended" | Present only when `found` is false, and says why there is no result. `not_found`: the source states the target does not exist, or returned nothing for it. `suspended`: the platform has suspended the account. A `found: false` answer is a successful call, not an error, and `costUsd` is what it actually cost. |
| Preço | ||
| Preço por requisição | USD | US$ 0,0005 |
| Preço /mil req. | USD | US$ 0,50 |
Dúvidas frequentes
Sobre o endpoint Posts do usuário da API para X / Twitter
O endpoint Posts do usuário da AnyAPI para X / Twitter retorna dados de X / Twitter em JSON normalizado com uma chamada POST para /v1/run/twitter.user_posts. Obtenha a linha do tempo da aba Posts do perfil de uma conta do X (Twitter) pelo nome de usuário. Os resultados seguem a ordem do perfil: um post fixado pode aparecer primeiro; depois vêm, em ordem cronológica inversa, os posts do autor, reposts, citações e continuações de threads do próprio autor. A AnyAPI distribui cada requisição entre 3 fontes, com failover automático quando uma falha. Custa a partir de US$ 0,50 por mil requisições, em dólares, sem assinatura e sem mínimo mensal. Nos últimos 30 dias, 99,9% das chamadas ao endpoint Posts do usuário da API para X / Twitter feitas pela AnyAPI tiveram sucesso, com tempo de resposta mediano de 2,2 segundos, em 21.075 chamadas medidas.