Get Group & Group Posts
curl --request GET \
--url https://scrapebadger.com/v1/facebook/groups/{group_id} \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/facebook/groups/{group_id}"
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/groups/{group_id}', 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/groups/{group_id}",
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/groups/{group_id}"
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/groups/{group_id}")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/facebook/groups/{group_id}")
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{
"id": "<string>",
"name": "<string>",
"url": "<string>",
"privacy": "<string>",
"visibility": "<string>",
"member_count": 123,
"description": "<string>",
"cover_photo": "<string>",
"creation_time_utc": 123,
"created_at": "<string>",
"posts": [
{}
],
"count": 123,
"end_cursor": "<string>",
"has_next_page": true
}Endpoints
Get Group & Group Posts
Facebook Group metadata — privacy, member count, description, creation date — plus the group feed.
GET
/
v1
/
facebook
/
groups
/
{group_id}
Get Group & Group Posts
curl --request GET \
--url https://scrapebadger.com/v1/facebook/groups/{group_id} \
--header 'X-API-Key: <x-api-key>'import requests
url = "https://scrapebadger.com/v1/facebook/groups/{group_id}"
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/groups/{group_id}', 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/groups/{group_id}",
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/groups/{group_id}"
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/groups/{group_id}")
.header("X-API-Key", "<x-api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://scrapebadger.com/v1/facebook/groups/{group_id}")
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{
"id": "<string>",
"name": "<string>",
"url": "<string>",
"privacy": "<string>",
"visibility": "<string>",
"member_count": 123,
"description": "<string>",
"cover_photo": "<string>",
"creation_time_utc": 123,
"created_at": "<string>",
"posts": [
{}
],
"count": 123,
"end_cursor": "<string>",
"has_next_page": true
}Fetch a Facebook Group’s metadata, and its feed from the companion endpoint.
Credits: 5 (each)
Response —
Returns a single
Response —
| Endpoint | Returns |
|---|---|
GET /v1/facebook/groups/{group_id} | Group metadata |
GET /v1/facebook/groups/{group_id}/posts | the group feed (Post[]) |
Authorization
string
required
Your ScrapeBadger API key.
Path Parameters
string
required
Numeric group id or the group’s vanity slug — the
facebook.com/groups/<group_id> segment.Query Parameters
string
/posts only. Pagination cursor — the end_cursor from a previous response.Response — /groups/{group_id}
Returns a single Group object.
string
Numeric group id.
string
Group name.
string
Canonical
facebook.com/groups/ URL.string
Facebook’s privacy setting — typically
Public or Private.string
Whether the group is listed in search (
visible) or hidden.integer
Number of members.
string
Group intro / rules text.
string
Cover image URL.
number
Group creation time, Unix seconds.
string
Group creation time, ISO 8601 UTC.
Response — /groups/{group_id}/posts
Post[]
Full
Post objects — id, post_id, url, permalink_url, message,
creation_time_utc, created_at, author (Actor), attachments[]
(Media), reaction_count, reaction_count_text, top_reactions[],
comment_count, share_count, story_type. See
Get Page or Profile Posts
for the field-by-field breakdown.integer
Number of posts in this page.
string
Pass as
after for the next page.boolean
Whether more posts are reachable.
A private group returns metadata but an empty
posts[] — Facebook serves
no feed units to a non-member session. Check privacy before treating an
empty feed as an error.Example
curl "https://scrapebadger.com/v1/facebook/groups/1503289913" \
-H "X-API-Key: YOUR_API_KEY"
const res = await fetch(
"https://scrapebadger.com/v1/facebook/groups/1503289913",
{ headers: { "X-API-Key": process.env.SCRAPEBADGER_API_KEY } },
);
const group = await res.json();
import requests
res = requests.get(
"https://scrapebadger.com/v1/facebook/groups/1503289913",
headers={"X-API-Key": "YOUR_API_KEY"},
)
group = res.json()
Response
{
"id": "1503289913",
"name": "Brooklyn Buy Nothing",
"url": "https://www.facebook.com/groups/1503289913",
"privacy": "Public",
"visibility": "visible",
"member_count": 42817,
"description": "Give and receive freely with your Brooklyn neighbours. No selling, no trading, no cash.",
"cover_photo": "https://scontent.xx.fbcdn.net/v/t39.30808-6/771204_n.jpg",
"creation_time_utc": 1476403200.0,
"created_at": "2016-10-14T00:00:00Z"
}
Discover groups with
/search/groups — it returns
SearchResult objects with type: "group"; take the id here for full
metadata.
