Tutorial · Instagram · cURL, Python, Node.js, PHP, Go, Ruby

Get the comments on an Instagram post

Comments on a post. Complete code for GET /v1/instagram/posts/{post}/comments in six languages and both official SDKs, each tested against the documented response.

Short answer. One call returns about 15 comments on a public post, top first by default or newest first with sort=newest. Each has text, created_at, like_count, reply_count and the author.

Facts checked 2 December 2026. Prices change: follow the links before you decide.

Why call it

  • Run sentiment and topic analysis on campaign posts for social listening.
  • Collect audience questions and feedback for creator and brand reports.
  • Feed comment threads to an LLM app for summaries.

The request

GET https://api.handlehaul.com/v1/instagram/posts/{post}/comments with your key in the X-Api-Key header. Comments on a post. Comments on a post. 1 credit a page. Page size about 15. Docs: https://api.handlehaul.com/docs/instagram-comments-api

Parameters for Comments on a post
ParameterInDescription
post requiredpathPost shortcode, numeric post id, or an instagram.com/p|reel URL (URL-encoded).
sortqueryOrder: top or newest (default top). One of: top, newest.
cursorquerynext_cursor from the previous page (opaque, sealed).
freshquerytrue skips the cache (full price).

Code in 6 languages

Each sample is a complete program: it reads the key from HANDLEHAUL_API_KEY, waits and retries when the API answers 429 (using Retry-After), stops with the error code on anything else, and follows pagination.next_cursor for up to 3 pages. The SDK versions do the retries for you.

instagram-comments.sh

# Comments on a post. --retry waits out a 429 using its Retry-After header;
# --fail exits with code 22 on any other error (drop it to read the error JSON).
# Next page: add --data-urlencode "cursor=<pagination.next_cursor>" (stop when it is null).
curl -sS --fail --retry 3 -G "https://api.handlehaul.com/v1/instagram/posts/C9xYzAbCdEf/comments" \
  -H "X-Api-Key: $HANDLEHAUL_API_KEY" \
  --data-urlencode "sort=newest"
Generated from the OpenAPI spec (2026-12-02); every sample was syntax-checked and run against a local mock serving the response below. Language guides: Python, Node.js, PHP, Go, Ruby, cURL.

Response

A list in data, with pagination.next_cursor and has_more, and meta with what the call cost. Example values, from the API docs. Lists are cut to two rows here.

200 · application/json
{
  "data": [
    {
      "id": "782890015575457736",
      "text": "Love this!",
      "created_at": "2026-11-28T12:00:00.000Z",
      "like_count": 76,
      "reply_count": 0,
      "author": {
        "id": "6899639575",
        "username": "studio.atelier21",
        "full_name": "Studio Atelier",
        "is_private": false,
        "is_verified": false,
        "profile_pic_url": "https://scontent.cdninstagram.com/…/6899639575.jpg"
      }
    }
  ],
  "pagination": {
    "next_cursor": "Ym9v…sealed…",
    "has_more": true,
    "page_size": 15
  },
  "meta": {
    "request_id": "req_…",
    "cached": false,
    "cache_age_seconds": 0,
    "credits_charged": 1,
    "credits_remaining": 26943
  }
}

Cost, cache and limits

  • 1 credit per page. At $1.40 to $0.80 per 1,000 calls; the samples stop after 3 pages, so one run costs 3 credits at most. Cache hits, failed calls and 429 answers are free; meta.credits_charged says what each call cost.
  • Cache. The first page is cached for 60 seconds and later pages (with a cursor) for 15 minutes. Add fresh=true to force a live call (billed).
  • Speed. Over your plan's requests-per-second limit the API answers 429 rate_limited with Retry-After; the samples wait that long and retry.
  • Private accounts. Public data only: a private account answers 403 private_account, and that call is free.
  • Testing. A kd_test_ key returns sample data in this exact shape at no cost, so you can run the code before you spend anything.

Things to know

  • sort is top (default) or newest. Use newest when you poll for new comments.
  • Check reply_count before calling replies: only comments with a count above 0 need a /comments/{comment}/replies call, and that call also needs post.
  • Keep each comment's id: replies and comment likers are fetched by it.

Next steps

Instagram comments API: questions

How do I get all comments on an Instagram post with an API?
Call GET /v1/instagram/posts/{post}/comments and follow pagination.next_cursor until it is null. Pages hold about 15 comments.
How do I get the replies to Instagram comments?
Each comment carries reply_count. Where it is above 0, call GET /v1/instagram/comments/{comment}/replies?post= with the comment id and the post.

Run it on real data

One key for Instagram and TikTok. $1.40 to $0.80 per 1,000 calls; failed calls and cache hits are free.

Want to test first? Sandbox keys are free and unlimited, with sample data in the live schema.