Facebook Scraper API
Extract entry point for the platform as structured JSON from public Facebook targets. Queue a request, then retrieve the result with its responseId.
Decide before you build
- Endpoint
- POST /scrape/data-scraper
- Scrapers
- facebookProfile facebookPost
- Cost
- 30 credits / call
- Free plan
- 500 credits / month
- Call pattern
- async, POST then GET
- On failure
- credits refunded
- Response format
- JSON
- Concurrency
- by plan tier
Launching a Social Media scrape costs 30 credits. Retrieving a pending result costs nothing; failed scrapes are refunded.
Try the Facebook scraper on your own targetRun a request against a public target and inspect the JSON before you integrate.
Open the live testWhat you get back
facebookProfileProfile
Use facebookProfile to retrieve profile data from a public Facebook target.
- Required input: url
- Optional input: load_more_items_count
- Structured JSON once the result is ready
- Public data only; no account login is used
facebookPostSingle post
Use facebookPost to retrieve single post data from a public Facebook target.
- Required input: url
- No optional input parameters
- Structured JSON once the result is ready
- Public data only; no account login is used
Call the Facebook scraper
Send the scraper name with the input required by that scraper. The POST returns a responseId to poll for the final JSON.
# POST - queue a public social media scrape
curl -X POST "https://api.scraping-bot.io/scrape/data-scraper" \
-u "yourUsername:yourApiKey" \
-H "Content-Type: application/json" \
-d '{
"scraper": "facebookProfile",
"url": "https://example.com/public-page",
"load_more_items_count": 10
}'# GET - retrieve the result after the POST returns a responseId
curl -G "https://api.scraping-bot.io/scrape/data-scraper-response" \
-u "yourUsername:yourApiKey" \
--data-urlencode "responseId=RESPONSE_ID" \
--data-urlencode "scraper=facebookProfile"Code example
Authenticate with your ScrapingBot username and API key, then poll until the queued result is ready.
const auth = "Basic " + Buffer.from(
"yourUsername:yourApiKey",
).toString("base64");
const queued = await fetch("https://api.scraping-bot.io/scrape/data-scraper", {
method: "POST",
headers: { "Content-Type": "application/json", Authorization: auth },
body: JSON.stringify({
"scraper": "facebookProfile",
"url": "https://example.com/public-page",
"load_more_items_count": 10
}),
});
const { responseId } = await queued.json();
let result;
do {
await new Promise((resolve) => setTimeout(resolve, 5000));
result = await fetch(
"https://api.scraping-bot.io/scrape/data-scraper-response?" +
new URLSearchParams({ responseId, scraper: "facebookProfile" }),
{ headers: { Authorization: auth } },
).then((response) => response.json());
} while (result.status === "pending");Run this call in two minutesCreate an account, copy your API key, then use the example above.
Get your API keyRequest parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
scraper | string | — | One of the scraper names supported by this endpoint. |
url | string | — | Public page URL, including https://. |
load_more_items_count | int | 10 | Optional for this scraper. |
Response example
Example of the JSON returned by the Facebook scraper once the result is ready.
[
{
"url": "https://www.facebook.com/EsteeLauder/posts/pfbid0283Rv7oepf8oP7pHu1ouFQSmFRsRZyytBbVU2uCK9LHUkbRQWHYfYzrdyfAVmZMy5l",
"post_id": "819548446209067",
"user_url": "https://www.facebook.com/EsteeLauder",
"user_username_raw": "Estee Lauder",
"content": "Say goodbye to the visible effects of blue light and free radicals with AdvancedNightRepair Eye Supercharged Gel-Creme. \n\nWith 8-hour anti-oxidant power, our eye cream provides protection against free-radical damage all day.\n\nShop now: https://estee.cm/3OhvmjT",
"date_posted": "2023-08-03T14:00:42.000Z",
"hashtags": [],
"num_comments": 60,
"num_shares": 42,
"num_likes_type": [
{
"type": "Like",
"num": 2666
},
{
"type": "Love",
"num": 163
}
],
"profile_id": "100044617560989",
"page_logo": "https://scontent-hou1-1.xx.fbcdn.net/v/t39.30808-1/354573351_797708828393029_2041706579808206465_n.jpg?stp=dst-jpg_tt6&cstp=mx180x180&ctp=s180x180&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=fQDB3yfW4QwQ7kNvwGedP8O&_nc_oc=AdqKb1UJMIleV2gsKqUIoFckIk84_UjNq9zunwxgLurGAiH5rldHUrVWDP…",
"page_likes": null,
"page_followers": 4099999.9999999995,
"page_is_verified": true,
"original_post": {
"hashtags": null,
"attachments": null
},
"attachments": [
{
"id": "819548406209071",
"type": "photo",
"url": "https://scontent-sea5-1.xx.fbcdn.net/v/t39.30808-6/474650943_1140580487439193_652791599637263477_n.jpg?stp=dst-jpg_tt6&cstp=mx2047x2048&ctp=p526x296&_nc_cat=100&ccb=1-7&_nc_sid=127cfc&_nc_ohc=yyFQmjgdED8Q7kNvwGapLHZ&_nc_oc=AdqyHQprHHjv5yvfy_H_jEckyy76R_7c_uOm2lcxmF2ogKz9YV4if4…",
"video_length": null,
"source_type": null,
"attachment_url": null,
"video_url": null,
"thumbnail_url": null
}
],
"post_external_link": null,
"post_external_title": null,
"page_url": "https://www.facebook.com/EsteeLauder",
"header_image": "https://www.facebook.com/photo/?fbid=1576213017209269&set=a.797708765059702",
"avatar_image_url": "https://scontent-sea5-1.xx.fbcdn.net/v/t39.30808-1/354573351_797708828393029_2041706579808206465_n.jpg?stp=cp0_dst-jpg_tt6&cstp=mx180x180&ctp=s40x40&_nc_cat=1&ccb=1-7&_nc_sid=2d3e12&_nc_ohc=fQDB3yfW4QwQ7kNvwFz8bbP&_nc_oc=AdquIU2ZmfCzSEyfMXtfOXJ7ZX3ISlrFAYizEHXcTX3KO_HyE9D3z3Mt…",
"profile_handle": "EsteeLauder",
"has_handshake": null,
"is_sponsored": false,
"sponsor_name": null,
"shortcode": "819548446209067",
"video_view_count": null,
"likes": 2666,
"post_image": "https://scontent-sea5-1.xx.fbcdn.net/v/t39.30808-6/474650943_1140580487439193_652791599637263477_n.jpg?stp=dst-jpg_tt6&cstp=mx2047x2048&ctp=p526x296&_nc_cat=100&ccb=1-7&_nc_sid=127cfc&_nc_ohc=yyFQmjgdED8Q7kNvwGapLHZ&_nc_oc=AdqyHQprHHjv5yvfy_H_jEckyy76R_7c_uOm2lcxmF2ogKz9YV4if4…",
"post_type": "Post",
"user_handle": "EsteeLauder",
"play_count": null,
"video_title": null,
"marketplace_price": null,
"delegate_page_id": "114853097618",
"marketplace_is_sold": null,
"timestamp": "2026-10-15T08:10:03.660Z",
"input": {
"url": "https://www.facebook.com/EsteeLauder/posts/pfbid0283Rv7oepf8oP7pHu1ouFQSmFRsRZyytBbVU2uCK9LHUkbRQWHYfYzrdyfAVmZMy5l"
}
}
]Credits, failures and limits
| Case | Credits | Notes |
|---|---|---|
| Launch a scrape | 30 credits | Consumed when a result is ready. |
| Result not ready | Not consumed | The API returns a pending status; retry after a few seconds. |
| Failed, blocked or timed-out scrape | Refunded | Credits are returned for an unsuccessful request. |
Facebook API or Raw HTML scraper?
| Facebook API | Raw HTML scraper | |
|---|---|---|
| Endpoint | /scrape/data-scraper | /scrape/raw-html |
| Returns | Entry point for the platform JSON | Rendered page HTML |
| Flow | Asynchronous: POST then GET | One synchronous request |
| Starting cost | 30 credits | 1 credit |
| Use it when | You need parsed Facebook data | You need your own extraction logic |
Questions about the Facebook API
- Which Facebook scraper names can I use?
- This page supports facebookProfile and facebookPost. Send the exact name in the scraper field.
- Why does the API return a responseId?
- Social Media requests are asynchronous. The responseId lets you retrieve the result without holding the initial request open.
- What if the result is still pending?
- Wait a few seconds and repeat the GET request. A pending response does not consume credits.
- Does this scraper access private account data?
- No. It is intended for public pages and does not sign in to a social media account to access private data.
Source: ScrapingBot API documentation.
Other social media scrapers
Browse the Social Media category for the complete list of guides. Read Facebook Scraper API: profiles, pages and posts.
Trusted by developers and social media teams.
Customer reviews apply to ScrapingBot's service overall, not specifically to this scraper.
Start scraping Facebook today
500 free credits every month. No card required, cancel anytime.
