Facebook profile or page API
A public page: category, address, email, phone, website, services, price range, rating, likes and followers (`talking_about` only when Facebook shows it...
GET /v1/facebook/profile
GET /v1/facebook/profile
A public page: category, address, email, phone, website, services, price range, rating, likes and followers (talking_about only when Facebook shows it), plus its ad library page id.
- 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 | yes | Profile or page URL. Accepted hosts: facebook.com, fb.com, fb.watch. |
get_business_hours | boolean | no | Include the business hours. Default false. |
include_gated_profile | boolean | no | Return limited public fields for gated or age-restricted pages. Ignored for normal public pages. Default false. |
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/profile" \2 -H "x-api-key: $SOCIALSCRAPE_API_KEY" \3 --data-urlencode "url=https://www.facebook.com/NASA"1import os2import requests34params = {5 "url": "https://www.facebook.com/NASA",6}7res = requests.get(8 "https://api.socialscrape.dev/v1/facebook/profile",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/profile");2url.search = new URLSearchParams({3 "url": "https://www.facebook.com/NASA"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 profile or page",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/profile",14 "sendQuery": true,15 "queryParameters": {16 "parameters": [17 {18 "name": "url",19 "value": "https://www.facebook.com/NASA"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, email addresses are replaced with [email protected]. 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_96e1a94c3792db5d49fe07e4",8 "data": {9 "object": "profile",10 "platform": "facebook",11 "id": "100044561550831",12 "handle": "NASA",13 "name": "NASA - National Aeronautics and Space Administration",14 "headline": null,15 "url": "https://www.facebook.com/NASA/",16 "kind": "page",17 "bio": "Explore the universe and discover our home planet. \nThere's space for everybody. ✨",18 "avatar_url": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=GEGINR_lrOcQ7kNvwER4pDX&_nc_oc=AdoJqcuHbHfkO0em4pYWtbrMi...",19 "banner_url": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_tt6&cstp=mx2047x1487&ctp=s960x960&_nc_cat=110&ccb=1-7&_nc_sid=cc71e4&_nc_ohc=BZLpCB1R98AQ7kNvwHIqIfu&_nc_oc=AdrLsktq03jpDQsY...",20 "verified": true,21 "is_private": false,22 "external_url": "https://www.nasa.gov/nasa-app/",23 "links": [24 {25 "title": "nasa.gov/nasa-app",26 "url": "https://www.nasa.gov/nasa-app/"27 }28 ],29 "location": null,30 "category": "Government organization",31 "created_at": null,32 "stats": {33 "followers": 28736402,34 "following": 52,35 "posts": null,36 "likes": null,37 "views": null38 },39 "extra": {40 "alternate_name": "",41 "avatar_sizes": {42 "profilePicLarge": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s200x200&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=GEGINR_lrOcQ7kNvwER4pDX&_nc_oc=AdoJqcuHbHfkO0em4pYWtbrMi...",43 "profilePicMedium": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s148x148&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=GEGINR_lrOcQ7kNvwER4pDX&_nc_oc=AdoJqcuHbHfkO0em4pYWtbrMi...",44 "profilePicSmall": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.30808-1/243095782_416661036495945_3843362260429099279_n.png?stp=dst-png&cstp=mx800x800&ctp=s100x100&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=GEGINR_lrOcQ7kNvwER4pDX&_nc_oc=AdoJqcuHbHfkO0em4pYWtbrMi..."45 },46 "cover_photo": {47 "id": "1629624498532920",48 "image_url": "https://scontent-lga3-1.xx.fbcdn.net/v/t39.99422-6/809146614_4484013928506139_3181913787670602881_n.png?stp=dst-jpg_tt6&cstp=mx2047x1487&ctp=s960x960&_nc_cat=110&ccb=1-7&_nc_sid=cc71e4&_nc_ohc=BZLpCB1R98AQ7kNvwHIqIfu&_nc_oc=AdrLsktq03jpDQsY...",49 "url": "https://www.facebook.com/photo/?fbid=1629624498532920&set=a.416660999829282"50 },51 "email": "[email protected]",52 "gender": "NEUTER",53 "intro": [54 {55 "text": "Page · Government organization",56 "type": "INFLUENCER_CATEGORY",57 "url": null58 },59 {60 "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION",61 "type": "CONFIRMED_OWNER_LABEL",62 "url": null63 },64 {65 "text": "[email protected]",66 "type": "PROFILE_EMAIL",67 "url": null68 }69 ],70 "page_id": "54971236771",71 "profile_photo": {72 "id": "423033359192046",73 "image_url": null,74 "url": "https://www.facebook.com/photo/?fbid=423033359192046&set=a.416661003162615"75 },76 "source": "logged_out_public_view",77 "talking_about": 64410,78 "website": "https://www.nasa.gov/nasa-app/"79 }80 },81 "cursor": null,82 "has_more": null83}Response#
A Profile 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_9f6c6eb03d8b1c919112a8f6"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 posts (
GET /v1/facebook/profile/posts)