~ / 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

Quickstart

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"])

Response

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.

Why it is hard

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.

Use it for

>

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.

How it 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

Pricing

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.

Get post api as JSON
Free plan, 1,000 requests. No credit card required.
Get a free API key All endpoints