Facebook API

Facebook Comments API

Send the link of a public Facebook post, video or Reel and get its comments back as JSON, with reactions by type, reply counts, the authors and the post they belong to.

  • 100 free credits
  • No card needed
  • No scraper to build or maintain
curl "https://pipefetch.com/v1/facebook/comments?post=https%3A%2F%2Fwww.facebook.com%2Fhumansofnewyork%2Fposts%2Fpfbid0BbKbkisExKGSKuhee9a7i86RwRuMKFC8NSkKStB7CsM3uXJuAAfZLrkcJMXxhH4Yl&limit=20" \
  -H "x-api-key: YOUR_API_KEY"
The response

What you get

  • Up to 50 top-level comments per request: most relevant, newest or all
  • The text, time and language of each comment, and a direct link to it
  • Reactions in total and by type: like, love, care, haha, wow, sad and angry
  • The number of replies under each comment
  • The author's public name, id and picture, a profile link when Facebook gives one, and whether it is a person or a Page
  • The post itself: text, author, publish time, and its reaction, comment and share counts
200 OK · application/json
{
  "data": {
    "post": {
      "id": "6375219342552112",
      "url": "https://www.facebook.com/humansofnewyork/posts/pfbid02EsmX9EUwUMq8JyMRGwZ82QtTxTdcPZvtitQTETLhb977v8i7L8jXinVgZ1r6BNFrl",
      "text": "(2/3) “I knew nothing about gardening. But I knew how to google, so I looked up some easy stuff to plant. Turns out it’s hard to mess up herbs. So I w…",
      "publishedAt": "2021-08-15T19:50:37.000Z",
      "reactionCount": 181777,
      "commentCount": 2806,
      "shareCount": 9182,
      "author": {
        "id": "100050429952420",
        "name": "Humans of New York"
      }
    },
    "comments": [
      {
        "id": "0000000000",
        "url": "https://example.com/item",
        "text": "This is one of my favorite stories to date. Good nutrition is at the heart of so many solutions. 💚",
        "createdAt": "2021-08-15T20:01:24.000Z",
        "language": "en",
        "reactionCount": 440,
        "reactions": {
          "like": 366,
          "love": 71,
          "care": 3,
          "haha": 0,
          "wow": 0,
          "sad": 0,
          "angry": 0
        },
        "replyCount": 8,
        "author": {
          "id": "0000000000",
          "name": "Example Person",
          "url": null,
          "pictureUrl": "https://example.com/avatar.jpg",
          "type": "User",
          "isVerified": false
        }
      },
      {
        "id": "0000000000",
        "url": "https://example.com/item",
        "text": "Funny how sometimes we just seem to stumble into something and find it’s exactly what we should be doing. Keep planting the seeds.",
        "createdAt": "2021-08-16T02:08:00.000Z",
        "language": "en",
        "reactionCount": 3,
        "reactions": {
          "like": 2,
          "love": 1,
          "care": 0,
          "haha": 0,
          "wow": 0,
          "sad": 0,
          "angry": 0
        },
        "replyCount": 1,
        "author": {
          "id": "0000000000",
          "name": "Example Person",
          "url": null,
          "pictureUrl": "https://example.com/avatar.jpg",
          "type": "User",
          "isVerified": false
        }
      }
    ]
  },
  "credits": {
    "used": 1,
    "remaining": 99
  }
}
Reference

One GET request

Everything the endpoint accepts. The full reference, with the complete example response, is in the docs.

GET/v1/facebook/comments

Costs 1 credit per 20 items requested. Only requests that return data are charged.

Parameters

NameTypeDescription
postrequired string The URL of a public Facebook post, video or Reel. It has to be the post's own address, not a share link (facebook.com/share/... or fb.watch). Page and group posts, permalink.php, watch, Reel and photo links all work.
limitoptional integer How many comments to return. Every started 20 comments cost 1 credit. Default: 20. From 1 to 50.
sortoptional string The orders of Facebook's own comment menu: relevant (most relevant first, likely spam filtered out), newest (latest first) or all (every comment). One of: relevant, newest, all. Default: relevant.

Good to know

  • Top-level comments only; replyCount tells you how many replies each one has.
  • Reaction counts are exact, in total and by type: like, love, care, haha, wow, sad and angry.
  • post.commentCount is Facebook's own count, replies included. It can be higher than the number of comments Facebook shows to a visitor who is not logged in.
  • Only public posts can be read. A post that does not exist, or that is private or limited to a closed group, answers 404 post_not_found and costs nothing.
  • A post on which Facebook shows no comments answers 404 no_comments and costs nothing.

Open the reference

Use cases

What people build with it

  • Sentiment analysis

    Measure how people react to a post, a launch or an announcement, from their words and from the reaction types.

  • Campaign reporting

    Collect the comments under your own or a competitor's posts and compare how each one was received.

  • Community monitoring

    Read the newest comments on the posts you care about and catch questions and complaints early.

  • Audience research

    Find the questions and objections people raise under posts in your market.

Pricing

Buy credits once. Use them whenever.

This endpoint costs 1 credit per 20 items requested, and a request that returns no data costs nothing. Move the slider to see what your volume costs.

5,000credits a month
5005,00050,000250,000
5,000requests at 1 credit
2,500requests at 2 credits

Each endpoint says what a request costs. Requests that return nothing are free.

Best fit
Builder pack
12,000 credits, one-time payment
$29once
  • $2.42 per 1,000 credits
  • About $12.08 a month at this pace
  • Lasts about 2.4 months at this pace
  • Credits never expire
Start with 100 free credits

See all packs and what a credit buys

FAQ

Questions and answers

Is this the official Facebook API?

No. Pipefetch is an independent service and is not affiliated with Facebook or Meta. It returns the comments a public post shows to a visitor who is not logged in.

Do I need a Facebook account, a token or an app review?

No. You need one Pipefetch API key. There is no Facebook login, no cookie, no access token and no Meta app.

Which links can I pass?

The post's own address: the link of a post on a Page, on a public profile or in a public group, a permalink.php or story.php link, a video, watch or Reel link, or a photo link. Share links (facebook.com/share/... and fb.watch) are not accepted: open the link and copy the address of the post it leads to. A link to a Page itself is not a post either. Both are refused before anything is charged.

Are replies included?

No. You get top-level comments, and replyCount tells you how many replies each one has.

What if a post is private or has no comments?

A post that does not exist, is private or sits in a closed group answers 404 post_not_found. A post on which Facebook shows no comments answers 404 no_comments. Neither is charged.

What does a request cost?

Every started 20 comments cost 1 credit, so 20 comments are 1 credit and 50 comments are 3. Credit packs start at $9 for 3,000 credits and never expire. A request that returns no data is not charged, and new accounts get 100 free credits without a card.

Do comments contain personal data?

Yes. They carry the public names, profile links and pictures of their authors, which is personal data whenever the author is a person and not a Page. If you store or process it, data-protection law such as the GDPR applies to you as it would to any other source, and our terms forbid using the API to harass people or to build profiles of private individuals.

Guides

Step-by-step guides

More

More Facebook APIs

Also on the same key

Other sources

Make your first request in a minute

Sign in, copy your key and call an endpoint. Your account starts with 100 free credits.