Ad Library API for Facebook, TikTok, Google (2026)
Ad Library API for Facebook, TikTok and Google
If you want to see what a brand is advertising and pull those ads into your own tool, SocialLens (sociallens.dev) gives you an ad library API: one GET /v1/ads-search?platform=facebook&query=nike request returns the public ads for that search as clean JSON, and the same request shape works for Facebook, TikTok, LinkedIn and Google. You get the advertiser, the headline, the body copy, the call to action, the creative and the run dates, without opening four separate ad transparency sites by hand.
This guide shows a real request and response, what the endpoint does not do, and when another tool is the honest better choice.
One request, every matching ad
Here is a live search of the public Facebook ad library for the term nike, limited to the United States:
curl "https://api.sociallens.dev/v1/ads-search?platform=facebook&query=nike&country=US" \
-H "Authorization: Bearer sk_live_YOUR_KEY"
{
"query": "nike",
"platform": "facebook",
"count": 30,
"total_estimate": 50001,
"results": [
{
"id": "1550534860016399",
"advertiser": "Perfect themes",
"advertiser_id": "115939511520844",
"headline": "Super hot widgets app",
"body": "Themepack is a free and personalized app, with styles of theme, weather, photo, clock and calendar to dress up your home screen",
"cta": "Install now",
"url": "http://play.google.com/store/apps/details?id=com.iconchanger.widget.theme.shortcut",
"image": "https://scontent.fbcdn.net/...",
"video": null,
"format": "IMAGE",
"is_active": true,
"start_date": "2026-05-19T00:00:00Z",
"end_date": "2026-11-29T00:00:00Z",
"platforms": ["FACEBOOK", "INSTAGRAM", "AUDIENCE_NETWORK", "MESSENGER", "THREADS"],
"platform": "facebook"
}
],
"cursor": "AQHT0Au...",
"has_more": true
}
An ad library returns every ad that matches the term, so the results mix brands and unrelated advertisers that happened to use the keyword. total_estimate is how many ads the library holds for that search, count is how many came back in this page, and cursor plus has_more let you page through the rest, one credit per page.
The same schema across four ad libraries
Change platform and the call stays the same. On facebook, linkedin and tiktok, each result is an individual ad with the advertiser, headline, body, call to action, creative and the dates it ran. On google, each result is an advertiser instead of a single ad: you get the advertiser name, an advertiser_id, the region and an estimate of how many ads they are running, which is the natural entry point before you drill into a specific advertiser.
Facebook accepts an optional country (a two letter code, default US) so you can see what a brand runs in a given market. Every other parameter stays identical, which means one integration covers all four sources instead of four separate scrapers.
What this endpoint does not do
Be clear on the limits before you build on it:
- It reads the public ad libraries only. It does not read a private ad account, your own campaign metrics, or spend figures that the platforms do not publish.
- Google returns matching advertisers, not individual creatives. Use the advertiser as your starting point.
- It is read only. There is no campaign creation, bidding or management here.
- Spend and reach are only present when the public library exposes them, which varies by platform and region.
When another tool is the better choice
SocialLens is built for a small team that wants ad creatives and competitor ads by the read, with a free start and credits that do not expire. If you need a managed enterprise ad intelligence suite with alerting, share of voice dashboards and historical spend modeling, a heavier platform like SocialCrawl or a full scraping stack on Apify is the honest better fit. If you are already running a large scraping pipeline and only want raw library pages, Apify gives you that control. SocialLens trades that control for a finished API you can call in one line.
Pricing
Each successful search is 1 credit (HTTP 200), and errors cost nothing. You start with 250 free reads using only an email, no card. Paid credits are prepaid and never expire, there is no monthly lock in, and the rate limit is 60 requests per minute per key with parallel requests supported.
FAQ
Which ad libraries does the API cover? Facebook, LinkedIn and TikTok return individual ads. Google returns matching advertisers. One request shape covers all four.
Can I page through all the ads for a brand?
Yes. Each response carries a cursor and has_more. Pass the cursor on the next call to read the next page, one credit per page, until has_more is false.
Can I filter Facebook ads by country?
Yes, send country with a two letter code, such as country=US. It applies to Facebook and defaults to US.
Do I need an ad account or login? No. This reads public ad library data only, so there is no login, no OAuth and no connection to any ad account.
What does a result contain? For Facebook, LinkedIn and TikTok: advertiser, advertiser_id, headline, body, cta, image or video, format, is_active and the start and end dates. For Google: advertiser, advertiser_id, region and an estimate of the number of ads.
Last updated: December 1, 2026.