Get Post Comments
curl --request GET \
--url https://scrapebadger.com/v1/facebook/posts/{post_id}/comments \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/facebook/posts/{post_id}/comments"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/facebook/posts/{post_id}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/facebook/posts/{post_id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/facebook/posts/{post_id}/comments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/facebook/posts/{post_id}/comments")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/facebook/posts/{post_id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"comments": [
{}
],
"count": 123,
"total_count": 123,
"end_cursor": "<string>",
"has_next_page": true
}Endpoints
Get Post Comments
The comment thread on a Facebook post — author, message, reactions and reply counts, cursor-paginated.
GET
/
v1
/
facebook
/
posts
/
{post_id}
/
comments
Get Post Comments
curl --request GET \
--url https://scrapebadger.com/v1/facebook/posts/{post_id}/comments \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/facebook/posts/{post_id}/comments"
headers = {"X-API-Key": "<x-api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<x-api-key>'}};
fetch('https://scrapebadger.com/v1/facebook/posts/{post_id}/comments', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://scrapebadger.com/v1/facebook/posts/{post_id}/comments",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"X-API-Key: <x-api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://scrapebadger.com/v1/facebook/posts/{post_id}/comments"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("X-API-Key", "<x-api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://scrapebadger.com/v1/facebook/posts/{post_id}/comments")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/facebook/posts/{post_id}/comments")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["X-API-Key"] = '<x-api-key>'
response = http.request(request)
puts response.read_body{
"comments": [
{}
],
"count": 123,
"total_count": 123,
"end_cursor": "<string>",
"has_next_page": true
}Fetch the comment thread on a post. Every page — the first included — replays
Facebook’s own comment-list GraphQL query, which is why this endpoint costs
double. Facebook serves 10 comments per page; follow
end_cursor while
has_next_page is true to walk the whole thread.
Credits: 10
Authorization
string
required
Your ScrapeBadger API key.
Path Parameters
string
required
Post id — numeric or
pfbid. Ignored when url is supplied, but still
required as a path segment (pass any placeholder, e.g. 0).Query Parameters
string
Full post permalink or reel URL. Overrides
post_id.string
Pagination cursor — the
end_cursor from a previous response.string
default:"relevance"
One of
relevance (Facebook’s ranked order), newest (reverse
chronological), or most_relevant (an alias of relevance). The sort applies
from the first page on, so do not mix orders across a single traversal — the
cursors are not interchangeable.Response
Comment[]
Each
Comment includes id, message, author (Actor — id, name,
url, profile_picture, is_verified, typename), creation_time_utc,
created_at, reaction_count and reply_count.integer
Number of comments in this page.
integer
Facebook’s own reported comment total for the post. It can exceed the number
of comments actually reachable through pagination.
string
Pass as
after for the next page.boolean
Whether more comments are reachable.
Example
curl "https://scrapebadger.com/v1/facebook/posts/1094832771620487/comments?sort=newest" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/facebook/posts/1094832771620487/comments?" +
new URLSearchParams({ sort: "newest" }),
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const data = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/facebook/posts/1094832771620487/comments",
headers={"X-API-Key": "YOUR_API_KEY"},
params={"sort": "newest"},
)
data = res.json()
Response
{
"comments": [
{
"id": "Y29tbWVudDoxMDk0ODMyNzcxNjIwNDg3XzQ0MjE5",
"message": "The resolution on this is unreal. What filter set was used?",
"author": {
"id": "100001874420913",
"name": "Priya Raman",
"url": "https://www.facebook.com/profile.php?id=100001874420913",
"profile_picture": "https://scontent.xx.fbcdn.net/v/t1.30497-1/22841_n.jpg",
"is_verified": false,
"typename": "User"
},
"creation_time_utc": 1785399720.0,
"created_at": "2026-07-28T15:02:00Z",
"reaction_count": 412,
"reply_count": 7
},
{
"id": "Y29tbWVudDoxMDk0ODMyNzcxNjIwNDg3XzQ0MjIx",
"message": "Planets forming in real time. What a era to be alive.",
"author": {
"id": "100009338271604",
"name": "Tomás Lindqvist",
"url": "https://www.facebook.com/profile.php?id=100009338271604",
"profile_picture": "https://scontent.xx.fbcdn.net/v/t1.30497-1/91038_n.jpg",
"is_verified": false,
"typename": "User"
},
"creation_time_utc": 1785400380.0,
"created_at": "2026-07-28T15:13:00Z",
"reaction_count": 88,
"reply_count": 0
}
],
"count": 2,
"total_count": 1844,
"end_cursor": "AQHNvbW1lbnRzX2N1cnNvcl8wMDE=",
"has_next_page": true
}
total_count is what Facebook advertises, not what it will serve. Treat
has_next_page: false as the real end of the thread — deep comment
traversal is silently capped.
