Prism Post Comments API
Scrape Prism Post Comments data with one API call. Batch comment reader for many posts at once. POST a JSON body with `items`, an array of 1-25 post URLs (or `{ "url": "…", "custom_id": "…" }` objects; `urls` is accepted too), from instagram, tiktok, youtube, facebook, reddit, twitter (x), threads or linkedin, mixed freely. Each URL is read through its platform's own comment endpoint (instagram, tiktok and facebook post/comments, youtube video/comments, twitter tweet/replies, reddit post/comments, threads post/comments, linkedin post/comments) on that endpoint's cursor, up to `per_post` comments (default 20, at most 200). Returns one row per URL, in input order: `status` (ok, not_found, unsupported, error or deferred), the `target` and `custom_id` echoed, the credits that row cost, and on an ok row `data` with `platform`, `endpoint`, `url`, `items` (the same canonical comment rows that endpoint returns), `pages`, `truncated` and `next_cursor` (pass it as `cursor` to `endpoint` to read on). One dead or unsupported URL never fails the batch. Send `since` (a date or ISO 8601 timestamp) to keep only comments published at or after it: on Instagram, YouTube, X and LinkedIn the post is read newest first and the walk stops at the first older comment (`stopped_at: "since"`); elsewhere each post is read up to per_post comments and filtered. A Reddit row holds the comments of one read of the thread (the single endpoint's deeper reply expansion is not run here; `truncated` says when the thread holds more). Posts not started within the 45-second budget come back `deferred` at no charge: re-request them. For more than 25 posts, send several calls, or `POST /v1/prism/jobs` with `endpoint` set to the platform's comment endpoint (up to 1,000 posts in the background). Never cached. Optionally streams Server-Sent Events when the client sends `Accept: text/event-stream`.
Last updated October 2026Maintained by the SocialCrawl team
Returns the comments under each post URL you send, across platforms and in the order you sent them, with a status per row and the same comment rows as each platform's own comment endpoint.
Use it when you hold a list of post URLs and want their comments, or only the new ones since a date, in one call instead of a loop over the comment endpoints.
Searching 69 platforms in parallel
What can you do with the Post Comments API?
The Post Comments endpoint gives you structured Prism data with computed fields in a single request. No scraping infrastructure to build or maintain.
Example Request
# POST /v1/prism/post-comments: Metered: holds 1 credit per call up front and refunds what the call does not use. Cache hits are free and failed calls are refunded.
# Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
# --max-time 60: the API's own time limit for this endpoint.
# --retry 3: retries timeouts, 429 and 5xx, honoring Retry-After.
# -o response.json keeps only the final attempt's body.
# One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
IDEMPOTENCY_KEY=$(od -An -N16 -tx1 /dev/urandom | tr -d ' \n')
curl -sS --max-time 60 --retry 3 -o response.json -X POST \
-H "x-api-key: YOUR_API_KEY" \
-H "Idempotency-Key: $IDEMPOTENCY_KEY" \
-H "Content-Type: application/json" \
-d '{"items":["https://www.tiktok.com/@mrbeast/video/7654638524729216287","https://www.youtube.com/watch?v=dQw4w9WgXcQ"]}' \
"https://www.socialcrawl.dev/v1/prism/post-comments" && cat response.json# POST /v1/prism/post-comments: Metered: holds 1 credit per call up front and refunds what the call does not use. Cache hits are free and failed calls are refunded.
# Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
import os
import random
import time
import uuid
import requests
API_KEY = os.environ.get("SOCIALCRAWL_API_KEY", "YOUR_API_KEY")
TIMEOUT_S = 60 # the API's own time limit for this endpoint.
MAX_RETRIES = 3
URL = "https://www.socialcrawl.dev/v1/prism/post-comments"
def backoff(attempt):
# Exponential backoff with jitter: about 1 s, 2 s, then 4 s.
return 2 ** attempt * (0.5 + random.random() / 2)
def socialcrawl(payload):
# One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
idempotency_key = str(uuid.uuid4())
for attempt in range(MAX_RETRIES + 1):
try:
res = requests.post(
URL,
json=payload,
headers={"x-api-key": API_KEY, "Idempotency-Key": idempotency_key},
timeout=TIMEOUT_S,
)
body = res.json()
except (requests.RequestException, ValueError):
# A timeout, a dropped connection or a non-JSON gateway page: retry with the same key.
if attempt == MAX_RETRIES:
raise
time.sleep(backoff(attempt))
continue
if body["success"]:
return body
error = body["error"]
# Branch on error["type"], never on the message text.
if error["type"] == "RESOURCE_NOT_FOUND":
return None # refunded: nothing to read
retry_after = res.headers.get("Retry-After")
# SERVICE_UNAVAILABLE without Retry-After is a withdrawn endpoint: permanent.
permanent = error["type"] == "SERVICE_UNAVAILABLE" and retry_after is None
if not error.get("retryable") or permanent or attempt == MAX_RETRIES:
raise RuntimeError(f"{error['type']}: {error['message']} (request_id {body['request_id']})")
# Retry-After (seconds) wins; otherwise back off.
time.sleep(float(retry_after) if retry_after else backoff(attempt))
payload = {
"items": ["https://www.tiktok.com/@mrbeast/video/7654638524729216287", "https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
}
body = socialcrawl(payload)
if body is not None:
print(body["data"])// POST /v1/prism/post-comments: Metered: holds 1 credit per call up front and refunds what the call does not use. Cache hits are free and failed calls are refunded.
// Check the price first for 0 credits: add dry_run=1 to the query. Nothing is fetched or charged.
const API_KEY = process.env.SOCIALCRAWL_API_KEY ?? "YOUR_API_KEY";
const TIMEOUT_MS = 60_000; // the API's own time limit for this endpoint.
const MAX_RETRIES = 3;
type Page = { next_cursor: string | null; has_more: boolean };
type SocialCrawlResponse =
| { success: true; data: any; pagination?: Page; credits_used: number; request_id: string }
| { success: false; error: { type: string; message: string; retryable: boolean }; request_id: string };
const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
// Exponential backoff with jitter: about 1 s, 2 s, then 4 s.
const backoffMs = (attempt: number) => 2 ** attempt * 1000 * (0.5 + Math.random() / 2);
async function socialcrawl(url: string, payload: Record<string, unknown>) {
// One Idempotency-Key per request, reused on every retry, so a retried call is never charged twice.
const idempotencyKey = crypto.randomUUID();
for (let attempt = 0; ; attempt++) {
let res: Response;
let body: SocialCrawlResponse;
try {
res = await fetch(url, {
method: "POST",
headers: {
"x-api-key": API_KEY,
"Content-Type": "application/json",
"Idempotency-Key": idempotencyKey,
},
body: JSON.stringify(payload),
signal: AbortSignal.timeout(TIMEOUT_MS),
});
body = (await res.json()) as SocialCrawlResponse;
} catch (error) {
// A timeout, a dropped connection or a non-JSON gateway page: retry with the same key.
if (attempt >= MAX_RETRIES) throw error;
await sleep(backoffMs(attempt));
continue;
}
if (body.success) return body;
// Branch on error.type, never on the message text.
if (body.error.type === "RESOURCE_NOT_FOUND") return null; // refunded: nothing to read
const retryAfter = res.headers.get("Retry-After");
// SERVICE_UNAVAILABLE without Retry-After is a withdrawn endpoint: permanent.
const permanent = body.error.type === "SERVICE_UNAVAILABLE" && retryAfter === null;
if (!body.error.retryable || permanent || attempt >= MAX_RETRIES) {
throw new Error(`${body.error.type}: ${body.error.message} (request_id ${body.request_id})`);
}
// Retry-After (seconds) wins; otherwise back off.
await sleep(retryAfter ? Number(retryAfter) * 1000 : backoffMs(attempt));
}
}
const body = await socialcrawl("https://www.socialcrawl.dev/v1/prism/post-comments", {
items: ["https://www.tiktok.com/@mrbeast/video/7654638524729216287", "https://www.youtube.com/watch?v=dQw4w9WgXcQ"],
});
if (body) console.log(body.data);Parameters
| Parameter | Required | Description |
|---|---|---|
| items | Yes | JSON array of 1-25 post URLs. Each item is a URL string or `{ "url": "https://…", "custom_id"?: "…" }` (custom_id up to 128 characters, echoed on its row). `urls` is accepted as an alias. |
| per_post | No | Optional. An integer from 1 to 200 (default 20): the most comments read per post, walked page by page on that platform's comment endpoint. |
| since | No | Optional. Only comments published on or after this date (YYYY-MM-DD, midnight UTC) or ISO 8601 timestamp. A post whose comments are all older costs nothing. |
What does the Prism Post Comments API return?
Every response follows one unified schema. Here is a real, unmodified response body, so you can see the exact fields you get back before spending a credit.
Example response
{
"success": true,
"platform": "instagram",
"endpoint": "/v1/instagram/engagement",
"data": {
"engagement_rate_percentages": 38.33,
"recent_posts": 12,
"followers": 87608035,
"comments": 528912,
"likes": 33049046,
"recent_posts_explanation": "Statistics based on the last 12 posts",
"id_user": "2278169415",
"username": "mrbeast",
"is_private": false,
"posts_details": [
{
"likes": 5636982,
"comments": 69484,
"taken_at": 1781457954,
"datetime": "2026-06-14 20:25:54",
"hours_since_post": 461,
"time_ago": "19 days ago",
"likes_per_hour": 12228,
"comments_per_hour": 151
},
{
"likes": 20000768,
"comments": 223510,
"taken_at": 1732824650,
"datetime": "2024-11-28 23:10:50",
"hours_since_post": 13971,
"time_ago": "2 years ago",
"likes_per_hour": 1432,
"comments_per_hour": 16
},
{
"likes": 929226,
"comments": 30633,
"taken_at": 1782232475,
"datetime": "2026-06-23 19:34:35",
"hours_since_post": 246,
"time_ago": "10 days ago",
"likes_per_hour": 3777,
"comments_per_hour": 125
},
{
"likes": 487761,
"comments": 22482,
"taken_at": 1781799425,
"datetime": "2026-06-18 19:17:05",
"hours_since_post": 366,
"time_ago": "15 days ago",
"likes_per_hour": 1333,
"comments_per_hour": 61
},
{
"likes": 712265,
"comments": 15716,
"taken_at": 1781366405,
"datetime": "2026-06-13 19:00:05",
"hours_since_post": 487,
"time_ago": "20 days ago",
"likes_per_hour": 1463,
"comments_per_hour": 32
},
{
"likes": 1475116,
"comments": 35386,
"taken_at": 1781277094,
"datetime": "2026-06-12 18:11:34",
"hours_since_post": 512,
"time_ago": "21 days ago",
"likes_per_hour": 2881,
"comments_per_hour": 69
},
{
"likes": 1108220,
"comments": 26632,
"taken_at": 1780160249,
"datetime": "2026-05-30 19:57:29",
"hours_since_post": 822,
"time_ago": "1 months ago",
"likes_per_hour": 1348,
"comments_per_hour": 32
},
{
"likes": 542948,
"comments": 28476,
"taken_at": 1779375582,
"datetime": "2026-05-21 17:59:42",
"hours_since_post": 1040,
"time_ago": "1 months ago",
"likes_per_hour": 522,
"comments_per_hour": 27
},
{
"likes": 698514,
"comments": 24401,
"taken_at": 1779120014,
"datetime": "2026-05-18 19:00:14",
"hours_since_post": 1111,
"time_ago": "2 months ago",
"likes_per_hour": 629,
"comments_per_hour": 22
},
{
"likes": 468000,
"comments": 13548,
"taken_at": 1778947209,
"datetime": "2026-05-16 19:00:09",
"hours_since_post": 1159,
"time_ago": "2 months ago",
"likes_per_hour": 404,
"comments_per_hour": 12
},
{
"likes": 526594,
"comments": 24411,
"taken_at": 1777737719,
"datetime": "2026-05-02 19:01:59",
"hours_since_post": 1495,
"time_ago": "2 months ago",
"likes_per_hour": 352,
"comments_per_hour": 16
},
{
"likes": 462652,
"comments": 14233,
"taken_at": 1777580305,
"datetime": "2026-04-30 23:18:25",
"hours_since_post": 1538,
"time_ago": "2 months ago",
"likes_per_hour": 301,
"comments_per_hour": 9
}
]
},
"credits_used": 5,
"credits_remaining": 9999,
"request_id": "req-8Kq2ZmR4vT9xLb3P",
"cached": false,
"redacted": true
}Example captured from the Instagram API. Every SocialCrawl endpoint returns this same unified schema, so your Prism Post Comments response has the same fields.
How does the Prism Post Comments API work?
Send a GET request with your API key and get back clean, structured JSON in our unified schema. Supported computed fields are populated when the source provides the required inputs.
Method
POST
Response
JSON
How do you scrape social media data in seconds?
The fastest social media scraping API for developers. Scrape profiles, posts, comments, and analytics from 69 platforms covering 10B+ monthly active users.
One schema, every platform
Query 69 platforms with identical response structures. Write your integration once.
Computed fields, not just scraped
When an endpoint supports these metrics and the source provides the required inputs, the normalized record includes engagement_rate, estimated_reach, content_category, and language. Ready to use.
See your data before you code
Visual Data Explorer. Paste any URL, get rich result cards, sortable tables, CSV export.
import requests
response = requests.get(
'https://www.socialcrawl.dev/v1/tiktok/profile',
params={'handle': 'charlidamelio'},
headers={'x-api-key': 'sc_YOUR_API_KEY'}
)
data = response.json(){
"success": true,
"platform": "tiktok",
"data": {
"author": {
"username": "charlidamelio",
"followers": 152400000
},
"engagement": {
"likes": 12400000000,
"engagement_rate": 0.087
},
"metadata": {
"language": "en",
"content_category": "lifestyle"
}
}
}Ready to scrape Prism Post Comments data?
Get your API key and start pulling Prism data in under 60 seconds.
