Facebook data API

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
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"

Response

200 OK · application/json
{
  "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

NameInDescription
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

FieldTypeDescription
target_id / total_commentsstring | null / integer | nullPost or photo id and total comment count.
count / items[]integer / object[]Returned count and list of comment objects.
items[].text / created_atstring | null / integer | nullComment text and Unix timestamp.
items[].like_count / reply_countinteger / integer | nullReaction count and reply count.
items[].authorobjectid, name, url, avatar_url and is_verified.
pageobjecthas_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.