Skip to content

API

Facebook API

The TrueScrape Facebook API exposes 22 public endpoints covering Ad details, Ad video transcript and Find advertisers running ads. Every call is a GET against public, logged-out pages and returns the same unified schema as every other platform here. Calls cost 1–2 credits each. A cache hit is free, and a failed or empty response is never charged.

Find advertisers running ads

curl
curl "https://api.truescrape.com/v1/facebook/ad-library/advertisers?query=nike" \
  -H "x-api-key: $KEY"
Try it
GET/v1/facebook/ad-library/advertisers

What Facebook exposes

  • Facebook data comes from public Pages, public groups, public events, Marketplace listings and Meta's Ad Library. A private group's posts return an empty result because they are not public; its name and member count still come back.
  • A Page's follower count is as precise as Facebook renders it, exact on a small Page and rounded on a large one ("28M followers"); `raw.followerCountIsApproximate` says which.
  • Page posts come newest first, three per page with a cursor, each with its text, reaction, comment and share counts and publish time; photos and events come eight per page, and reels ten.
  • Facebook comments come in its "Most relevant" order, and comment reaction counts above about a thousand are rounded at source ("2.4K"), because Facebook publishes no exact figure.
  • A Marketplace listing returns its title, description, price, location, delivery options and every photo, but not the seller, whom Facebook does not show to a logged-out visitor.

Endpoints

Questions

How much does the Facebook API cost?
Calls cost 1–2 credits each. Every endpoint is cacheable, and a cache hit costs nothing. A failed request and an empty result are both free, on every endpoint.
Does the Facebook API need a login or cookies?
No. Every endpoint reads public, logged-out pages only — no account, no cookies, no session. An API key identifies your own TrueScrape account and nothing else.
Can I fetch many Facebook targets in one request?
Yes. 22 of 22 are batchable: one POST to /v1/jobs/batch takes many targets and returns a job id to poll.
Can I watch Facebook endpoints for changes?
Yes, 15 of 22. A subscription polls on your schedule and fires your webhook only when the content changed; the rest carry x-subscribable: false in the spec.
Does the Facebook Ad Library search cover Instagram ads?
Yes. It returns Facebook, Instagram, Messenger and Threads ads matching a term, in the Library's own order. Spend and impression ranges, which Meta publishes only for political and issue ads, are not always included.
How do I find an advertiser's `page_id`?
The advertisers endpoint returns the distinct advertisers whose ads match a search term, ranked by how many of those ads each ran, with the `page_id` the page ads endpoint takes.
Why do Facebook Marketplace results change between calls?
Marketplace is city-scoped. Without `location`, Facebook picks the city itself, so pass a city slug or a location id from the Marketplace locations endpoint for results you can repeat.
Can I get a transcript of a Facebook video?
Yes, from the caption track Facebook publishes for the video, which Facebook sometimes auto-generates. A video with no caption track returns a 501 and is not charged.

From the blog