Social media5 min readBy Purrkey teamUpdated

How to list an Instagram account's recent posts by handle

List an Instagram account's recent posts with captions, likes, comments, media, and cursor pagination

On this page

You have six Instagram handles to audit for a weekly social listening report. Pull each account's recent posts with captions, likes, comments, media and timestamps, then compare which accounts post most often and which posts attract the most comments

The worksheet below is the deliverable: one row per post, with the post id, posting account, UTC timestamp, caption, likes, comments, media type, media URL and post URL. No run has been executed for this article. Values here are placeholders showing the shape

The task and the worksheet design

Example handles, invented for this guide. Replace them with the handles you are auditing before a real run

Example handle
acme_plumbing_demo
north_pier_bakery_demo
harbor_lane_cafe_demo
oak_street_studio_demo
pinecrest_garden_demo
riverside_books_demo

The agent returns a table with these columns. Values here are placeholders showing the shape

idusernamecreatedUtccaptionlikescommentsmedia typemedia urlurl
(post id)(posting account)(Unix seconds)(caption text)00photo, video or gif(media URL)(post URL)

Use the first page per handle for the weekly report. The first page is one call per handle. If a handle needs more than one page, add calls and page with the cursor

Input fields and the first call

anyapi.instagram.user_posts takes handle, required, as the Instagram username without the @ sign. cursor is optional and comes from a previous response's data.nextCursor. requireFields is optional and names output fields the request must be able to return, for example userId. Naming a field can raise the price when the cheapest source cannot return it, because a dearer source serves and you are quoted and charged its price. A combination that no single source returns together is refused as invalid input, with no charge. Fields you do not name are still returned when the serving source has them. A named field can still be absent on a post that genuinely lacks it

The tool from the price block is called through POST /v1/runs with toolId anyapi.instagram.user_posts. Keep the first run to one handle so you can see the table shape before you spend six calls

Output fields that drive the comparison

found says whether a result came back. When found is false, reason is not_found, and the contract says a found: false answer is a successful call, not an error. For a handle that returns found: true, data.posts is the array, and data.nextCursor is the cursor for the next page or null when the lane has no more

Each post has id, url, caption, likes, comments, createdUtc, username and verified as required fields. createdUtc is Unix seconds, so sort by it to order posts and count posts per handle. comments and likes are integers for the engagement comparison. caption gives the text context. media is an array with type and url, plus videoUrl for video and gif items

username is the account that posted. The contract says a profile feed includes collaborator posts, so username is not always the handle you requested. Keep both the requested handle and the returned username in your notes, or a collaborator post can look like a new account

The cursor rule affects each page after the first. Cursor pagination requires passing the previous response's data.nextCursor back as cursor to continue. Stop when data.nextCursor is null. The first page per handle is one call, so six handles at one page each is six calls. More pages mean more calls, and the cost table below covers first pages only

The companion guide covers latest Instagram posts for a hashtag: latest Instagram posts for a hashtag

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to list recent Instagram
posts for the six Example handles below. Replace the Example handles with your
own before running. Check the current inputs and price of
anyapi.instagram.user_posts before running anything. Call
anyapi.instagram.user_posts once per handle with handle set to the username
without @. For the weekly report, request the first page for each handle. If a
handle needs another page, pass data.nextCursor from the previous response
back as cursor. Return a table with id, username, createdUtc, caption, likes,
comments, media type, media url and post url. Leave out rows when found is
false and note the handle as not found. Do not invent posts.

Example handles:
acme_plumbing_demo
north_pier_bakery_demo
harbor_lane_cafe_demo
oak_street_studio_demo
pinecrest_garden_demo
riverside_books_demo

Estimated tool cost

The catalog lists the unit as max_call: Maximum per call. Successful runs settle at the actual AnyAPI charge. Prices are read from the Purrkey catalog on November 12, 2026, and the totals below are ceilings, not settled charges

StepFormulaUnit pricePlanned quantityTotal
One account, first pagecalls x max price$0.0036 per call1$0.0036
Six accounts, first page eachcalls x max price$0.0036 per call6$0.0216
Six-account plan$0.0216

Model fees for the agent are not counted. If you page a handle past the first page, add one call per extra page at the same listed unit price

Run the first page for your handles

Open the tool page to run the first page for your six handles: Instagram 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 Instagram.
Explore Instagram tools and pricing

FAQ

How do I list an Instagram account's recent posts by handle?

Call the Instagram user posts tool with handle set to the username without @. The first page returns data.posts with fields such as id, username, createdUtc, caption, likes, comments, media and url.

What inputs does the Instagram user posts tool take?

handle is required and is the Instagram username without the @ sign. cursor is optional and comes from a previous response's data.nextCursor. requireFields is optional and names output fields the request must be able to return.

How does cursor pagination work for the Instagram user posts tool?

Pass the previous response's data.nextCursor back as cursor to continue. data.nextCursor is null when the lane has no more posts.

What does a found false response mean?

It means reason is the not-found value: the source states the target does not exist or returned nothing for it. The contract says a found false answer is a successful call, not an error.

How much does it cost to list six Instagram accounts' first page?

At the listed maximum per-call price of $0.0036 per call, six first-page calls are at most $0.0216. One first-page call is at most $0.0036. Successful runs settle at the actual AnyAPI charge.

What fields compare posting frequency and comments?

Use createdUtc to order posts and count posts per handle, and comments to compare comment counts across posts. username is the posting account, which can differ from the requested handle on collaboration posts.

Why is username not always the handle I requested?

The contract says a profile feed includes collaborator posts, so username is the account that posted and is not always the requested handle.

Next step

Try this with Instagram

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

Share this article