MarkdownCopies this page as Markdown, ready to paste into an AI assistant.
Facebook API
24 Facebook endpoints behind one key, priced in credits per call or per result and routed to the cheapest healthy source.
On this page
Web Intelligence · 24 endpoints · from 1 credit per call
Endpoints
- POSTFacebook Ad Creative Details
/v1/run/facebook.ad_details_fullOne Meta Ad Library ad with its full creative: every carousel card or version, image and video URL, headline, body and CTA.2 creditsper call - POSTFacebook Ad Details
/v1/run/facebook.ad_detailsOne Meta Ad Library ad by id or URL: advertiser, creative text, call to action, platforms, run dates and media.2 creditsper call - POSTFacebook Ad Library Advertiser Search
/v1/run/facebook.search_companiesFind Meta Ad Library advertisers by name and get their page ids, category, verification and linked Instagram account.2 creditsper call - POSTFacebook Ad Library Search
/v1/run/facebook.ads_searchSearch the Meta Ad Library by keyword with country, status, media, date and sort filters; returns matching ads with cursor pagination.1 creditper call - POSTFacebook Company Ads
/v1/run/facebook.company_adsThe ads one advertiser runs in the Meta Ad Library, by Ad Library page id or company name, with filters and cursor pagination.2 creditsper call - POSTFacebook Event Details
/v1/run/facebook.event_detailsFull details of one public Facebook event by id or URL: schedule, venue with coordinates, hosts, description and attendance.2 creditsper call - POSTFacebook Events by City
/v1/run/facebook.eventsPublic Facebook events for a city or place from its events-explore URL: name, date, venue and going / interested counts.2 creditsper call - POSTFacebook Events Search
/v1/run/facebook.events_searchKeyword search over public Facebook events returning name, schedule, venue, price range and attendance counts.2 creditsper call - POSTFacebook Group Posts
/v1/run/facebook.group_postsRecent posts of a public Facebook group by URL, with sort order and cursor pagination: text, author, reaction and comment counts.2 creditsper call - POSTFacebook Marketplace Item
/v1/run/facebook.marketplace_itemFull details of one Facebook Marketplace listing by id or URL: title, description, price, location, photos, condition and status.2 creditsper call - POSTFacebook Marketplace Search
/v1/run/facebook.marketplaceSearch Facebook Marketplace listings by keyword near a latitude/longitude with price, condition, delivery, recency and availability filters.2 creditsper call - POSTFacebook Page Contact Info
/v1/run/facebook.page_contactPublic contact details of a Facebook page (email, phone, website, address, price range, rating) by URL, handle or page id.2 creditsper call - POSTFacebook Page Events
/v1/run/facebook.profile_eventsEvents hosted by a public Facebook page by URL: name, start time, venue, city, host and status, with cursor pagination.2 creditsper call - POSTFacebook Page Lookup by Name
/v1/run/facebook.page_lookupResolve a brand or page name to up to 7 matching Facebook pages with id, URL, picture and verified flag.2 creditsper call - POSTFacebook Page Photos
/v1/run/facebook.photosRecent photos of a public Facebook page by URL: image URL, thumbnail, size, caption and photo id, with cursor pagination.2 creditsper call - POSTFacebook Page Posts
/v1/run/facebook.profile_postsRecent public posts of a Facebook page by URL or page id, with cursor pagination: text, time, reactions, comments and media.2 creditsper call - POSTFacebook Page Profile
/v1/run/facebook.profilePublic profile of a Facebook page by URL or handle: name, category, intro, followers, likes, website and Ad Library page id.2 creditsper call - POSTFacebook Page Reels
/v1/run/facebook.profile_reelsReels of a public Facebook page by URL with cursor pagination: caption, view count, thumbnail, video URL and permalink.2 creditsper call - POSTFacebook Page Search
/v1/run/facebook.search_pagesSearch Facebook pages by keyword, optionally near a place, and get page profiles with category, followers and contact fields.6.25 creditsper result - POSTFacebook Post
/v1/run/facebook.postOne public Facebook post or reel by URL: text, author, likes, comments, shares, views, video URL and duration.2 creditsper call - POSTFacebook Post Comments
/v1/run/facebook.post_commentsTop-level comments of a public Facebook post or reel with cursor pagination: text, author, reactions and reply count.2 creditsper call - POSTFacebook Post Search
/v1/run/facebook.search_postsKeyword search over public Facebook posts, optionally by date range and place, with post text, author and engagement counts.3.24 creditsper result - POSTFacebook Post Transcript
/v1/run/facebook.post_transcriptSpoken-word transcript of a public Facebook video post or reel by URL (native captions first, AI for clips up to 2 minutes).2 creditsper call - POSTFacebook Followers / Following ListPlanned
/v1/run/facebook.followersList the public followers of a Facebook page or profile, or the accounts it follows, as id, name, URL and picture.Planned
Calling them
Every endpoint on this page is one POST to https://api.primaryapi.com/v1/run/{sku} with your API key and a JSON body. Responses share one envelope, so code written for one endpoint handles the others. For example, facebook.ad_details_full:
curl -sS -X POST "https://api.primaryapi.com/v1/run/facebook.ad_details_full" \
-H "Authorization: Bearer $PRIMARYAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"1016451784037642"}'const res = await fetch('https://api.primaryapi.com/v1/run/facebook.ad_details_full', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PRIMARYAPI_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({
id: '1016451784037642',
}),
});
const body = await res.json();
if (!res.ok) throw new Error(`${body.code}: ${body.error}`);
// found:false is a successful answer ("does not exist"), not an error
console.log(body.output.found ? body.output.data : body.output.reason, body.credits);import os
import requests
res = requests.post(
"https://api.primaryapi.com/v1/run/facebook.ad_details_full",
headers={"Authorization": f"Bearer {os.environ['PRIMARYAPI_API_KEY']}"},
json={
"id": "1016451784037642",
},
timeout=60,
)
body = res.json()
if not res.ok:
raise RuntimeError(f"{body['code']}: {body['error']}")
# found=False is a successful answer ("does not exist"), not an error
print(body["output"]["data"] if body["output"]["found"] else body["output"]["reason"], body["credits"])New to PrimaryAPI? Start with the Quickstart, then read Making requests.