X / Twitter User posts API
Get an X (Twitter) account's profile Posts-tab timeline by handle. Results follow profile order: a pinned post may appear first, followed by otherwise reverse-chronological authored posts, reposts, quotes, and self-thread continuations.
Provider network
Providers ranked by traffic
capped at $0.0021 per request1 result$0.000210 results$0.001120 results$0.0021 capYou are charged for what comes back. Lower the limit to pay less - and no single request can cost more than the cap, however much comes back.
Try it
Make your first request
{
"data": {
"nextCursor": "example",
"tweets": [
{
"bookmarks": 42,
"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,
"text": "A short example description of this item.",
"url": "https://example.com/page",
"views": 12500
}
]
},
"found": true
}interface TwitterUserPostsResponse {
data: {
nextCursor: string | null;
tweets: {
bookmarks: number;
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;
text: string;
url: string;
views: number;
}[];
} | null;
found: boolean;
}Full parameter and response reference - every field, type, and example for this endpoint.
Reference
Request, response, and price
Last verified 2026-09-16 · uptime and latency measured over 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"}'| Field | Type | Example value |
|---|---|---|
| Request body | ||
| handle | string | "levelsio"Twitter/X handle without the leading @. |
| cursor | string | Opaque pagination cursor from a previous response's nextCursor. Omit for the first page. |
| requireFields | array | Optional; omit it and routing is unchanged, with the cheapest source serving. Name the output fields this request must be able to return, for example `isPinned` or `isReply`, and it is served only by a source that returns every one of them. Fields you do not name are still returned whenever the serving source has them. This can raise your price: when the cheapest source cannot return a named field, a dearer source serves, and you are quoted and charged its price. A named field can still be absent on a tweet that genuinely lacks it. Naming a combination that no single source returns together is refused as invalid input, with no charge. On a paginated walk it applies to the first page only; later pages stay with the source that page chose, at the price it was quoted. |
| Response | ||
| data | object | The Posts-tab timeline page, or null when the account was not found. |
| data.nextCursorcan require | 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[].bookmarkscan require | integer | Number of bookmarks. |
| 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[].isPinnedcan require | boolean | Whether X marks the post as pinned on the profile, or null when the serving source does not publish it. |
| data.tweets[].isReplycan require | boolean | Whether X marks the record as a reply. Certified Posts-tab captures use this for self-thread continuations. |
| data.tweets[].langcan require | string | Language code reported for the post, when available. |
| data.tweets[].likescan require | integer | Number of likes. |
| data.tweets[].mediacan require | 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[].quotescan require | integer | Number of quote posts. |
| data.tweets[].repliescan require | integer | Number of replies. |
| data.tweets[].retweetscan require | integer | Number of reposts or retweets. |
| 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[].viewscan require | integer | Number of views. |
| found | boolean | Whether the account's Posts-tab timeline was returned. |
| Price | ||
| Price per request | USD | $0.0005 |
| Price /1k req | USD | $0.50 |
FAQ
About the X / Twitter User posts API
The AnyAPI X / Twitter User posts API returns X / Twitter user posts data as normalized JSON from one POST call to /v1/run/twitter.user_posts. Get an X (Twitter) account's profile Posts-tab timeline by handle. Results follow profile order: a pinned post may appear first, followed by otherwise reverse-chronological authored posts, reposts, quotes, and self-thread continuations. AnyAPI routes each request across 3 sources and falls back automatically when one fails. It costs from $0.50 per 1,000 requests, in US dollars with no subscription and no monthly minimum. Over the last 30 days, 98.5% of X / Twitter user posts calls through AnyAPI succeeded, with a median response time of 2.3 seconds across 3,721 measured calls.