Comments

The comments on a public Facebook post, video or Reel, with reactions by type, reply counts, authors and the post itself.

Try it in the dashboard 100 free credits when you sign up, no card.

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.

Example request

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"

Example response

A real answer to the request above. Long texts and lists are shortened here, and the people who wrote comments, reviews or posts are replaced by a stand-in.

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

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.

Errors

Every error has the same shape, and none of them is charged. The full list is in the error reference.

Looking for an overview and use cases? See the Facebook Comments API page.