Social media5 min readBy Purrkey teamUpdated

How to fetch X post replies with an AI agent

Fetch a public X post's replies as structured author, text, engagement and media records with cursor paging

On this page

You have one public X post URL and need to review its first 40 replies before deciding whether the thread needs moderation or a response. Call anyapi.twitter.replies with the post URL, read the reply records, and page with nextCursor only if the first page is not enough

The worksheet below is the deliverable: one row per reply, with identity, text, engagement, media and a moderation note you add. No run has been executed for this article, so each table value is a design placeholder, not a finding. If the job is to list community tweets by URL, the companion guide at https://purrkey.app/blog/list-community-tweets-by-url covers that separate task

Example input and the reply worksheet

Example post URL, invented for this guide and replaced by your own target:

https://x.com/acme_plumbing/status/20

The reply table has these columns. Values here are placeholders showing the shape

authorHandleauthorNametextcreatedUtclikeCountreplyCountrepostCountquoteCountviewCounturlmediamoderation note
acme_plumbingAcme PlumbingReply text placeholder173000000000000https://x.com/acme_plumbing/status/20[]review

The contract returns data.items as an array of reply records. Each record has authorHandle, authorName, text, createdUtc, likeCount, replyCount, repostCount, quoteCount, viewCount, url, media, id, and conversationId. Add the moderation note after reading those fields; the tool does not produce that note

What the tool takes

anyapi.twitter.replies requires url, the full X post URL. The pattern accepts x.com or twitter.com post URLs with a numeric status id, including photo and video URLs

Optional limit sets 1 to 40 results and defaults to 40. Optional cursor is an opaque pagination cursor from a previous response's nextCursor; omit it for the first page. Optional requireFields names output fields this request must be able to return, for example nextCursor; naming it can select a dearer source and raise your price. Naming a combination that no single source returns together is refused as invalid input, with no charge. The contract lists url, limit, cursor, and requireFields; check the current schema before running

Step 1: fetch the first page

Call the tool with url and limit: 40 for the first page. At this step, limit accepts 1 to 40 results per call, default 40. An empty items array is valid and does not assert whether the target post exists. If found is false, reason is not_found; the contract calls that a successful call, not an error

Read data.items for the reply records. Use authorHandle and authorName for identity, text for the reply body, and url to open the reply. text can be empty for media-only replies, and authorName can be empty when the upstream omits it. createdUtc is UTC epoch seconds; multiply by 1000 for a JS Date in milliseconds

Use likeCount, replyCount, repostCount, and quoteCount for engagement. viewCount is null when the source does not report it, as for posts older than X view counts. The media array has type and url; video and GIF items can include videoUrl, and width and height appear when the lane reports them. The id and conversationId fields help you group replies

Step 2: page with nextCursor

If data.nextCursor is a string, pass it back as cursor to fetch the next page. If it is null, the contract says there are no more pages

On a paginated walk, requireFields applies to the first page only; later pages stay with the source that page chose, at the price it was quoted. Naming nextCursor can raise the price because a dearer source may serve the first page

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to fetch replies to this public X post: https://x.com/acme_plumbing/status/20.
Check the current inputs and price of anyapi.twitter.replies before running anything. Call anyapi.twitter.replies with url set to the post URL and limit 40 for the first page. If data.nextCursor is present and you need more rows, call it again with cursor set to that value for one second page. Return a table with authorHandle, authorName, text, createdUtc, likeCount, replyCount, repostCount, quoteCount, viewCount, url, media, and moderation note. Leave fields empty when the response omits them. Do not invent reply rows.

Estimated tool cost

anyapi.twitter.replies is called through POST /v1/runs with toolId anyapi.twitter.replies at up to $0.0138 per call, read through the Purrkey catalog on November 13, 2026. The unit is max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge

The totals below are ceilings

StepFormulaUnit pricePlanned quantityTotal
First page at limit 401 call x max price$0.0138 per call1$0.0138
Second page with cursor1 call x max price$0.0138 per call1$0.0138
Two-page plan2$0.0276

One page at limit 40 is 1 call. Two pages with cursor are 2 calls. Agent model fees are not counted

Next action

Start with the first page at limit 40: https://purrkey.app/tools/twitter?q=replies

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).
Explore X (Twitter) tools and pricing

FAQ

How do I fetch replies to an X post by URL?

Call anyapi.twitter.replies with url set to the full X post URL and limit set from 1 to 40. Read data.items for reply records and data.nextCursor to page.

What inputs does anyapi.twitter.replies take?

The required input is url; optional inputs include limit, cursor, and requireFields. limit accepts 1 to 40 results per call and defaults to 40.

What do found, data.items, and reason mean?

found says whether the provider returned a reply result, data.items holds reply records, and reason appears only when found is false with not_found. An empty items array is valid and does not assert whether the target post exists.

What does requireFields do?

It names output fields the request must be able to return, such as nextCursor, and can make a dearer source serve the request. On a paginated walk it applies to the first page only.

How much does it cost to fetch one page or two pages?

At up to $0.0138 per call, one page at limit 40 is at most $0.0138. Two pages with a cursor are at most $0.0276.

What does a null viewCount mean?

viewCount is null when the source does not report it, as for posts older than X view counts. The other engagement fields are likeCount, replyCount, repostCount, and quoteCount.

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.

See X (Twitter) tools

Share this article