Get comments

Introduction

POST /v1/generations with Authorization: Bearer <ANYCAP_API_KEY>. Use type=social, model for the platform and input.operation for the query. Parameters and examples follow.

PlatformQuerymodelinput.operation
InstagramPost commentsinstagramcomments

Instagram · Post comments

Read one page of public comments from an Instagram post link. Send type: social, model: instagram and input.operation: comments with the post link.

Request

BASH
curl -X POST https://api.anycap.io/v1/generations \  -H "Authorization: Bearer $ANYCAP_API_KEY" \  -H "Content-Type: application/json" \  -H "Idempotency-Key: 3f8c1d6b-2a94-4e7f-b5c0-9d1a6e3f7b42" \  -d '{"type":"social","model":"instagram","input":{"operation":"comments","url":"https://www.instagram.com/p/DfAOoAXRg3L/","sort_order":"recent"}}'
FieldValueNote
type
Valuesocial
NoteRequired
model
Valueinstagram
NoteRequired
input.operation
Valuecomments
NoteRequired; selects one comments page
input.url
ValueInstagram post link
NoteRequired; instagram.com /p/, /reel/ or /tv/ page; input.post_url is accepted as an alias
input.sort_order
Valuepopular or recent
NoteOptional; omit to use the supplier default
input.min_id
ValueNext page cursor
NoteOptional; use the previous response's next_min_id for the next page
Idempotency-Key
ValueUnique key
NoteRecommended; a new fetch uses a new key, a retry keeps the original

The connection key must be authorized for social.instagram.post.comments. An unauthorized key returns 503 capability_unavailable before any upstream call and is not charged. Each page is a separate execution and is charged separately.

Response

JSON
{  "type": "social",  "call": {    "id": "3f8c1d6b-2a94-4e7f-b5c0-9d1a6e3f7b42",    "state": "succeeded",    "operation": "comments",    "url": "https://www.instagram.com/p/DfAOoAXRg3L/",    "sort_order": "recent",    "amount_microcredits": "11000000",    "charged_microcredits": "11000000",    "created_at": "2026-10-28T06:43:37Z",    "comments": {      "comment_count": 5916,      "caption": "An original, straight from the studio 🎶",      "comments": [        {          "id": "17963218602298209",          "text": "Amazing 🤩",          "created_at": 1793125605,          "created_at_utc": "2026-10-27T18:26:45Z",          "author": {            "id": "78099747897",            "username": "faz2faz1",            "nickname": "Khode Arya",            "avatar_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/...jpg",            "verified": false          },          "like_count": 32,          "child_count": 3,          "liked_by_media_owner": false,          "has_translation": false        }      ],      "next_min_id": "next-page-token",      "has_more": true    },    "completed_at": "2026-10-28T06:43:44Z",    "media_downloads": [      {        "field": "comments.comments[0].author.avatar_url",        "source_url": "https://instagram.fbne9-1.fna.fbcdn.net/v/...jpg",        "download_url": "https://api.anycap.io/v1/social-media/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",        "expires_at": "2026-10-28T05:40:00Z",        "status": "ready"      }    ]  }}

call.comments contains the total comment_count, the post caption, and an ordered comments array. Each comment carries its id, text, numeric and RFC 3339 time, author (including the platform verified badge), like_count, child_count, up to 10 preview_children, liked_by_media_owner and has_translation. An empty page returns an empty comments array.

call.media_downloads adds Anycap download links while preserving the original third-party URLs. Only status=ready entries can be downloaded without an API key. Links expire 2 hours after call.completed_at, as shown in expires_at; reading the result does not renew them.

For pagination, pass the previous response's next_min_id unchanged as input.min_id and use a new idempotency key for the new page. has_more is false when the platform did not report more comments; next_min_id is absent on the last page.

Errors

HTTPBodyWhat to do
200call.state=succeededRead call.comments; charge settled.
202call.state=started / unknownKeep call.id and read GET /v1/generations/{id} with the original connection key. Do not submit a new fetch.
402error.code=insufficient_creditsAdd credits and retry. Nothing was submitted or charged.
404 / 502 / 503error.codeNo customer charge. Codes: post_not_found, comments_not_found, upstream_error, capability_unavailable (paused, not configured, or key not authorized).