GET /v1/facebook/post_comments
Facebook comments API: get a post's comments by post URL
Returns the top-level comments of one public Facebook post as Page[Comment], 10 a page: text, time and author. Send the post URL as post. To read the replies to a comment, send its id as feedback_id with the post URL to the comment replies API.
- Price
- $0.0005 per 10 results
- Billing
- $0.0005/10
- Batch
- Yes, through /v1/batch
- Failed calls
- Not charged
Example request
curl 'https://api.virev.ai/v1/facebook/post_comments?post=https%3A%2F%2Fwww.facebook.com%2Fphoto%2F%3Ffbid%3D1688249899339100&max_pages=1' \
-H "Authorization: Bearer $VIREV_API_KEY"import os
import requests
response = requests.request(
"GET",
"https://api.virev.ai/v1/facebook/post_comments",
params={
"post": "https://www.facebook.com/photo/?fbid=1688249899339100",
"max_pages": "1",
},
headers={"Authorization": f"Bearer {os.environ['VIREV_API_KEY']}"},
timeout=60,
)
response.raise_for_status()
print(response.json())Parameters
| Name | In | Type | Description |
|---|---|---|---|
post required | query | string | A post, reel, video or photo URL on facebook.com. |
since | query | string | Stop at this date. 2025-09-21 means midnight UTC (2025-09-21T00:00:00Z). Datetimes must use RFC3339 with a timezone, for example 2025-09-21T09:00:00+09:00. 365d means 365 days before submission. Invalid calendar dates return 400. With max_pages, the first boundary reached stops the walk. since alone creates a job. |
max_pages | query | integer | Maximum pages to fetch. -1 walks until exhaustion or since with no page cap, and must be written. Omitted, since alone bounds the walk; with neither, the job stops after 10 pages. Any positive integer is accepted. 1 returns one page synchronously with HTTP 200; any other value creates a durable job with HTTP 202. |
cursor | query | string | Opaque next_cursor from an earlier answer of this operation, also with get_raw=true. A native Facebook cursor from a raw page answers 400. Result download cursors belong to the results route. |
cached | query | auto | cache_only | live | auto (default) serves a read saved within the last 24 hours for these exact arguments, otherwise fetches. cache_only never contacts Facebook (404 not_cached when nothing is saved, whatever its age). live always fetches. Anything else is a 400. cache_only reads one saved page per request: omit max_pages or pass 1, and continue with next_cursor. |
get_raw | query | boolean | true returns the upstream JSON exactly as Facebook answered it instead of the normalized Page[Comment]. |
Idempotency-Key | header | string | Reuse this key with the same inputs to recover a lost job submission. A different input with the same key returns 409. |
Example response
The example response of the API reference, with lists cut to their first 3 items and long text shortened.
{
"data": {
"items": [
{
"id": "1428109295963941",
"text": "Believe whatever you want, but consider this simplification... Would a man be tarred and feathered, ridiculed, and chased nearly his entire life, by people wanting to kill him (until they did), over a lie? I certainly would have backed out …",
"created_at": "2026-10-12T16:32:41+00:00",
"likes": null,
"replies": null,
"liked_by_owner": null,
"owner": {
"id": "pfbid0dECjKZUoR8CmHPCnDLBonPfjSdDHVmg5tHd8rg48U7EaqoiXBq3CZkSithknQMT7l",
"username": null,
"full_name": "Parker Lamoreaux",
"is_verified": null,
"is_private": null,
"avatar_url": null,
"latest_story_at": null,
"extra": {}
},
"extra": {
"feedback_id": "ZmVlZGJhY2s6cGZiaWQwM2h0YkZrdjhkNW9uR1NaRjhGZlRmNDNONmE3U1A5YVF3cU5WTERlUXU3UTg3RFAyZFdKUVJIMng1bkVoZjJ4Uk42dWVjc2ZmYU5ubVhucGJZRmtVWWh0amlXWkF1b0ZVUzZRbA==",
"parent_comment_id": null,
"expansion_token": "MjoxNzk1MTMxMDA1OgF_6CgICXHFue1mUjR7eVGeRHbUqKo29jQ8cfa1wc0gWXIXcX2UKcU1AAItSmUNel_6Pphqy3tVdvqZtqgY0XIZkFjj3LHAq-gEUz7HbNmgUGw7YKfjJnOIKvjUAVdrZpJfzug_D_thbX4035k4wqpvhWR78sK2lXltuCj_xn8E2gXIi-CbHarEx1oYz0hMgepSVakto7C0zaJFlqnW60fvryqShPWV…"
}
},
{
"id": "4593165040946161",
"text": "If you read the Book of Mormon with real intent (meaning being open to changing your life an converting if it is true), and then pray about it, then the Holy Ghost will testify to you it is true. The proof is in the pudding",
"created_at": "2026-10-12T18:35:09+00:00",
"likes": null,
"replies": null,
"liked_by_owner": null,
"owner": {
"id": "1807722794",
"username": "MelissaRose723",
"full_name": "Melissa Rose Palmer",
"is_verified": null,
"is_private": null,
"avatar_url": null,
"latest_story_at": null,
"extra": {}
},
"extra": {
"feedback_id": "ZmVlZGJhY2s6cGZiaWQwMmRNd2s4MnQ4Qks5M0xvY2Y4VHBrOWZZRUo4NlAydGptZFpQZ01tbzlhQ2FhUFdvOGRkRmtwMnRCVVdVVFNTQXdjV0t2b2MxVEZnbU5vNkVGNmFqOWM0am1NZWtVbm5tY3NSbA==",
"parent_comment_id": null,
"expansion_token": "MjoxNzk1MTMxMDA1OgF_86Si2pl-cF3cL25gvjYNqVNKzZwQED9RKWKz3BNFoIMkVx3KuIHrVcKQTd6Z5Ifw2W-YskZIijJmJTVPSpWJ1XJirAYcK9IZD1-xuHUhyrr17gGixfl9fX0doRm4cEkqZabFvCoeqms1SiPndIF-w4vU8bmyod-1K4Z3YG94KKNMXPJgIQNpuzr_yq6Y5AK5na1ZotWsdyPQkt_75RtcoDEcyfVL…"
}
}
],
"pages": [
{
"cursor": null,
"fetched_at": "2026-11-19T23:30:05.688236+00:00",
"count": 2,
"signed_in": false
}
],
"next_cursor": "eyJhZnRlciI6Ik1Ub3hOemsxTVRNeE1EQTFPZ0ZfdVBsQ2laUE9MN0ZaYWJ2a3dfQi1PZENHVHZJTUJVQ0I0MnV3MTJhbno4SXJNU24xUjBUWTlKOUZRQzVNdFl2NUN6a1VlZFNMdGxBNGZBUGZWMVBoS1JaVThrSzlZVWg3eEtLZi05WW51VVpFSnh0YWdQN1FyeE5ES1I1eHQxYndlRW8zaEMtbWR2WVRzNEs2U0QyLUdG…",
"has_more": true,
"stop_reason": "pages",
"coverage": {
"since": null,
"oldest_at": null,
"since_reached": false
}
},
"meta": {
"source": "live",
"fetched_at": "2026-11-19T23:30:05.688236+00:00",
"cost": "$0.0005",
"balance": "$9.9995",
"request_id": "req_ce091767ee86ba9038d4bd60dc4443b0"
}
}How it works
A post's top-level comments, 10 a page. Send a comment's id as feedback_id, with this post's URL as url, to /v1/facebook/post_comment_replies for its replies. With max_pages=1, returns Page[Comment] under data; with get_raw=true returns the upstream JSON.
The default request creates a durable job (202). Use max_pages=1 for one synchronous Page response (200). Poll status_url, then read results_url with its opaque cursor. Acquisition stops at the first of since, max_pages, or exhaustion. Jobs continue after disconnects. Result responses are bounded to 3 MiB; this does not limit the crawl. Supply Idempotency-Key to recover a lost submission response; reuse it with the same inputs. Facebook sets every page’s size, so there is no page_size.
A field Facebook does not carry is null, a list it does not carry is [], and Facebook-only facts sit under extra. Unknown, unsupported, and repeated query parameters return 400 before acquisition or billing.
Billing: $0.0005 per 10 unique returned items (one native page), rounded up to a minimum of one billing unit; a get_raw=true page bills one unit. Jobs settle once after successful completion. Submission, polling and repeat downloads are free.
Errors
| Status | When |
|---|---|
400 | The request parameters are invalid. |
401 | Missing, malformed, or revoked API key. |
402 | Balance is too low for this request. |
404 | cached=cache_only found nothing saved for these arguments (not_cached; call again with cached=auto to fetch it), or the Facebook account or item does not exist (not_found). You are not charged. |
429 | Over the per-minute limit. The limit belongs to your organization and all its API keys share it: 100 requests per minute unless an increase was granted. Wait for the Retry-After seconds, then retry. On a live read, code rate_limited means the platform itself rate-limited this read; retry after the Retry-After seconds. You are not charged. |
502 | The upstream fetch failed. You are not charged. |
503 | Billing could not be confirmed, so no upstream data was returned. |
504 | The upstream request timed out. You are not charged. |