Facebook public group API
What a public group's About page shows: description, privacy, member and activity counts, categories, admins and moderators where shown, history and rules.
GET /v1/facebook/group
GET /v1/facebook/group
What a public group's About page shows: description, privacy, member and activity counts, categories, admins and moderators where shown, history and rules.
- Cost: 1 credit
- Cache: Results are kept up to 30 days; send
max_age_daysto reuse them for free. - Timeout: A request still running after about 25 seconds answers
202with a job to poll (Batch and jobs).
Parameters#
| Name | Type | Required | Description |
|---|---|---|---|
url | URL | one of | Public group URL (facebook.com/groups/...). Sub-pages such as /about work too. Accepted hosts: facebook.com, fb.com, fb.watch. |
id | string | one of | Numeric group id; use it instead of url if you have it. Also accepted as group_id. |
Send at least one of url, id. If you send several, the first listed is used and the rest are ignored.
Every request also accepts:
trim:truefor a smaller response withoutnullfields andextra.raw:trueto also get the platform's original object asraw.max_age_days: accept a cached result up to this many days old, for 0 credits (Caching).
Example request#
Set your key in the environment first (see Authentication).
1curl -G "https://api.socialscrape.dev/v1/facebook/group" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode "url=https://www.facebook.com/groups/366190054572553"1import os2import requests34params = {5 "url": "https://www.facebook.com/groups/366190054572553",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/facebook/group",9 headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},10 params=params,11)12body = res.json()1314if body["ok"]:15 print(body["data"])16else:17 print(body["error"]["code"], body["error"]["message"])1const url = new URL("https://api.socialscrape.dev/v1/facebook/group");2url.search = new URLSearchParams({3 "url": "https://www.facebook.com/groups/366190054572553"4}).toString();5const res = await fetch(url, {6 headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },7});8const body = await res.json();910if (body.ok) {11 console.log(body.data);12} else {13 console.error(body.error.code, body.error.message);14}1{2 "nodes": [3 {4 "name": "SocialScrape Facebook public group",5 "type": "n8n-nodes-base.httpRequest",6 "typeVersion": 4.2,7 "position": [8 0,9 010 ],11 "parameters": {12 "method": "GET",13 "url": "https://api.socialscrape.dev/v1/facebook/group",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "url",19 "value": "https://www.facebook.com/groups/366190054572553"20 }21 ]22 },23 "sendHeaders": true,24 "headerParameters": {25 "parameters": [26 {27 "name": "x-api-key",28 "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"29 }30 ]31 }32 }33 }34 ],35 "connections": {}36}Example response#
This is a sample from a recorded response, lists and long text are shortened. Status 200.
1{2 "ok": true,3 "credits_charged": 1,4 "credits_remaining": 4999,5 "cached": false,6 "cached_at": null,7 "request_id": "req_d05ae521cb97f1a25d8a6524",8 "data": {9 "object": "community",10 "platform": "facebook",11 "id": "366190054572553",12 "url": "https://www.facebook.com/groups/366190054572553/",13 "kind": "group",14 "name": "Python Programming",15 "title": "Python Programming",16 "description": "Let's share our knowledge on Python Programming",17 "avatar_url": "https://scontent-iad6-1.xx.fbcdn.net/v/t1.6435-9/121615771_3201454343306997_2348901429098757975_n.jpg?stp=dst-jpg_tt6&cstp=mx640x400&ctp=s640x400&_nc_cat=106&ccb=1-7&_nc_sid=0b1479&_nc_ohc=9R2J2mQK5_IQ7kNvwExFf3R&_nc_oc=AdpL45oYudx3vIAv4FGP...",18 "banner_url": null,19 "member_count": 759600,20 "online_count": null,21 "is_nsfw": null,22 "is_private": false,23 "verified": null,24 "created_at": "2020-10-14T11:05:03Z",25 "extra": {26 "activity": {27 "new_members_text": "No new members in the last week",28 "posts_last_day": 28,29 "posts_last_month": 154230 },31 "administrator_count": 3,32 "administrators": [33 {34 "id": "pfbid029gmqPLAMDT2z4drrFEsicJ4ivhnAGkEPBNUPTujKbSYf6bMCjTzRKrNNPmePAotrl",35 "name": "Nusrat Jahan",36 "profile_picture_url": "https://scontent-iad6-1.xx.fbcdn.net/v/t39.30808-1/297738489_149183324449711_6655284279259187616_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx720x730&ctp=s32x32&_nc_cat=106&ccb=1-7&_nc_sid=e99d92&_nc_ohc=StSE7y8rWMoQ7kNvwEoD8he&_nc_oc=AdpS-Chxb4rdvjLGu...",37 "url": null38 },39 {40 "id": "100079525026696",41 "name": "Thesoftwarelion",42 "profile_picture_url": "https://scontent-iad3-1.xx.fbcdn.net/v/t39.30808-1/242977119_109642788145497_5023972278328162431_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx1200x1200&ctp=s32x32&_nc_cat=110&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=WU3iox6us6AQ7kNvwESFVMs&_nc_oc=AdoiGWO0_3CoovY...",43 "url": null44 },45 {46 "id": "pfbid0pzs33rRB9YA54hRjvjaPeA62UVZTg73Aqbnn8jSjS9Mo1DUAZNyzV6wFUgYgnDwhl",47 "name": "Jamil Ahmed",48 "profile_picture_url": "https://scontent-iad3-1.xx.fbcdn.net/v/t39.30808-1/795255518_27959759933716428_4332290339331851799_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx1568x1556&ctp=s32x32&_nc_cat=110&ccb=1-7&_nc_sid=e99d92&_nc_ohc=Ww9uIb4rQ_4Q7kNvwGs27eR&_nc_oc=AdqeeaGUdr957...",49 "url": null50 }51 ],52 "categories": [53 {54 "id": "242504017103922",55 "name": "Software & tech"56 },57 {58 "id": "202183377053878",59 "name": "Engineering"60 }61 ],62 "history_summary": "Group created on October 14, 2020. Name last changed on October 16, 2020.",63 "member_count_text": "759.6K members",64 "moderator_count": 0,65 "privacy": {66 "description": "Anyone can see who's in the group and what they post.",67 "label": "Public"68 },69 "rules": [70 {71 "description": "We're all in this together to create a welcoming environment. Let's treat everyone with respect. Healthy debates are natural, but kindness is required.",72 "id": "366191957905696",73 "title": "Be Kind and Courteous"74 },75 {76 "description": "Make sure everyone feels safe. Bullying of any kind isn't allowed, and degrading comments about things like race, religion, culture, sexual orientation, gender or identity will not be tolerated.",77 "id": "366191961239029",78 "title": "No Hate Speech or Bullying"79 },80 {81 "description": "Give more than you take to this group. Self-promotion, spam and irrelevant links aren't allowed.",82 "id": "366191964572362",83 "title": "No Promotions or Spam"84 }85 ],86 "source": "logged_out_public_view",87 "visibility": {88 "description": "Anyone can find this group.",89 "label": "Visible"90 }91 }92 },93 "cursor": null,94 "has_more": null95}Response#
A Community object in data.
See Data models for every field. The envelope around data is described in Responses.
Errors#
Failures are free: credits_charged is 0. Branch on error.code, never on the message.
| Code | HTTP | Retry | Meaning |
|---|---|---|---|
invalid_params | 400 | no | A parameter is missing, unknown or has the wrong type. |
unsupported_url | 400 | no | The URL is not one this endpoint accepts (wrong platform or form). |
not_found | 404 | no | The platform says this profile, post or item does not exist. |
Every request can also fail with the account and platform errors listed on the Errors page.
Example error:
1{2 "ok": false,3 "error": {4 "code": "not_found",5 "message": "The platform says this profile, post or item does not exist.",6 "retryable": false7 },8 "credits_charged": 0,9 "request_id": "req_2b5cb3db205b553513cb6f03"10}Related endpoints#
- Facebook Ad Library search (
GET /v1/facebook/ad-library/search) - Facebook Ad Library search (POST body) (
POST /v1/facebook/ad-library/search) - Facebook Ad Library ads by page (
GET /v1/facebook/ad-library/company/ads) - Facebook Ad Library ads by page (POST body) (
POST /v1/facebook/ad-library/company/ads) - Facebook Ad Library ad details (
GET /v1/facebook/ad-library/ad) - Facebook Ad Library ad transcript (
GET /v1/facebook/ad-library/ad/transcript) - Facebook Ad Library advertiser search (
GET /v1/facebook/ad-library/search/companies) - Facebook profile or page (
GET /v1/facebook/profile)