How to list an X account's Posts timeline by handle
Get an X account's Posts-tab timeline by handle with post text, media, engagement counts, pinned status, and cursor pagination
On this page
You have 40 competitor handles and need each account's Posts-tab timeline for a seven-day window, so you can compare posting cadence, log pinned announcements and benchmark engagement on launch posts. anyapi.twitter.user_posts returns that timeline one page at a time from a single handle
The deliverable is one table with a row per post, and that table feeds a competitive content calendar plus a likes, reposts, replies and views benchmark. No run has been executed for this guide. Values in the tables are placeholders showing the shape
The task and the table it produces
The contract gives 15 columns to carry per post: authorHandle, createdUtc, text, url, likes, retweets, replies, quotes, views, bookmarks, isPinned, isReply, media, lang and source. Together they answer three questions in one pass: when the account posted, what it posted and how the post performed
Example rows with invented handles, placeholders in each value cell:
| authorHandle | createdUtc | text | likes | retweets | replies | views | isPinned |
|---|---|---|---|---|---|---|---|
| acme-plumbing | (epoch) | (post text) | (count) | (count) | (count) | (count) | true |
| acme-plumbing | (epoch) | (post text) | (count) | (count) | (count) | (count) | false |
Sort by createdUtc rather than trusting row order. The contract says results follow profile order, with a pinned post possibly first and otherwise reverse-chronological posts, reposts, quotes and self-thread continuations after it
What you pass to the tool
handle is required and described as the Twitter/X handle without an @ at the start. cursor is optional, described as an opaque pagination cursor from a previous response's nextCursor, omitted for the first page. requireFields is an optional array whose only listed value is isPinned
requireFields has a price effect you should know before you set it. The contract says a named field is served only by a source that returns it, so when the cheapest source cannot return isPinned, a dearer source serves and you are quoted and charged its price. Naming a combination that no single source returns together is refused as invalid input, with no charge
Those are the fields the contract documents. It does not state that the request accepts nothing else, so read the current input list before you fix a schema around them
Example input for a first page, with cursor and requireFields left out:
| Field | Value |
|---|---|
handle | sama |
Which output fields drive the decision
found tells you whether the timeline was returned. When it is false, reason carries not_found or suspended, and the contract calls that a successful call rather than an error, so do not retry it in a loop
Inside data.tweets, these fields do the work:
createdUtcis a UTC epoch timestamp in seconds. Multiply by 1000 for a JS Date in milliseconds, and use it to keep or cut a row from the seven-day windowisPinnedsays whether X marks the post as pinned, or null when the serving source does not publish it. A true row belongs in the announcements log, not the cadence countisReplysays whether X marks the record as a reply. Certified Posts-tab captures use it for self-thread continuations, so filter it if you are counting standalone poststextholds the post copy and is empty for media-only posts. Pair it withmedia, where photo, video and GIF items carrytype,urland, for video and GIF,videoUrl. URLs on pbs.twimg.com are publicly fetchable without authentication, and you can append ?name=orig for the full-resolution originallikes,retweets,replies,quotes,viewsandbookmarksare the counts for the benchmark.quotesandbookmarksappear in the response but are not in the 15-column table above, so add them if your calendar tracks them
data.nextCursor is the paging hand-off: an opaque cursor for the next native Posts-tab page, or null when no more pages are available
Paging past the first page
The pagination limit sits here. Each call takes one handle and returns one page, so a seven-day window for a prolific account usually needs more than one call. cursor is opaque: omit it for the first page, then pass the previous response's data.nextCursor on each later call, and stop when it comes back null
requireFields applies to the first page only. Later pages stay with the source that the first page chose, at the price it was quoted, which matters when you budget a walk across 40 handles
The agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to pull the Posts-tab
timeline for the handles below with anyapi.twitter.user_posts. Check the
current inputs and price of anyapi.twitter.user_posts before running
anything. For each handle, request the first page with no cursor, then
follow data.nextCursor while the oldest createdUtc on the page is inside
the last seven days, and stop when nextCursor is null. Do not retry a
handle that comes back found: false; report it with its reason instead.
Return one table with authorHandle, createdUtc, text, url, likes, retweets,
replies, quotes, views, bookmarks, isPinned, isReply, media, lang and
source, and give createdUtc as an ISO 8601 timestamp.
Example handles, replace with your own list:
sama
acme-plumbing
northwind-supplyEstimated tool cost
Prices from the Purrkey catalog, read November 13, 2026, price revision anyapi-catalog-2026-11-05. The unit is max_call, which the catalog defines as "Maximum per call. Successful runs settle at the actual AnyAPI charge", so the totals below are ceilings, not settled charges
| Step | Formula | Unit price | Planned quantity | Total |
|---|---|---|---|---|
| One handle, first page | calls x max price | $0.0021 per call | 1 | $0.0021 |
| 40 handles, first page each | calls x max price | $0.0021 per call | 40 | $0.084 |
| 40 handles, three pages each | calls x max price | $0.0021 per call | 120 | $0.252 |
The three-page row is a design assumption about a seven-day window, not a measured page count. Model fees for the agent are not counted
Pull the first page for one handle
Run a single handle first and read the page before you commit to the 40-handle walk. The tool sits at user_posts in the Purrkey catalog, where the Agents call it through POST /v1/runs with toolId anyapi.twitter.user_posts
Get started by giving this to your agent
- Claude Code
- Codex
- Gemini CLI
- Cursor
- GitHub Copilot
Set up https://purrkey.app/SKILL.md, then use Purrkey to show me what I can do with X (Twitter).FAQ
How do I get an X account's Posts timeline by handle?
Call anyapi.twitter.user_posts with handle set to the account name without the leading @. The response returns found and a data object holding tweets in profile order plus a nextCursor.
What does the handle input accept?
handle is the Twitter/X handle without the leading @, with a minimum length of one character. The contract also maps username as an alias for handle.
How do I get more than the first page of posts?
Pass the previous response's data.nextCursor as cursor on the next call. Omit cursor for the first page, and stop when nextCursor is null.
What does requireFields do and does it change the price?
Naming isPinned in requireFields restricts the request to a source that returns that field, and can raise the quoted price because a dearer source may serve. Omit it and the cheapest source serves.
What happens when the account is not found or suspended?
found comes back false and reason says not_found or suspended. The contract treats that as a successful call, not an error, and costUsd is what it actually cost.
How much does it cost to pull the first page for 40 handles?
40 calls at up to $0.0021 per call comes to $0.084. A three-page walk for each of the 40 handles is 120 calls, at most $0.252.
Does the Posts tab include replies and reposts?
Results follow profile order: a pinned post may appear first, then otherwise reverse-chronological authored posts, reposts, quotes and self-thread continuations. isReply marks the records that certified Posts-tab captures use for self-thread continuations.
Next step
Try this with X (Twitter)
The tool directory lists every endpoint with its current price. Inspect the inputs there, then let your agent run a small batch before scaling up.