Social media4 min readBy Purrkey teamUpdated

How to list trending Reddit posts with cursor paging

See currently trending Reddit posts across subreddits and page through the list with stable cursors for a quick scan

On this page

You have 25 currently trending Reddit posts to scan across subreddits and need a table an editor can use to choose follow-up review. Fetch the first page from anyapi.reddit.trending_posts, read the rows, and request another page only if the first page does not cover the editor's set. No call has been run for this article; the table below is a design, and values in it are placeholders showing the shape

Deliverable table for the 25-post scan

The deliverable is one row per post, with the fields the editor needs for a keep or monitor decision. This table design uses fields from the contract

idtitlesubredditauthorscorenumCommentscreatedUtcpermalinkurldecision

The decision column is the editor's label, such as monitor or skip. The row fields come from the response; the decision is written after the editor reviews score, numComments and createdUtc

Input fields and the first page

anyapi.reddit.trending_posts uses POST /v1/runs with toolId anyapi.reddit.trending_posts. The contract documents limit and after. No field is required. limit is an integer with minimum 1, maximum 100 and default 25. That range sits next to this step because it sets the page size: for the editor's 25-post scan, pass limit 25. after is a cursor string with minLength 1, taken from a previous response's data.nextCursor; omit it for the first page

Example input, labelled Example and to be replaced by the reader: {"limit":50}. For the 25-post scan, change 50 to 25

Reading the output fields

The response has found and data. When found is true, data.posts is the post array and data.nextCursor is the cursor or null. When found is false, reason is not_found, and that is a successful call, not an error. For the table, id is the post key; title, subreddit, author, score, numComments, createdUtc, permalink and url fill the row. score is net score (upvotes minus downvotes) at fetch time. numComments is total comments on the post. createdUtc is a UTC epoch timestamp in seconds. Use those fields to set the decision to monitor or skip, or a similar editor label

The domain field gives the linked domain, such as a self-post domain for a text post. The url field is the post's destination link; permalink is the canonical reddit.com thread path. The contract also defines isArchived, isLocked, nsfw, upvoteRatio, selftext and authorId. For isArchived and isLocked, an absent field means unknown rather than false. These can inform a review, but the table design above uses the row fields plus the decision. For comment review on rows you keep, the companion article at https://purrkey.app/blog/list-reddit-post-comments covers that follow-up

Paging with the cursor and the agent prompt

A first page is 1 call. Omit after for that call. To pull another page, copy a non-null data.nextCursor into after and call again. Stop when data.nextCursor is null. A three-page scan is 3 calls

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list currently trending Reddit posts for an editor's scan. Check the current inputs and price of anyapi.reddit.trending_posts before running. Call it with limit 25 and omit after for the first page. Return a table with id, title, subreddit, author, score, numComments, createdUtc, permalink, url and decision. Use monitor or skip in decision and add a short note for the reason. If the first page is enough, stop. If the editor needs another page, pass data.nextCursor as after and call again. Stop when data.nextCursor is null. Do not invent posts.

Estimated tool cost

Prices read through the Purrkey catalog on November 13, 2026, price revision anyapi-catalog-2026-11-05. The price unit is max_call, explained as "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings, not settled charges

StepFormulaUnit pricePlanned quantityTotal
First pagecalls x max price$0.0003 per call1$0.0003
Three-page cursor scancalls x max price$0.0003 per call3$0.0009

Model fees for the agent are not counted. The first page is at most $0.0003; a three-page scan is at most $0.0009

Next action

Open https://purrkey.app/tools/reddit?q=trending_posts to check the current inputs and price, then request the first page with limit 25

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 Reddit.
Explore Reddit tools and pricing

FAQ

How do I list trending Reddit posts with cursor paging?

Call anyapi.reddit.trending_posts with limit set to the page size, then pass the response's data.nextCursor back as after for the next page. Omit after for the first page.

What inputs does anyapi.reddit.trending_posts take?

It takes an optional limit from 1 to 100, default 25, and an optional after cursor from a previous response's data.nextCursor.

What output fields does anyapi.reddit.trending_posts return?

It returns found and data. data has posts and nextCursor; each post includes id, title, subreddit, author, score, numComments, createdUtc, permalink and url. When found is false, reason is not_found.

How many calls does a three-page cursor scan take?

A three-page scan takes 3 calls: one for the first page and two more, each using the prior data.nextCursor as after. At the max_call price of $0.0003 per call, the plan is at most $0.0009.

What does data.nextCursor null mean?

data.nextCursor is null when no more results exist. A non-null value is the cursor to pass back as after for the next page.

How much does the first page cost?

The first page is 1 call at up to $0.0003. The price is a max_call, so the total is a ceiling, not a settled charge.

Can I request 25 trending posts?

Yes. limit accepts an integer from 1 to 100 and defaults to 25, so limit 25 requests the editor's first page.

Next step

Try this with Reddit

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 Reddit tools

Share this article