Facebook Post Scraper API
Our Facebook post scraper turns a public post permalink into structured JSON: the author Page that posted it, the full caption text, the media image, and the canonical URL. It reads the Open Graph tags a post permalink server-renders before the redirect, so you get the content of a public post from one request.
Getting Facebook Post data is harder than it looks
A Facebook post permalink server-renders its Open Graph caption and media before the JavaScript redirect, but reaction, comment, and share counts load only over authenticated GraphQL, so they are never present in the logged-out HTML. The official Graph API can read post engagement only for Pages you administer, which puts public posts on Pages you do not own out of reach.
Hit the Facebook Post Scraper API with one request
curl "https://api.facebookscraperapi.com/api/v1/facebook/post?url=https://www.facebook.com/NASA/posts/pfbid0abc123&api_key=$API_KEY" import requests
BASE = "https://api.facebookscraperapi.com"
API_KEY = "YOUR_API_KEY"
# Pass a full post permalink URL, or page + post_id.
data = requests.get(
f"{BASE}/api/v1/facebook/post",
params={
"url": "https://www.facebook.com/NASA/posts/pfbid0abc123",
"api_key": API_KEY,
},
timeout=30,
).json()
print("author:", data["author"])
print("caption:", data["caption"])
print("image:", data["image"])
# reactions_count / comments_count / shares_count are null logged-out.
print("source:", data["data_source"]) Parameters
| Parameter | Required | Default | Notes |
|---|---|---|---|
url | optional | - | The full post permalink URL. Handles / |
page | optional | - | The Page vanity or numeric id (the path segment). Use with post_id when you do not have a full URL. |
post_id | optional | - | The post or story id. Required together with page if url is not supplied. |
country | optional | - | Optional two-letter country code to fetch the post as seen from that region. |
api_key | required | - | Your API key, passed as a query parameter. Get one free at signup. |
The Facebook Post Scraper API output schema
{
"id": "pfbid0abc123",
"page": "NASA",
"page_id": "100044561550831",
"post_id": "pfbid0abc123",
"url": "https://www.facebook.com/NASA/posts/pfbid0abc123",
"author": "NASA - National Aeronautics and Space Administration",
"author_url": "https://www.facebook.com/NASA/",
"caption": "A new view of our home planet, captured from the International Space Station.",
"title": "A new view of our home planet, captured from the International Space Station.",
"image": "https://scontent.xx.fbcdn.net/v/t39.30808-6/example_post_media.jpg",
"thumbnail": "https://scontent.xx.fbcdn.net/v/t39.30808-6/example_post_media.jpg",
"reactions_count": null,
"comments_count": null,
"shares_count": null,
"source": "facebook",
"data_source": "opengraph"
} | Field | Type | Description |
|---|---|---|
id | string | The post id, or the canonical URL when no id is resolvable. |
page | string | The author Page vanity or id parsed from the permalink. |
page_id | string | The author Page's numeric id from the app deep-link, when present. |
post_id | string | The post or story id parsed from the permalink. |
url | string | The canonical post permalink. |
author | string | The Page that posted, from og:title or the title tag. |
author_url | string | The author Page URL, derived from the page segment. |
caption | string | The full post text from og:description, or a truncated snippet from the title tag as a fallback. |
image | string | The post media (image or video poster) from og:image. Also returned as thumbnail. |
reactions_count | null | Reaction count. Always null: this loads via authenticated GraphQL and is not present in the logged-out HTML. |
comments_count | null | Comment count. Always null logged-out, for the same reason as reactions_count. |
shares_count | null | Share count. Always null logged-out, for the same reason as reactions_count. |
data_source | string | opengraph when the full og meta resolved, or title-fallback when only the title tag carried data. |
Build with Facebook data
Public post archiving
Content and caption monitoring
Media collection
Author resolution
Link previews
Dataset building
Why teams ship on our Facebook Post Scraper API
We force the request onto a US residential exit and read the caption, author, and media straight from the post's Open Graph block before Facebook's redirect. You pass a permalink and get flat JSON back in about 2.6 seconds. We are upfront that reaction, comment, and share counts are not exposed to logged-out requests, so those fields return null rather than a guessed number.
URL or page plus id input
Full caption and media
Residential routing built in
Honest engagement fields
Login-wall detection
Data-source flag
How the Facebook Post Scraper API compares
| Our API | DIY (requests / headless) | Facebook Graph API | |
|---|---|---|---|
| Read a post on a Page you do not own | Yes, caption and media | Possible but you fight the redirect | No, engagement only for Pages you administer |
| Setup | API key only | Residential proxies, headless browser, parsers | Meta app plus a Page access token |
| Caption and media | Returned from og meta | You parse it yourself | Available for your own Pages |
| Reaction / comment counts | Null, not exposed logged-out | Null unless authenticated | Available for Pages you administer |
| Anti-bot and proxies | Built in, US residential | You build and maintain it | Not applicable |
| Output | Flat, validated JSON | Whatever you parse | Nested JSON you map yourself |
Pricing built for scale
| Plan | Price | Best for |
|---|---|---|
| Free | 1,000 requests | Testing and small jobs |
| Pro | $0.60 / 1k | Production workloads |
| Pay-as-you-go | $0.90 / 1k | Spiky or one-off volume |
Median response 2.6s. You only pay for successful requests.
FAQ
A Facebook post scraper reads a public post's visible data and returns it in a structured format. Our Facebook post scraper API takes a post permalink (or a page plus post_id) and returns the author Page, the full caption, the media image, and the canonical URL as JSON. It reads the Open Graph tags a post permalink server-renders before the redirect.
No, and we are explicit about it. A logged-out post permalink server-renders only the caption and media in its Open Graph block. Reaction, comment, and share counts load afterward over authenticated GraphQL, so they are not present in the HTML a logged-out request receives. The endpoint returns reactions_count, comments_count, and shares_count as null rather than inventing figures. For a Page you administer, the official Graph API exposes those counts.
It returns the author Page name and URL, the author Page numeric id when present, the post and page ids parsed from the permalink, the full caption from og:description, the media image from og:image, and the canonical URL. It also returns a data_source flag showing whether the full Open Graph block resolved or only the title tag carried data.
The url parameter handles the common /
No. You authenticate with a single facebookscraperapi key. The official Graph API needs a Meta app and a Page access token and only returns post data for Pages you administer, so it cannot read a public post on a Page you do not own. Our endpoint reads the public Open Graph data a logged-out visitor sees, with no app review. The free tier includes 1,000 requests.
A logged-out post permalink sometimes redirects to Facebook's generic login or consent wall, whose tags are identical for every URL. We route through US residential proxies to get the real post document, but when only the wall is served we return a clear diagnostic instead of parsing the wall as a post. Retrying, or supplying the canonical /posts/ URL, usually resolves it.