Social media7 min readBy Purrkey teamUpdated

How to export the comments on an Instagram post

Turn one Instagram post URL into a comment table with author, text, likes and time, then repeat the page loop for three more posts

On this page

You have four Instagram product launch posts and need the comments from the first one, then the other three, as a table of author, text, likes and time before the team starts replying. The tool is anyapi.instagram.post_comments, and the work is a short loop: fetch one page, keep the rows, pass the cursor back, stop when the cursor is null

The tables below are designs with placeholder values. One real call was made for this guide, on a public NASA post, and its result follows the field guide

Example input and the worksheet design

One call handles one post URL. An invented example, which you replace with the real launch post:

That URL carries a post shortcode in the /p/ form. The contract also accepts /reel/, /reels/ and /tv/ URLs. A profile URL such as https://www.instagram.com/example-handle/ names no post, so the tool rejects it instead of charging for an empty result. For a profile, the contract points to instagram.user_posts to list its posts first

The worksheet has one row per comment. Values here are placeholders showing the shape:

idauthortextlikescreatedUtc (date)repliestag
(string)(handle)(comment text)(integer or empty)(date from epoch seconds)(integer or empty)question, complaint, praise, other

Your tag column is the triage decision: question, complaint, praise, other. The contract has no tag field, so you set the tag while reading the text. Keep id as the row key so the four posts can share one sheet without mixing rows

The input, the URL limit and the page loop

url is required and cursor is optional. Pass the full Instagram post or reel URL. The contract's pattern accepts /p/, /reel/, /reels/ and /tv/ paths with a shortcode, with or without www, and with an optional query string or fragment. The cursor field takes the nextCursor value from a previous response

Purrkey tool card for the Instagram Post Comments tool with its per-call listing

Instagram Post Comments card. Source: Purrkey tool directory, captured November 12, 2026. The card shows "$0.0180 per call"

The URL must point to a public post or reel. A private or removed post comes back with found false and reason not_found, and the call still counts as a call. A profile URL is a different case: the contract says it is rejected instead of charged for an empty result, because it names no post

Pagination is a loop, not a batch. Call once. If data.nextCursor is not null, call again with that value in cursor. Stop when data.nextCursor is null. Each page is a billed call, so a post with three pages is three calls. The tool cannot return four posts in one request, and the contract has no field for a list of URLs. Run one post first, then repeat the loop for the other three

A published guide covers TikTok comments at export TikTok video comments

Reading the output fields that drive the decision

found and data sit at the top level. When found is false, data is null and reason is not_found. The contract says a found: false answer is a successful call, not an error, and costUsd is what it actually cost. Keep that row in the run log so the miss is visible

data.comments is the array to write into the sheet. The fields that drive triage are:

  • id: the comment id, used as the row key
  • author: the commenting account
  • text: the comment body
  • likes: the like count on the comment, null when the source does not report it
  • createdUtc: UTC epoch seconds; multiply by 1000 for a JavaScript Date
  • replies: the number of replies to the comment, null when this source does not report it; the contract says it tells you whether instagram.comment_replies has anything to fetch
  • verified: a boolean on the commenting account
  • userId and avatarUrl: extra account fields, with userId null when the source does not report it

Convert createdUtc before sorting. A row with likes: null is not a zero; keep it blank in the sheet. The replies count is a signal for a second pass, not a reply flag. When you need the replies themselves, the contract points to instagram.comment_replies

data.nextCursor is the control field for the loop. Null means the lane has no more comments. A string means another page exists and must be fetched with cursor

What one real call returned

We ran anyapi.instagram.post_comments once on November 12, 2026 against a public NASA post, https://www.instagram.com/p/Dfc1mYxFevS/, with the $0.018 cap. Run run_01a1cfd8-ac9e-7e50-836c-ec09f882dace succeeded in two seconds and settled at $0.0008, well under the ceiling

FieldValue returned
foundtrue
data.comments24 rows
data.nextCursora string, so a second page exists
likes on the first rows0
replies on the first rowsnull
createdUtcpresent on every row
charged$0.0008 of the $0.018 ceiling

Two things to carry into the plan. A page held 24 comments, so a post with a few hundred comments is a loop of many pages, not three. And replies came back null on this source, so the "second pass" signal is not always available; the column stays in the sheet, but empty

The agent prompt

Agent prompt
Set up https://purrkey.app/SKILL.md, then use Purrkey to export the comments on one Instagram launch post, then repeat for three more posts, with anyapi.instagram.post_comments.
Check the current inputs and price of anyapi.instagram.post_comments before running anything.
For each post, call once with url set to the full post or reel URL. If data.nextCursor is not null, call again with cursor set to that value. Stop when data.nextCursor is null.
If found is false or data is null, write a row with the url and reason not_found, and do not invent comments.
Return a table with url, id, author, text, likes, createdUtc as a date, replies, verified and tag (question, complaint, praise or other).
Use this example URL first: https://www.instagram.com/p/EXAMPLE0001/

Replace the example URL with the first real launch post before the run, then add the other three URLs. The prompt asks for a table because the sheet is the deliverable, not a prose report. Run the first post alone and read nextCursor before you start the four-post loop

Estimated tool cost

The catalog price is up to $0.018 per call for anyapi.instagram.post_comments through POST /v1/runs with toolId anyapi.instagram.post_comments, unit max_call, price revision anyapi-catalog-2026-11-05, read on November 12, 2026. The unit is explained once as "Maximum per call. Successful runs settle at the actual AnyAPI charge." The totals below are ceilings, not settled charges

StepFormulaUnit pricePlanned quantityTotal
One post, three pages3 calls x max price$0.018 per call3$0.054
Four posts, three pages each12 calls x max price$0.018 per call12$0.216

A private or removed post still counts as a call, so a miss adds to the page count in the same way. Model fees for the agent are not counted in these totals

Next action

Open the Instagram post comments tool page, run the example URL or one real launch post, and read data.nextCursor on the first page before you commit the four-post run

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 export comments from an Instagram post?

Send the full post or reel URL to anyapi.instagram.post_comments in the url field. The response returns data.comments with id, author, text, likes, createdUtc and replies, plus data.nextCursor for the next page.

What input does anyapi.instagram.post_comments take?

A required url field with the full Instagram post or reel URL, and an optional cursor from a previous response's nextCursor.

What happens when an Instagram post is private or removed?

found is false, reason is not_found, and the call still counts as a call.

How many calls does a post with three pages use?

Three calls. Call once, pass data.nextCursor back as cursor, and stop when nextCursor is null. Each page is a billed call.

What does the replies field mean?

replies is the number of replies to the comment, or null when the source does not report it. The contract says it tells you whether instagram.comment_replies has anything to fetch.

How much do four Instagram posts at three pages each cost?

At $0.018 per call, 12 calls total $0.216.

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