Social media5 min readBy Purrkey teamUpdated

How to collect an X account's tweets and replies

Request up to 100 tweets and replies from an X account with engagement, views, language, and cursor paging

On this page

You have 40 X handles to review before a partnership shortlist and need each account's recent tweets and replies, with engagement, views, language and reply mix, in one scoring sheet. The worksheet below is the deliverable: one row per post, with contract fields and a shortlist score you add. No run has been executed for this guide, so the table is a design, not a result

Example input and worksheet design

Example handle (replace with your own): pixelmaven. The first call uses limit 100 and no cursor. Values here are placeholders showing the shape

authorHandleidcreatedUtctextlikesretweetsrepliesviewsbookmarksisPinnedisReplylangurlshortlistScore
pixelmavenidcreatedUtctextlikesretweetsrepliesviewsbookmarksisPinnedisReplylangurlshortlistScore

The score column is yours, not a tool field. A simple design counts replies with isReply true, compares likes, retweets, replies and views across posts, and sorts by createdUtc to check posting cadence

Input fields for each handle

The catalog lists anyapi.twitter.user_tweets; agents call it through POST /v1/runs with toolId anyapi.twitter.user_tweets. It requires handle, the X handle without the @ prefix. The contract also lists limit, cursor, requireFields and requireSinglePage. limit accepts 1 to 100 and defaults to 20. cursor is an opaque value from a previous response's nextCursor; omit it for the first page. requireFields can name output fields such as isPinned, which can raise the price when the cheapest source cannot return a named field; a combination no single source returns together is refused as invalid input, with no charge. On a paginated walk, requireFields applies to the first page only. requireSinglePage asks for a lane that can return the requested limit in one response

Page with nextCursor when a source caps the page

Some sources return their native page of about 20 authored tweets and replies even when limit is higher. A page is never trimmed after the call. When data.nextCursor is a string, pass it back as cursor to continue exactly where the response ended. When it is null, the selected lane has no next page. Keep the same handle for the walk

Read output fields for the shortlist decision

found tells you whether the source has a result. If found is false, reason is not_found when the source states the target does not exist or returned nothing for it. That is a successful call, not an error

Inside data.tweets, each row is a post. Use createdUtc for cadence: it is a UTC epoch timestamp in seconds, so multiply by 1000 for a JS Date in milliseconds. Use isReply to split original posts from replies. Use likes, retweets, replies, views and bookmarks to compare engagement. isPinned is true or false when the serving source publishes the flag and null when it does not, so null does not say the post is unpinned. lang supports a language filter, text gives the post body, url gives the post link, and id identifies the row. The contract marks id, url, text and createdUtc as populated whenever the provider has data for the entity. authorHandle groups rows by account

For a related workflow that starts from post URLs, see List community tweets by URL

The agent prompt

Use this prompt with your own handle list. It asks for the table and checks the tool before running

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to collect tweets and replies for 40 X handles. Check the current inputs and price of anyapi.twitter.user_tweets before running anything. Call the tool once per handle with limit 100. If data.nextCursor is a string, pass it back as cursor and continue the walk for that handle. Return a table with authorHandle, id, createdUtc, text, likes, retweets, replies, views, bookmarks, isPinned, isReply, lang, url and shortlistScore. Keep one row per post. Do not guess handles. Example handle: pixelmaven (replace with your list).

Estimated tool cost

Prices from the Purrkey catalog, read November 13, 2026. The unit is max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge. The totals below are ceilings. Model fees for the agent are not counted

StepFormulaUnit pricePlanned quantityTotal
One page per handlecalls x max price$0.0101 per call40$0.404
Three pages per handlecalls x max price$0.0101 per call120$1.212

The one-page plan covers 40 handles with one call each. The three-page plan covers 40 handles with three calls each, which matches a source that returns about 20 items per page. If a handle needs fewer pages, the call count and total drop

Next action

Open Twitter user tweets to run one handle first, then repeat across your 40-handle list

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 collect an X account's tweets and replies?

Call anyapi.twitter.user_tweets once with the account handle, then pass data.nextCursor back as cursor for later pages. The output puts posts in data.tweets and sets found to false with reason not_found when the source returns nothing for the handle.

What inputs does anyapi.twitter.user_tweets take?

It requires handle without the @ prefix. The catalog documents limit from 1 to 100, cursor from a previous nextCursor, requireFields for output fields such as isPinned, and requireSinglePage; username is an alias for handle.

How many tweets can I request per call?

limit accepts 1 to 100 and defaults to 20. Some sources return their native page of about 20 authored tweets and replies even when limit is higher, so follow nextCursor to continue.

What do I do with nextCursor?

When data.nextCursor is a string, pass it back as cursor to continue exactly where the response ended. When it is null, the selected lane has no next page.

How much does it cost to collect tweets for 40 handles?

At up to $0.0101 per call, 40 calls cost at most $0.404 and 120 calls cost at most $1.212.

What does isPinned null mean?

isPinned is true or false when the serving source publishes the pinned flag. It is null when the source does not publish it, so null does not say the post is unpinned.

What happens if an X handle is not found?

The response sets found to false and gives reason as not_found when the source states the target does not exist or returns nothing for it. That is a successful call, not an error.

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