Facebook data API
Read pages, posts, comments, groups and ads from Facebook with one key and one response shape.
Read public Facebook data with a plain GET: page profiles and their feeds, post comment trees, reels and photo galleries, group posts and events, the events directory, Marketplace listings, and the Facebook Ad Library. Every endpoint returns the same JSON shape, so a page, a post and an ad all arrive as success, data and credits_used.
Reply threads do not take a comment id. /v1/facebook/post/comment/replies
needs the feedback_id and expansion_token that
/v1/facebook/post/comments returns for that comment. Neither is the
comment's own id, and there is no way to construct them. You have to make the
parent call first.
Your first call
1. Fetch a profile
curl "https://www.socialcrawl.dev/v1/facebook/profile?url=https://www.facebook.com/Meta" \
-H "x-api-key: sc_your_key_here"const url = new URL("https://www.socialcrawl.dev/v1/facebook/profile");
url.searchParams.set("url", "https://www.facebook.com/Meta");
const res = await fetch(url, {
headers: { "x-api-key": process.env.SOCIALCRAWL_API_KEY! },
});
const { data } = await res.json();
console.log(data.author.display_name, data.author.followers);import os
import requests
res = requests.get(
"https://www.socialcrawl.dev/v1/facebook/profile",
headers={"x-api-key": os.environ["SOCIALCRAWL_API_KEY"]},
params={"url": "https://www.facebook.com/Meta"},
)
author = res.json()["data"]["author"]
print(author["display_name"], author["followers"])The response is one author object: the page id, name, bio, follower count, creation date and, under ext, the category, website, rating and the Ad Library page id. Measured on 22/11/2026: this call took about 4 seconds and cost 1 credit.
2. Fetch their content
curl "https://www.socialcrawl.dev/v1/facebook/profile/posts?url=https://www.facebook.com/Meta" \
-H "x-api-key: sc_your_key_here"3. Read computed fields
When an endpoint supports a computed field and the required source inputs are present, the unified response includes that optional field. Depending on the endpoint, optional fields can include engagement_rate, language, content_category, and estimated_reach. See Computed fields for formulas, clamping rules, and null semantics. Where an endpoint supports them, list rows also carry judged labels (computed.labels, computed.relevance) by default at no extra credits; see Labels.
What it covers
| What you want | Call |
|---|---|
| A page's followers, category and website | GET /v1/facebook/profile |
| A page with its recent posts and engagement rates in one call | GET /v1/facebook/profile/full |
| A page's recent posts | GET /v1/facebook/profile/posts |
| One post in full, with the reactions breakdown | GET /v1/facebook/post |
| The comments on a post | GET /v1/facebook/post/comments |
| The replies to one comment | GET /v1/facebook/post/comment/replies |
| What a video post says out loud | GET /v1/facebook/post/transcript |
| A page's photos and reels | GET /v1/facebook/profile/photos, GET /v1/facebook/profile/reels |
| A group, and the posts in it | GET /v1/facebook/group, GET /v1/facebook/group/posts |
| The upcoming events of a public group | GET /v1/facebook/group/events |
| A page's events, a city's events, one event | GET /v1/facebook/profile/events, GET /v1/facebook/events, GET /v1/facebook/event/details |
| Facebook posts, videos, pages, people or groups by keyword | GET /v1/facebook/search/posts, GET /v1/facebook/search/videos, GET /v1/facebook/search/pages, GET /v1/facebook/search/people, GET /v1/facebook/search/groups |
| A hashtag, or the posts that mention a page | GET /v1/facebook/search/hashtag, GET /v1/facebook/search/mentions |
| Marketplace listings near a place | GET /v1/facebook/marketplace/search |
| The ads a page runs, or ads by keyword | GET /v1/facebook/adlibrary/company/ads, GET /v1/facebook/adlibrary/search/ads |
| An advertiser's page profile | GET /v1/facebook/adlibrary/advertiser |
The sections below cover each family, and the roster under All endpoints lists every route with its price.
What it does not cover
- Private profiles, private groups and anything behind a login. Group endpoints read public groups only, and a group whose Events tab needs a login returns an empty list.
- A page's
author.followingandauthor.posts_count, which stay null. - Past events of a group. The group listing carries upcoming events only; a page's own events include past ones.
- Spend and reach for most ads. Facebook publishes them for political and issue ads, and EU reach for ads that ran in the EU.
- Follower counts on a people search, and likes or comments on a plain reel list.
Pages
| Endpoint | Credits | What it returns | Key parameters |
|---|---|---|---|
GET /v1/facebook/profile | 1 | Page identity, category, contact details, and the page id | url, get_business_hours |
GET /v1/facebook/profile/full | 5 | The page, its recent posts, and computed analytics in one flat call | url, posts (1-100, default 25), include |
GET /v1/facebook/profile/posts | 1 | The page's recent posts, cursor-paged | url or pageId, cursor |
GET /v1/facebook/profile/events | 1 | One page's own upcoming and past events | url, cursor |
The profile response carries a page id. Pass it as pageId on profile/posts for a faster lookup. A plain profile/posts call leaves share counts null, so send include=engagement to fill them. Fill the rows, or fetch them? has the prices.
Posts and comments
| Endpoint | Credits | What it returns | Key parameters |
|---|---|---|---|
GET /v1/facebook/post | 1 | One post in full, including the reactions breakdown | url |
GET /v1/facebook/post/comments | 1 | The comment list, walked by cursor | url or feedback_id, cursor, label, judgments |
GET /v1/facebook/post/comment/replies | 1 | One reply thread | feedback_id and expansion_token, label, judgments |
GET /v1/facebook/post/transcript | 10 | The spoken words of a video post, up to 10 minutes long | url |
post is the only endpoint that returns the reactions breakdown (like, love, haha and the rest). Its post.ext.feedback_id makes post/comments faster than a url. A video over 10 minutes returns 400 video_too_long. A post with no speech or no video returns 404 no_captions. Both are free. See error reasons.
Media
| Endpoint | Credits | What it returns | Key parameters |
|---|---|---|---|
GET /v1/facebook/profile/photos | 1 | A page's gallery: photo id, permalink, full-size image, thumbnail | url, next_page_id |
GET /v1/facebook/profile/reels | 1 | The cheap reel list, with the rounded public view count | url, next_page_id |
GET /v1/facebook/profile/reels/full | 5 to 25 | The same list with exact per-reel engagement merged in | url, limit (max 50) |
A plain photo listing has no author, engagement or publish time, so send include=details to fill them. A reels/full walk that runs out of time returns _warnings: ["walk_deadline_reached"] and a next_cursor to resume.
Groups
| Endpoint | Credits | What it returns | Key parameters |
|---|---|---|---|
GET /v1/facebook/group | 1 | Group identity: name, description, member count, privacy | url or group_id |
GET /v1/facebook/group/posts | 1 | That group's posts with reaction, comment, and share counts | url or group_id, sort_by, cursor |
GET /v1/facebook/group/events | 1 | A public group's upcoming events | url or group_id, cursor, include |
Facebook serves the group feed in slices of 3 to 4 posts, so depth is a cursor walk. Use sort_by=CHRONOLOGICAL to keep a busy group current.
Events
| Endpoint | Credits | What it returns | Key parameters |
|---|---|---|---|
GET /v1/facebook/events | 1 | What is on in a place, from a city's Facebook Events page URL | url, time, cursor |
GET /v1/facebook/events/search | 1 | The public directory searched by keyword | query, cursor |
GET /v1/facebook/event/details | 1 | Description, start and end times, host, and RSVP counts | id or url |
The three calls return the same event objects. events/search also returns past events, so filter on is_past. Both listings take include=details.
Marketplace
| Endpoint | Credits | What it returns | Key parameters |
|---|---|---|---|
GET /v1/facebook/marketplace/location/search | 1 | A city or area name turned into a lat/lng pair | query |
GET /v1/facebook/marketplace/search | 1 | Listings near those coordinates | query, lat, lng, all required, plus radius_km, min_price, max_price, condition, delivery_method, date_listed, availability, sort_by |
GET /v1/facebook/marketplace/item | 1 | One listing in full | id or url |
Marketplace search is geographic, not textual, which is why the coordinate lookup comes first.
curl "https://www.socialcrawl.dev/v1/facebook/marketplace/location/search?query=Austin" \
-H "x-api-key: YOUR_API_KEY"
curl "https://www.socialcrawl.dev/v1/facebook/marketplace/search?query=bike&lat=30.2672&lng=-97.7431&radius_km=40&max_price=500" \
-H "x-api-key: YOUR_API_KEY"De-duplicate on listing id. The ordering shifts between calls, so consecutive cursor pages occasionally repeat an item.
Ad Library
| Endpoint | Credits | What it returns | Key parameters |
|---|---|---|---|
GET /v1/facebook/adlibrary/search/companies | 5 | An advertiser name turned into a pageId | query |
GET /v1/facebook/adlibrary/company/ads | 5 | Everything that page is running | pageId or companyName, country, status, media_type, language, sort_by, start_date, end_date |
GET /v1/facebook/adlibrary/search/ads | 5 | Ad copy searched by keyword across every advertiser | query, search_type, ad_type, country, status, media_type |
GET /v1/facebook/adlibrary/ad | 5 | One ad expanded into its creative, link, dates and platforms; spend and reach on political and issue ads only | id or url, trim |
GET /v1/facebook/adlibrary/ad/transcript | 10 | What a video ad says out loud | id or url |
GET /v1/facebook/adlibrary/advertiser | Roster | An advertiser's page profile, with the Instagram account it advertises with | id or url |
Both ad searches return each ad as a post object. The ad fields sit under post.ext.ad. adlibrary/search/ads rows also keep the original keys, such as ad_archive_id and snapshot. ad_type limits results to political and issue ads.
Questions people ask
How do I search Facebook posts by keyword?
GET /v1/facebook/search/posts takes query and costs 1 credit a page, with about 5 to 7 posts a page. Narrow it with start_date and end_date (YYYY-MM-DD, whole days), recent_posts=true or location_uid. Facebook does not return posts in strict time order, so sort on each post's published_at. Send pagination.next_cursor back as cursor. A page with nothing new is served empty at 0 credits, so keep calling while pagination.has_more is true.
curl "https://www.socialcrawl.dev/v1/facebook/search/posts?query=NASA&recent_posts=true" \
-H "x-api-key: YOUR_API_KEY"How do I search Facebook videos and get their view counts?
GET /v1/facebook/search/videos takes query and costs 1 credit a page, with about 7 videos a page. A plain call returns no counts, duration or publish date. Add include=details to fill views, likes, comments, shares, duration and publish time on every video. That adds 1 credit per video filled from a new lookup, so 8 credits at most a page. Cached rows are free and rows that could not be filled are refunded.
How do I search a hashtag or the mentions of a page?
GET /v1/facebook/search/hashtag takes hashtag and keeps only posts and videos that carry that exact tag, so #tractor leaves out #tractorlife. It runs the video and post searches together at 1 credit each, 2 at most a call. With since or until, each video is also looked up for its date at 1 credit, so 9 at most. GET /v1/facebook/search/mentions takes handle and costs 1 credit a page. Facebook links a mention by the page's name, so pass name when people write something other than the handle. Both leave out the page's own posts unless you send include_self=true.
How long does a comment reply token last?
Each comment from GET /v1/facebook/post/comments carries comment.ext.expansion_token. Pass it whole, with the comment's feedback_id, to GET /v1/facebook/post/comment/replies. A token two and a half days old still returns its replies. An expired or incomplete token returns an empty list, and the page carries a stale_expansion_token note in _warnings. Read the comment again from post/comments for a new token.
Which group was a post published in?
On a group post, GET /v1/facebook/post returns post.ext.group.id and post.ext.group.url at no extra cost. The group's name and member count are null until you send include=group. That adds 1 credit, kept only when the name comes back, so a call is 2 credits at most. A post outside a group is never charged for the lookup.
How many people saw a Facebook ad, by age and gender?
Facebook publishes this for ads that ran in the EU. GET /v1/facebook/adlibrary/ad takes id or url, costs 5 credits, and returns post.ext.ad.eu_total_reach and post.ext.ad.eu_reach_breakdown. The breakdown lists each EU country with reach split into age bands from 18-24 to 65+ by male, female and unknown. An ad that never ran in the EU has none of these. To fill them for a whole advertiser, add include=audience to GET /v1/facebook/adlibrary/company/ads. That is 5 credits for the page plus 1 per ad filled from a new lookup, 35 credits at most for a page of 30 ads. Ads that never ran in the EU are refunded.
How do I read the events of a public Facebook group?
GET /v1/facebook/group/events takes the group url (the group address or its Events tab address) or group_id, and returns the upcoming events a logged-out visitor sees. Forward pagination.next_cursor as cursor while pagination.has_more is true. Past events are not available from a group, and a group whose Events tab needs a login returns an empty list. A page held 1 to 3 events on the groups measured, so expect short lists.
Why does an event have no venue?
A plain event list carries little. A group's list sends no venue, host, cover image or RSVP counts, so add include=details to fill them. When the venue is a Facebook Page, post.ext.event.location_type is Page and location_id is that page's id, which GET /v1/facebook/profile accepts as https://www.facebook.com/<location_id>. Some venues are hidden from a logged-out visitor, and on those events every venue field is null while the rest of the event still comes through.
Why do page and group posts come a few at a time?
Facebook serves these feeds in small slices: about 3 posts a page from GET /v1/facebook/profile/posts and 3 to 4 from GET /v1/facebook/group/posts. Depth is a cursor walk. Send pagination.next_cursor back as cursor, or send max_items or max_pages to walk several pages in one call; each page is billed as one call. since and stop_at_id end a walk at what you already hold.
How do I read every comment on a post?
Call GET /v1/facebook/post/comments with the post url, or with the post.ext.feedback_id from GET /v1/facebook/post, which is faster. Send pagination.next_cursor back as cursor until pagination.has_more is false, or send max_items to collect rows across pages in one call. Each page is billed as one call, and the call can stop early on its time budget: data.walk.stopped says why and the returned cursor resumes the walk.
Why is Facebook slower than other platforms, and what makes it faster?
A fresh Facebook call takes seconds, not milliseconds. Measured on 22/11/2026: the first profile call took about 4 seconds. Three things shorten the work. Pass feedback_id instead of url to post/comments, and pageId instead of url to profile/posts. Leave out include=, which adds 2 to 7 seconds on a fresh page. Repeat calls inside the cache window are served from cache. The timeout to set is under All endpoints.
All endpoints
33 endpoints available.
| Endpoint | Path | Credit Tier |
|---|---|---|
| Get details for a Facebook event | /v1/facebook/event/details | standard (1cr) |
| List Facebook events for a city | /v1/facebook/events | standard (1-13cr)metered |
| Search Facebook events by keyword | /v1/facebook/events/search | standard (1cr) |
| Get a Facebook group | /v1/facebook/group | standard (1cr) |
| List a Facebook group's upcoming events | /v1/facebook/group/events | standard (1-9cr)metered |
| List Facebook group posts | /v1/facebook/group/posts | standard (1cr) |
| Get a Facebook Marketplace item | /v1/facebook/marketplace/item | standard (1cr) |
| Search Facebook Marketplace locations | /v1/facebook/marketplace/location/search | standard (1cr) |
| Search Facebook Marketplace listings | /v1/facebook/marketplace/search | standard (1cr) |
| Get Facebook post details | /v1/facebook/post | standard (1-2cr)metered |
| List replies to a Facebook post comment | /v1/facebook/post/comment/replies | standard (1-5cr)metered |
| List Facebook post comments | /v1/facebook/post/comments | standard (1-5cr)metered |
| Get Facebook page profile | /v1/facebook/profile | standard (1cr) |
| List a Facebook page's events | /v1/facebook/profile/events | standard (1-9cr)metered |
| Facebook profile, recent posts, and computed analytics in one call. | /v1/facebook/profile/full | standard (5cr) |
| List Facebook profile photos | /v1/facebook/profile/photos | standard (1-9cr)metered |
| List Facebook page posts | /v1/facebook/profile/posts | standard (1-4cr)metered |
| List Facebook profile reels | /v1/facebook/profile/reels | standard (1cr) |
| Search Facebook groups by keyword | /v1/facebook/search/groups | standard (1-15cr)metered |
| Search Facebook posts and videos carrying a hashtag | /v1/facebook/search/hashtag | standard (0-9cr)metered |
| Search Facebook posts that mention a page | /v1/facebook/search/mentions | standard (0-1cr)metered |
| Search Facebook pages by keyword | /v1/facebook/search/pages | standard (1-11cr)metered |
| Search Facebook people by keyword | /v1/facebook/search/people | standard (1cr) |
| Search Facebook posts by keyword | /v1/facebook/search/posts | standard (1-9cr)metered |
| Search Facebook videos by keyword | /v1/facebook/search/videos | standard (1-8cr)metered |
| Get Facebook Ad Library ad details | /v1/facebook/adlibrary/ad | advanced (5cr) |
| Get a Facebook Ad Library advertiser's profile | /v1/facebook/adlibrary/advertiser | advanced (5cr) |
| List Facebook Ad Library company ads | /v1/facebook/adlibrary/company/ads | advanced (5-35cr)metered |
| Search Facebook Ad Library | /v1/facebook/adlibrary/search/ads | advanced (5cr) |
| Search Facebook Ad Library companies | /v1/facebook/adlibrary/search/companies | advanced (5cr) |
| Facebook profile reels with exact views, likes, comments, and shares merged in, in one call. | /v1/facebook/profile/reels/full | advanced (5-25cr)metered |
| Get a Facebook Ad Library video ad transcript | /v1/facebook/adlibrary/ad/transcript | premium (10cr) |
| Get Facebook video transcript | /v1/facebook/post/transcript | premium (10cr) |
How far back and how deep
Each list returns one page at a time. Send cursor for the next page, or max_items or max_pages to collect several pages in one call. A page size appears only where it has been verified. How paging works
| Path | Rows per page | Date window | One call collects |
|---|---|---|---|
/v1/facebook/adlibrary/company/ads | about 28 | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/adlibrary/search/ads | about 29 | none | up to 5,000 rows or 50 pages |
/v1/facebook/events | about 12 | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/events/search | varies | none | up to 5,000 rows or 50 pages |
/v1/facebook/group/events | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/group/posts | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/marketplace/search | about 12 | none | up to 5,000 rows or 50 pages |
/v1/facebook/post/comment/replies | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/post/comments | about 10 | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/profile/events | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/profile/full | varies | none | one page a call |
/v1/facebook/profile/photos | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/profile/posts | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/profile/reels | about 10 | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/profile/reels/full | about 10 | none | one page a call |
/v1/facebook/search/groups | about 10 | none | up to 5,000 rows or 50 pages |
/v1/facebook/search/hashtag | about 12 | none | one page a call |
/v1/facebook/search/mentions | varies | none | one page a call |
/v1/facebook/search/pages | varies | none | up to 5,000 rows or 50 pages |
/v1/facebook/search/people | varies | none | up to 5,000 rows or 50 pages |
/v1/facebook/search/posts | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
/v1/facebook/search/videos | varies | since and until, applied to each page fetched | up to 5,000 rows or 50 pages |
Country and region
country and region do different jobs on different endpoints. Each line below says what the parameter does there. How they differ
countryon/v1/facebook/adlibrary/company/ads,/v1/facebook/adlibrary/search/ads: This can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
How long a call takes
Measured on production calls that were not served from the cache, 14/10/2026 to 21/10/2026. A cached call answers faster. Set your client timeout to the value in Timeout to set, so a slow call is not cut off and sent again.
| Path | Typical (median) | 95% finish within | Timeout to set |
|---|---|---|---|
/v1/facebook/adlibrary/ad | 2.6 s | 5.7 s | 11 s |
/v1/facebook/adlibrary/company/ads | 1.8 s | 4.2 s | 10 s |
/v1/facebook/adlibrary/search/ads | 3.2 s | 5.8 s | 14 s |
/v1/facebook/adlibrary/search/companies | 0.9 s | 1.9 s | 10 s |
/v1/facebook/group | 2.7 s | 4.6 s | 10 s |
/v1/facebook/group/posts | 3.1 s | 8.8 s | 37 s |
/v1/facebook/marketplace/item | 2.8 s | 4.8 s | 10 s |
/v1/facebook/marketplace/search | 2.2 s | 4.6 s | 16 s |
/v1/facebook/post | 3.1 s | 6.9 s | 15 s |
/v1/facebook/post/comment/replies | 1.9 s | 16 s | 30 s |
/v1/facebook/post/comments | 2.4 s | 8.2 s | 26 s |
/v1/facebook/post/transcript | 7.4 s | 19 s | 44 s |
/v1/facebook/profile | 3.2 s | 6.6 s | 14 s |
/v1/facebook/profile/full | 3.8 s | 9.0 s | 18 s |
/v1/facebook/profile/photos | 1.2 s | 3.0 s | 10 s |
/v1/facebook/profile/posts | 2.9 s | 6.3 s | 16 s |
/v1/facebook/profile/reels | 2.6 s | 4.2 s | 10 s |
/v1/facebook/profile/reels/full | 9.7 s | 23 s | 44 s |
/v1/facebook/search/groups | 5.5 s | 10 s | 22 s |
/v1/facebook/search/hashtag | 5.7 s | 23 s | 46 s |
/v1/facebook/search/mentions | 4.7 s | 8.7 s | 25 s |
/v1/facebook/search/pages | 2.6 s | 17 s | 31 s |
/v1/facebook/search/people | 2.6 s | 18 s | 33 s |
/v1/facebook/search/posts | 4.4 s | 19 s | 36 s |
/v1/facebook/search/videos | 4.3 s | 19 s | 35 s |
Platform notes
country takes one code. Ad Library endpoints accept a single two-letter code, not a list, and default to ALL.
Ad Library status defaults to ACTIVE. Set status to include historical ads, or a competitor sweep looks thin.
Multi-photo posts return the full media_urls array. Ad endpoints take trim=true to drop heavy creative metadata.
Labels
These lists label their rows by default, at no extra credit. Comments carry sentiment, question, purchase_intent and complaint on computed.labels. /v1/facebook/search/posts rows carry sponsored, intent, niche and a computed.relevance score. Send judgments=off to skip them. See Labels for the field shapes.
Next steps
Pagination
Cursor and page walks, and what has_more actually means.
Credits
What each tier costs and when a call is refunded.
API reference
Every parameter and response field, endpoint by endpoint.
The other Meta surface, same handle-first shape.
The other ad library plus the whole B2B profile surface.
