Facebook profile or page API
  1. Docs
  2. Facebook
  3. Facebook profile or page API

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_days to reuse them for free.
  • Timeout: A request still running after about 25 seconds answers 202 with a job to poll (Batch and jobs).

Parameters#

NameTypeRequiredDescription
urlURLyesProfile or page URL. Accepted hosts: facebook.com, fb.com, fb.watch.
get_business_hoursbooleannoInclude the business hours. Default false.
include_gated_profilebooleannoReturn limited public fields for gated or age-restricted pages. Ignored for normal public pages. Default false.

Every request also accepts:

  • trim: true for a smaller response without null fields and extra.
  • raw: true to also get the platform's original object as raw.
  • 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"

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.

200 OKSample response
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.

CodeHTTPRetryMeaning
invalid_params400noA parameter is missing, unknown or has the wrong type.
unsupported_url400noThe URL is not one this endpoint accepts (wrong platform or form).
not_found404noThe 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}