Docs menu

Facebook profile or page

Beta 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
  • Status: Beta. Built and tested against recorded responses; the shape may still gain fields.
  • 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).

curl
curl -G "https://api.socialscrape.io/v1/facebook/profile" \
  -H "x-api-key: $SOCIALSCRAPE_API_KEY" \
  --data-urlencode "url=https://www.facebook.com/NASA"
Python
import os
import requests

params = {
    "url": "https://www.facebook.com/NASA",
}
res = requests.get(
    "https://api.socialscrape.io/v1/facebook/profile",
    headers={"x-api-key": os.environ["SOCIALSCRAPE_API_KEY"]},
    params=params,
)
body = res.json()

if body["ok"]:
    print(body["data"])
else:
    print(body["error"]["code"], body["error"]["message"])
TypeScript
const url = new URL("https://api.socialscrape.io/v1/facebook/profile");
url.search = new URLSearchParams({
  "url": "https://www.facebook.com/NASA"
}).toString();
const res = await fetch(url, {
  headers: { "x-api-key": process.env.SOCIALSCRAPE_API_KEY! },
});
const body = await res.json();

if (body.ok) {
  console.log(body.data);
} else {
  console.error(body.error.code, body.error.message);
}
n8n
{
  "nodes": [
    {
      "name": "SocialScrape Facebook profile or page",
      "type": "n8n-nodes-base.httpRequest",
      "typeVersion": 4.2,
      "position": [
        0,
        0
      ],
      "parameters": {
        "method": "GET",
        "url": "https://api.socialscrape.io/v1/facebook/profile",
        "sendQuery": true,
        "queryParameters": {
          "parameters": [
            {
              "name": "url",
              "value": "https://www.facebook.com/NASA"
            }
          ]
        },
        "sendHeaders": true,
        "headerParameters": {
          "parameters": [
            {
              "name": "x-api-key",
              "value": "={{ $env.SOCIALSCRAPE_API_KEY }}"
            }
          ]
        }
      }
    }
  ],
  "connections": {}
}

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.

{
  "ok": true,
  "credits_charged": 1,
  "credits_remaining": 4999,
  "cached": false,
  "cached_at": null,
  "request_id": "req_96e1a94c3792db5d49fe07e4",
  "data": {
    "object": "profile",
    "platform": "facebook",
    "id": "100044561550831",
    "handle": "NASA",
    "name": "NASA - National Aeronautics and Space Administration",
    "headline": null,
    "url": "https://www.facebook.com/NASA/",
    "kind": "page",
    "bio": "Explore the universe and discover our home planet. \nThere's space for everybody. ✨",
    "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...",
    "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...",
    "verified": true,
    "is_private": false,
    "external_url": "https://www.nasa.gov/nasa-app/",
    "links": [
      {
        "title": "nasa.gov/nasa-app",
        "url": "https://www.nasa.gov/nasa-app/"
      }
    ],
    "location": null,
    "category": "Government organization",
    "created_at": null,
    "stats": {
      "followers": 28736402,
      "following": 52,
      "posts": null,
      "likes": null,
      "views": null
    },
    "extra": {
      "alternate_name": "",
      "avatar_sizes": {
        "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...",
        "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...",
        "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..."
      },
      "cover_photo": {
        "id": "1629624498532920",
        "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...",
        "url": "https://www.facebook.com/photo/?fbid=1629624498532920&set=a.416660999829282"
      },
      "email": "[email protected]",
      "gender": "NEUTER",
      "intro": [
        {
          "text": "Page · Government organization",
          "type": "INFLUENCER_CATEGORY",
          "url": null
        },
        {
          "text": "NATIONAL AERONAUTICS AND SPACE ADMINISTRATION",
          "type": "CONFIRMED_OWNER_LABEL",
          "url": null
        },
        {
          "text": "[email protected]",
          "type": "PROFILE_EMAIL",
          "url": null
        }
      ],
      "page_id": "54971236771",
      "profile_photo": {
        "id": "423033359192046",
        "image_url": null,
        "url": "https://www.facebook.com/photo/?fbid=423033359192046&set=a.416661003162615"
      },
      "source": "logged_out_public_view",
      "talking_about": 64410,
      "website": "https://www.nasa.gov/nasa-app/"
    }
  },
  "cursor": null,
  "has_more": null
}

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:

{
  "ok": false,
  "error": {
    "code": "not_found",
    "message": "The platform says this profile, post or item does not exist.",
    "retryable": false
  },
  "credits_charged": 0,
  "request_id": "req_9f6c6eb03d8b1c919112a8f6"
}