X / Twitter API

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.

POST/v1/run/twitter.user_posts
Uptime
98.50%
30d · 3,721 calls
Requests
3,722
30d · weekly, last 12 wks
Response
2.3s
median · 30d

Try it

Make your first request

requireFieldsarray
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.
Open in
Get a free key
Sample response
Free runs return only the first 3 results. Fund a key to get the full response.
{
  "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
}
Response interface
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 30d
POST /v1/run/twitter.user_posts
curl -X POST https://api.getanyapi.com/v1/run/twitter.user_posts \
  -H "Authorization: Bearer $ANYAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{"handle":"levelsio"}'
FieldTypeExample value
Request body
handlestring"levelsio"Twitter/X handle without the leading @.
cursorstringOpaque pagination cursor from a previous response's nextCursor. Omit for the first page.
requireFieldsarrayOptional; 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
dataobjectThe Posts-tab timeline page, or null when the account was not found.
data.nextCursorcan requirestringOpaque cursor for the next native Posts-tab page, or null when no more pages are available.
data.tweetsobject[]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 requireintegerNumber of bookmarks.
data.tweets[].createdUtcnumberUTC 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[].idstringThe post's numeric tweet ID, represented as a string. Populated whenever the provider has data for the entity.
data.tweets[].isPinnedcan requirebooleanWhether X marks the post as pinned on the profile, or null when the serving source does not publish it.
data.tweets[].isReplycan requirebooleanWhether X marks the record as a reply. Certified Posts-tab captures use this for self-thread continuations.
data.tweets[].langcan requirestringLanguage code reported for the post, when available.
data.tweets[].likescan requireintegerNumber of likes.
data.tweets[].mediacan requireobject[]Photo, video, and GIF attachments on the post. Empty when the post has none.
data.tweets[].media[].heightinteger
data.tweets[].media[].typestringOne of photo, video, or gif.
data.tweets[].media[].urlstringImage 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[].videoUrlstringPlayable video file URL. Present only for video and gif items.
data.tweets[].media[].widthinteger
data.tweets[].quotescan requireintegerNumber of quote posts.
data.tweets[].repliescan requireintegerNumber of replies.
data.tweets[].retweetscan requireintegerNumber of reposts or retweets.
data.tweets[].textstringThe post text. Empty for media-only posts. Populated whenever the provider has data for the entity.
data.tweets[].urlstringCanonical x.com URL of the post. Populated whenever the provider has data for the entity.
data.tweets[].viewscan requireintegerNumber of views.
foundbooleanWhether the account's Posts-tab timeline was returned.
Price
Price per requestUSD$0.0005
Price /1k reqUSD$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.

It costs from $0.50 per 1,000 requests, in US dollars with no subscription and no monthly minimum. You fund one USD wallet, each call draws it down, and a failed request costs $0.

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. The response is normalized JSON with the same envelope every AnyAPI endpoint returns, so parsing a second endpoint is a change of URL and nothing else.

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. These are AnyAPI's own measurements of traffic through the gateway, recomputed continuously, not a published service-level target.