~ / endpoints / Post API

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.

Get a free API keyAll Facebook endpoints
1,000
free requests / mo
2.6s
median response
JSON
structured output
US
residential exit
the friction

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.

start here

Hit the Facebook Post Scraper API with one request

cURL
curl "https://api.facebookscraperapi.com/api/v1/facebook/post?url=https://www.facebook.com/NASA/posts/pfbid0abc123&api_key=$API_KEY"
Python
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"])
options

Parameters

ParameterRequiredDefaultNotes
urloptional-The full post permalink URL. Handles //posts/, /permalink.php?story_fbid=, and /photos and /videos permalinks. Required unless you pass page and post_id.
pageoptional-The Page vanity or numeric id (the path segment). Use with post_id when you do not have a full URL.
post_idoptional-The post or story id. Required together with page if url is not supplied.
countryoptional-Optional two-letter country code to fetch the post as seen from that region.
api_keyrequired-Your API key, passed as a query parameter. Get one free at signup.
the output

The Facebook Post Scraper API output schema

200 OK
{
  "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"
}
FieldTypeDescription
idstringThe post id, or the canonical URL when no id is resolvable.
pagestringThe author Page vanity or id parsed from the permalink.
page_idstringThe author Page's numeric id from the app deep-link, when present.
post_idstringThe post or story id parsed from the permalink.
urlstringThe canonical post permalink.
authorstringThe Page that posted, from og:title or the title tag.
author_urlstringThe author Page URL, derived from the page segment.
captionstringThe full post text from og:description, or a truncated snippet from the title tag as a fallback.
imagestringThe post media (image or video poster) from og:image. Also returned as thumbnail.
reactions_countnullReaction count. Always null: this loads via authenticated GraphQL and is not present in the logged-out HTML.
comments_countnullComment count. Always null logged-out, for the same reason as reactions_count.
shares_countnullShare count. Always null logged-out, for the same reason as reactions_count.
data_sourcestringopengraph when the full og meta resolved, or title-fallback when only the title tag carried data.
real uses

Build with Facebook data

>

Public post archiving

Capture the caption, author, media, and permalink of public posts to keep a dated content archive that outlives the live post.
>

Content and caption monitoring

Watch a public Page's posts by permalink and store the caption text to track messaging and announcements over time.
>

Media collection

Pull the og:image from each post to build a gallery of a Page's public post media alongside its captions.
>

Author resolution

Turn a shared post permalink into the author Page name, id, and URL, so you always know which Page a post came from.
>

Link previews

Generate rich previews of Facebook post links in your own app using the resolved author, caption, and image.
>

Dataset building

Collect public post captions and media as clean JSON for content research, keeping engagement fields honestly null where Facebook hides them.
why it holds up

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

Pass a full permalink, or the page and post_id together. We handle /posts/, permalink.php, photo, and video URL forms.
*

Full caption and media

The caption comes from og:description and the media from og:image, so you get the post's text and image in one call.
*

Residential routing built in

Requests run through US residential proxies, the tier that server-renders a post's og meta before the redirect.
*

Honest engagement fields

Reaction, comment, and share counts load via authenticated GraphQL, so we return them as null logged-out instead of fabricating figures.
*

Login-wall detection

When a permalink redirects to the generic login wall, we return a clear diagnostic rather than parsing the wall as a post.
*

Data-source flag

The data_source field shows whether the full og block resolved or only the title tag carried data, so you can gate on quality.
vs diy

How the Facebook Post Scraper API compares

Our APIDIY (requests / headless)Facebook Graph API
Read a post on a Page you do not ownYes, caption and mediaPossible but you fight the redirectNo, engagement only for Pages you administer
SetupAPI key onlyResidential proxies, headless browser, parsersMeta app plus a Page access token
Caption and mediaReturned from og metaYou parse it yourselfAvailable for your own Pages
Reaction / comment countsNull, not exposed logged-outNull unless authenticatedAvailable for Pages you administer
Anti-bot and proxiesBuilt in, US residentialYou build and maintain itNot applicable
OutputFlat, validated JSONWhatever you parseNested JSON you map yourself
plans & pricing

Pricing built for scale

PlanPriceBest for
Free1,000 requestsTesting and small jobs
Pro$0.60 / 1kProduction workloads
Pay-as-you-go$0.90 / 1kSpiky or one-off volume

Median response 2.6s. You only pay for successful requests.

FAQ

What is a Facebook post scraper?

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.

Does the API return likes, reactions, and comment counts?

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.

What does the post scraper return?

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.

Which post URL formats are supported?

The url parameter handles the common //posts/ form, the /permalink.php?story_fbid=&id= form, and /photos and /videos permalinks with a trailing numeric id. If you do not have a full URL, pass the page vanity or id and the post_id separately and we build the permalink for you.

Do I need a Facebook API key or access token?

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.

Why does a post sometimes fail to return data?

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.

Ship with the Facebook Post Scraper API
Test free with 1,000 requests. No credit card needed.
Get a free API key All Facebook endpoints