Facebook Comments API and Comment Scraper
Send the link of a public Facebook post or photo and get its comments as structured JSON: text, timestamp, reaction count, reply count, author details and pagination cursors.
Request
GET /v1/facebook/comments ·
2 credits per successful call
curl "https://api.igramapi.com/v1/facebook/comments?url=https%3A%2F%2Fwww.facebook.com%2Fexamplestudio%2Fposts%2Fpfbid02ExampleToken&limit=20" \
-H "Authorization: Bearer YOUR_API_KEY" import requests
response = requests.get(
"https://api.igramapi.com/v1/facebook/comments?url=https%3A%2F%2Fwww.facebook.com%2Fexamplestudio%2Fposts%2Fpfbid02ExampleToken&limit=20",
headers={"Authorization": "Bearer YOUR_API_KEY"},
timeout=30,
)
response.raise_for_status()
print(response.json()) const response = await fetch("https://api.igramapi.com/v1/facebook/comments?url=https%3A%2F%2Fwww.facebook.com%2Fexamplestudio%2Fposts%2Fpfbid02ExampleToken&limit=20", {
method: "GET",
headers: {
Authorization: "Bearer YOUR_API_KEY",
},
});
if (!response.ok) throw new Error((await response.json()).error.message);
console.log(await response.json()); <?php
$ch = curl_init("https://api.igramapi.com/v1/facebook/comments?url=https%3A%2F%2Fwww.facebook.com%2Fexamplestudio%2Fposts%2Fpfbid02ExampleToken&limit=20");
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer YOUR_API_KEY",
],
]);
$data = json_decode(curl_exec($ch), true);
print_r($data); Response
{
"target_id": "3456789012345678",
"total_comments": 40,
"count": 1,
"items": [
{
"id": "Y29tbWVudDox",
"text": "Looking forward to Saturday!",
"created_at": 1761705000,
"like_count": 14,
"reply_count": 2,
"author": {
"id": "1000999888777",
"name": "Alex Rivera",
"url": "https://www.facebook.com/alex.rivera",
"avatar_url": "https://scontent.xx.fbcdn.net/v/example/alex.jpg",
"is_verified": false
},
"attachment_url": null
}
],
"page": {
"has_next_page": true,
"end_cursor": "eyJrIjoiZmJfY29tbWVudHMifQ"
},
"cached": false
} All values above are made-up examples. Media links are temporary Facebook CDN addresses.
Parameters
| Name | In | Description |
|---|---|---|
urlrequired | query | A public Facebook post, permalink, or photo URL. |
limit | query | Maximum comments per page, 1 to 50 (default 20). |
cursor | query | page.end_cursor from the previous response. |
Response fields
| Field | Type | Description |
|---|---|---|
target_id / total_comments | string | null / integer | null | Post or photo id and total comment count. |
count / items[] | integer / object[] | Returned count and list of comment objects. |
items[].text / created_at | string | null / integer | null | Comment text and Unix timestamp. |
items[].like_count / reply_count | integer / integer | null | Reaction count and reply count. |
items[].author | object | id, name, url, avatar_url and is_verified. |
page | object | has_next_page and end_cursor for pagination. |
Paginated comment threads
Fetch up to 50 comments per page and continue with page.end_cursor.
Reactions and reply counts
Every comment includes like_count, reply_count and created_at.
Author identity included
Returns each commenter's id, name, url, avatar_url and is_verified.
Every plan
Costs 2 credits per page on every plan.
Reading comments on public posts
Pass any public post URL, permalink.php, photo.php or /share/p/ link. The first call returns the top comments and total_comments, and subsequent pages load via cursor.
Frequently asked questions
Is this a Facebook comment scraper?
It returns what a Facebook comment scraper collects (comment text, timestamps, reactions, reply counts and authors for a public post or photo) as JSON with a cursor, so you do not run or maintain a scraper yourself.
Which plans include Facebook Comments?
Every plan, including Free. Each page costs 2 credits.
Can I paginate through hundreds of comments?
Yes. Pass page.end_cursor as cursor on the next call until has_next_page is false.
Our errors cost nothing. Failures on our side (status 500 or above) and invalid requests (400, 422) are refunded, and every error has the same shape. See error handling and credits and rate limits.
Try the Facebook Comments API free
Create a key and make your first request in minutes. 100 free credits every month.