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.
| Platform | Query | model | input.operation |
|---|---|---|---|
| Post comments | instagram | comments |
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
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"}}'type
socialmodel
instagraminput.operation
commentsinput.url
instagram.com /p/, /reel/ or /tv/ page; input.post_url is accepted as an aliasinput.sort_order
popular or recentinput.min_id
next_min_id for the next pageIdempotency-Key
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
{ "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
| HTTP | Body | What to do |
|---|---|---|
| 200 | call.state=succeeded | Read call.comments; charge settled. |
| 202 | call.state=started / unknown | Keep call.id and read GET /v1/generations/{id} with the original connection key. Do not submit a new fetch. |
| 402 | error.code=insufficient_credits | Add credits and retry. Nothing was submitted or charged. |
| 404 / 502 / 503 | error.code | No customer charge. Codes: post_not_found, comments_not_found, upstream_error, capability_unavailable (paused, not configured, or key not authorized). |