Docs · Post comments
Post comments
A page of public comments with authors, timestamps and likes.
https://api.lurkapi.com/v2/instagram/post/commentsWhen to use this
Pass a post URL or shortcode. Comments are in Instagram's public order, which can differ from chronological order. Pass end_cursor as after for the next page. This endpoint returns comments rather than fetching all replies; a missing reply count stays null.
Parameters
All parameters go in the query string.
| Parameter | Description |
|---|---|
codestringoptional | The post's shortcode, e.g. Ddl5eH-u4le. Required unless url is given. |
urlstringoptional | An instagram.com/p/, /reel/ or /tv/ URL, or the shortcode. Required unless code is given.
|
firstintegeroptional | Requested page size, 1–50; default 12. Instagram may return fewer items.
|
afterstringoptional | Pass end_cursor from the previous page unchanged; omit for the first page. |
Example request
Replace YOUR_API_KEY with your key, or set LURKAPI_KEY for the code. Get a free key.
curl "https://api.lurkapi.com/v2/instagram/post/comments?url=https%3A%2F%2Fwww.instagram.com%2Fp%2Faye83DjauH%2F&first=15" \
-H "x-api-key: YOUR_API_KEY"const params = new URLSearchParams({
url: "https://www.instagram.com/p/aye83DjauH/",
first: "15",
});
const res = await fetch(`https://api.lurkapi.com/v2/instagram/post/comments?${params}`, {
headers: { "x-api-key": process.env.LURKAPI_KEY },
});
const data = await res.json();
if (!data.success) throw new Error(`${data.code}: ${data.error}`);
console.log(data.comments);import os
import requests
res = requests.get(
"https://api.lurkapi.com/v2/instagram/post/comments",
params={
"url": "https://www.instagram.com/p/aye83DjauH/",
"first": "15",
},
headers={"x-api-key": os.environ["LURKAPI_KEY"]},
timeout=60,
)
data = res.json()
if not data["success"]:
raise RuntimeError(f"{data['code']}: {data['error']}")
print(data["comments"])Example response
A real response from this endpoint, captured from the live API and trimmed to a couple of items. Strings over 96 characters (mostly signed media URLs) are cut short and end in ….
Show the example response (2 KB)Hide
{
"success": true,
"credits_remaining": 99,
"credits_charged": 1,
"comments": [
{
"pk": "17846920963063874",
"text": "haha 😄 This is cute",
"created_at": 1387393108,
"comment_like_count": 0,
"child_comment_count": null,
"parent_comment_id": null,
"user": {
"pk": "23316075",
"username": "danielakarinraffl",
"full_name": null,
"profile_pic_url": "https://scontent-iad6-1.cdninstagram.com/v/t51.2885-19/483245904_1085995…",
"is_verified": false
}
},
{
"pk": "17846527357063874",
"text": "Eww",
"created_at": 1382738486,
"comment_like_count": 0,
"child_comment_count": null,
"parent_comment_id": null,
"user": {
"pk": "608886146",
"username": "xiezc1",
"full_name": null,
"profile_pic_url": "https://scontent-iad3-1.cdninstagram.com/v/t51.2885-19/462656901_8380958…",
"is_verified": false
}
}
],
"end_cursor": "{\"is_server_cursor_inverse\":true,\"server_cursor\":\"AQHTHWl1x-fIQ1oM8-Cxb-…",
"has_next_page": true
}Response fields
Every field of a successful response. [] marks a list: a[].b is the b of each item in a. nullable fields can be null; optional fields can be missing.
Show all 18 fieldsHide
| Field | Type | Description |
|---|---|---|
| success | true | Always true here; errors have success: false. |
| credits_remaining | number | Your balance after this call. On anonymous playground calls: free tries left today. |
| credits_charged | number | Credits this call cost; 0 on free endpoints. On anonymous playground calls: tries used (1). |
| comments | object[] | The comments Instagram returned for this page. |
| comments[].pk | string | Comment id, represented as a string. |
| comments[].text | string | Comment text, preserving line breaks. |
| comments[].created_at | numbernullable | Published at, Unix seconds; null when not shown or returned. A null count is not zero. |
| comments[].comment_like_count | numbernullable | Number of likes on the comment; null when not shown or returned. A null count is not zero. |
| comments[].child_comment_count | numbernullable | Reply count; frequently omitted in the public view; null when not shown or returned. A null count is not zero. |
| comments[].parent_comment_id | stringnullable | Parent comment id; null for top-level comments or when unavailable; null when not returned. |
| comments[].user | object | Comment author. |
| comments[].user.pk | string | The account's numeric Instagram id, represented as a string. |
| comments[].user.username | string | Instagram username, without @. |
| comments[].user.full_name | stringnullable | Display name; null when not returned. |
| comments[].user.profile_pic_url | stringnullable | Profile image URL; CDN links can expire; null when not returned. |
| comments[].user.is_verified | booleannullable | Whether Instagram shows a verified badge; null when not returned. |
| end_cursor | stringnullable | Opaque pagination cursor; pass it as after for the next page; null when not returned. |
| has_next_page | boolean | Whether Instagram reports another page. A false value ends pagination. |
Pagination
Pass a cursor from a previous response as after to load more (see When to use this). Each call costs 1 credit.
Caching and freshness
Responses are cached for up to 2 minutes, so a repeat call within that window can return the same data. It still costs 1 credit.
Errors
Errors return { success: false, error, code, docs } with the HTTP status below. Validation errors, 401/402/429 rejections and 5xx failures are free; not_found is charged (how charging works). All error codes.
| Status | Code | Meaning |
|---|---|---|
| 401 | missing_api_key | No API key. Send it in the x-api-key header. |
| 401 | invalid_api_key | The key is unknown or was revoked. |
| 402 | insufficient_credits | Not enough credits for this call. Buy a pack or wait for tomorrow's top-up. |
| 403 | not_public | The platform confirmed this account or content isn't available to logged-out visitors. Use a publicly visible target. Charged when the platform was checked. |
| 404 | not_found | The endpoint, or the thing you asked for (ad, post, subreddit), doesn't exist. Charged when the platform was checked. |
| 405 | method_not_allowed | Endpoints take GET with query params. |
| 429 | rate_limited | Too many calls at once. Wait for the retry-after seconds, then retry. |
| 500 | internal_error | Something broke on our side. Retry; 5xx errors are free. |
| 502 | upstream_error | The platform didn't give a usable answer. Retry; 5xx errors are free. |
| 503 | upstream_busy | All our connections to the platform are busy. Retry in a few seconds; 5xx errors are free. |
| 504 | upstream_timeout | The platform took over 30 seconds to answer. Retry; timeouts are free. |
Use it in Claude
Once LurkAPI is connected to Claude, this endpoint is the instagram_post_comments tool. Ask in plain English, for example:
Use LurkAPI's instagram_post_comments with url "https://www.instagram.com/p/aye83DjauH/", first "15" and summarize what you find.Claude calls instagram_post_comments with arguments like these, and each call costs 1 credit:
{
"url": "https://www.instagram.com/p/aye83DjauH/",
"first": "15"
}Tool results skip nulls and empty lists to save tokens.