Facebook Ads Library API
Send words or a brand name and a country, and get the ads Meta's Ad Library shows for them as JSON: the advertiser and its Page, the ad text, headline, link, call to action, images and videos, platforms, start date and days active.
- 10 free credits
- No card needed
- No scraper to build or maintain
curl "https://pipefetch.com/v1/facebook/ads?q=nike&country=US" \
-H "x-api-key: YOUR_API_KEY"const res = await fetch('https://pipefetch.com/v1/facebook/ads?q=nike&country=US', {
headers: { 'x-api-key': process.env.PIPEFETCH_API_KEY },
});
const { data, credits } = await res.json();import os, requests
res = requests.get(
"https://pipefetch.com/v1/facebook/ads",
params={"q": "nike", "country": "US"},
headers={"x-api-key": os.environ["PIPEFETCH_API_KEY"]},
)
data = res.json()["data"]What you get
- Up to 30 ads per request, running now or also stopped
- The advertiser: Page name, address, likes and categories
- Ad text, headline, link, call to action and format
- Image and video addresses of the creative
- Platforms (Facebook, Instagram, Messenger, Audience Network), start date and days active
{
"data": {
"query": "nike",
"country": "US",
"ads": [
{
"id": "1550534860016399",
"url": "https://www.facebook.com/ads/library/?id=1550534860016399",
"advertiser": {
"name": "Perfect themes",
"pageId": "115939511520844",
"pageUrl": "https://www.facebook.com/100093512920259/",
"pageLikes": 18492,
"categories": [
"Topic"
]
},
"text": "🔥🍭Themepack is a FREE and personalized APP😍 various styles of Theme💎 、Weather💖、Photo😊、Clock、Calendar to pick any widget to dress up your home sc…",
"headline": "𝕊𝕦𝕡𝕖𝕣 𝕙𝕠𝕥 𝕨𝕚𝕕𝕘𝕖𝕥𝕤 𝕒𝕡𝕡 !",
"description": null,
"linkUrl": "http://play.google.com/store/apps/details?id=com.iconchanger.widget.theme.shortcut",
"linkCaption": "play.google.com",
"callToAction": "Install now",
"format": "IMAGE",
"imageUrls": [
"https://scontent.fmem1-1.fna.fbcdn.net/v/t39.35426-6/700927950_933331229664450_6487763311056032772_n.jpg?_nc_cat=111&_nc_map=urlgen_bucketless&ccb=1-7…"
],
"videoUrls": [],
"platforms": [
"facebook",
"instagram"
],
"startDate": "2026-05-19",
"endDate": null,
"isActive": true,
"daysActive": 197,
"variants": 1,
"spend": null,
"impressions": null
},
{
"id": "962050096457659",
"url": "https://www.facebook.com/ads/library/?id=962050096457659",
"advertiser": {
"name": "Depop",
"pageId": "156405867784232",
"pageUrl": "https://www.facebook.com/depop/",
"pageLikes": 100495,
"categories": [
"Shopping"
]
},
"text": "Free Depop Shipping just dropped. Go find something you love.",
"headline": "Nike Women's Jacket, LOFT Women's T-shirt, LOFT Women's Shorts, LOFT Women's Blouse, Coach Women's Hoodie",
"description": "Download Depop - Buy & Sell Clothes by Depop Ltd on the App Store. See screenshots, ratings and reviews, user tips, and more apps like Depop - Buy & S…",
"linkUrl": "http://itunes.apple.com/app/id518684914",
"linkCaption": "itunes.apple.com",
"callToAction": "Download",
"format": "DPA",
"imageUrls": [
"https://scontent.fmem1-2.fna.fbcdn.net/v/t39.35426-6/706198623_1758809891778866_1474232210027622534_n.jpg?_nc_cat=105&_nc_map=urlgen_bucketless&ccb=1-…",
"https://scontent.fmem1-1.fna.fbcdn.net/v/t39.35426-6/706538687_1471950538014143_7938086405330809751_n.jpg?_nc_cat=108&_nc_map=urlgen_bucketless&ccb=1-…"
],
"videoUrls": [],
"platforms": [
"facebook",
"instagram"
],
"startDate": "2026-05-22",
"endDate": null,
"isActive": true,
"daysActive": 194,
"variants": 6,
"spend": null,
"impressions": null
}
]
},
"credits": {
"used": 1,
"remaining": 99
}
}One GET request
Everything the endpoint accepts. The full reference, with the complete example response, is in the docs.
GET/v1/facebook/ads
Costs 1 credit per request. Only requests that return data are charged.
Parameters
| Name | Type | Description |
|---|---|---|
qrequired |
string | Words the ads contain, or a brand name, up to 100 characters. |
countryoptional |
string | Two-letter code of the country where the ads ran, such as US, GB or DE. Without it: US. |
statusoptional |
string | active: ads running now. all: also ads that have stopped. One of: active, all. Default: active. |
limitoptional |
integer | How many ads to return. Default: 20. From 1 to 30. |
Good to know
- The ads are those Meta's Ad Library shows for the words, in Meta's order. Meta matches words loosely: a few ads in a result may not mention them.
- Spend, impressions and audience figures are shown by Meta only for political and issue ads and are null for others.
- No ads for the words answers 404 no_ads and costs nothing. When Meta refuses the request, the answer is 502 upstream_error, free and worth a retry.
What people build with it
Competitor ad research
See which ads a competitor runs, since when, and on which platforms.
Creative inspiration
Collect the ads of a niche to study hooks, offers and formats.
Ad monitoring
Check a keyword every day and catch new ads as they start.
Ad data for AI agents
An agent researching a market gets its ads in one call.
Buy credits once. Use them whenever.
This endpoint costs 1 credit per request, and a request that returns no data costs nothing. Move the slider to see what your volume costs.
Each endpoint says what a request costs. Requests that return nothing are free.
- $2.42 per 1,000 credits
- About $12.08 a month at this pace
- Lasts about 2.4 months at this pace
- Credits never expire
Questions and answers
Is this the official Meta API?
No. Pipefetch is an independent service and is not affiliated with Meta. It returns what Meta shows publicly to a visitor who is not signed in; you need no Meta account, only one Pipefetch API key.
Why do some ads not mention my keyword?
Meta's Ad Library matches words loosely, including text you cannot see in the ad card. Most results mention the words; a few may not.
Do I get spend and impressions?
Meta shows them only for political and issue ads; for others they are null.
What does a request cost?
One request costs 1 credit. Credit packs start at $9 for 3,000 credits, never expire, and a request that returns no data is not charged. New accounts get 10 free credits without a card.
More Facebook APIs
-
1 credit / 20
Facebook Comments API
The comments on a public Facebook post, video or Reel, with reactions by type, reply counts, authors and the post itself.
GET /v1/facebook/comments -
1 credit
Facebook Reels API
The newest Reels of a Facebook Page with plays, reactions, comments, shares and saves, captions and video file addresses.
GET /v1/facebook/reels -
1 credit
Facebook Reviews API
The newest reviews of a Facebook Page: text, recommends or not, date and reviewer, with the Page's recommend percentage.
GET /v1/facebook/reviews -
1 credit
Facebook Events API
The upcoming or past events a Facebook Page hosts, with dates, venue and address, organizers, ticket link and responses.
GET /v1/facebook/events -
2 credits
Facebook Page API
The public details of a Facebook Page: category, followers, email, phone, website, address, social links and pictures.
GET /v1/facebook/page -
2 credits
Facebook Posts API
The newest posts of a Facebook Page with text, images, reactions by type, comment and share counts, and top comments.
GET /v1/facebook/posts -
2 credits
Facebook Group Posts API
The newest posts of a public Facebook group with author, text, images, links, reactions by type and top comments.
GET /v1/facebook/group -
1 credit
Facebook Marketplace API
Facebook Marketplace listings for a search near a place: title, price, city, listing time, photo, seller and delivery.
GET /v1/facebook/marketplace
Other sources
YouTubeInstagramWebsitesTikTokGoogleThreadsLinkedInApp storesSteamXPinterestAmazonAirbnbReal estateKeywordsJob boardsEventbriteShopify storesPublic tendersTrustpilotProduct HuntAudio & video
Make your first request in a minute
Sign in, copy your key and call an endpoint. Your account starts with 10 free credits.