Facebook Ad Library Search API
Run a Ad Library facebook search and get structured, ranked results as clean JSON.
GET request to /v1/ad-library/facebook/search that responds with clean JSON and costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh. Start with 100 free credits — no credit card.What is the Facebook Ad Library Search API?
The Facebook Ad Library Search API lets you search and return matching results for Ad Library facebook search with a single REST call. No OAuth, no infrastructure to maintain, and no platform SDKs — send the request, get clean structured JSON back. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh.
What you get
- Ranked, structured result list
- Title, URL, author, and thumbnail per result when available
- Engagement metrics where the platform exposes them
- Configurable result limit
Try it
Fill in the parameters below and copy a ready-to-run request, or open the live Playground to run it against your account (no API key paste).
Parameters
curl "https://api.captapi.com/v1/ad-library/facebook/search?q=election" \
-H "Authorization: Bearer capt_live_..."
# or: -H "x-api-key: capt_live_..."Edit the parameters and the code updates instantly. Switch languages and hit copy.
Example response
{
"success": true,
"data": {
"query": "election",
"country": "US",
"totalReturned": 5,
"ads": [
{
"platform": "facebook_ad_library",
"id": "317161109571794",
"url": "https://www.facebook.com/ads/library/?id=317161109571794",
"text": "The Voting Information Center—one-tap voting registration information from election experts and authorities in one place.",
"headline": "Voting Information Center",
"cta": "Learn more",
"landingUrl": "http://facebook.com/votinginformationcenter",
"adFormat": "VIDEO",
"firstShown": "2020-09-22T07:00:00.000Z",
"lastShown": "2020-10-05T07:00:00.000Z",
"impressions": ">1M",
"spend": ">$1M",
"country": "US",
"advertiser": {
"id": "108824017345866",
"name": "Meta",
"url": "https://www.facebook.com/Meta/",
"logo": "https://scontent-atl3-1.xx.fbcdn.net/v/t1.6435-9/119568341_200337161527884_7846459746434232698_n.png?stp=dst-png_s60x60&_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=qaRlosGC9wUQ7kNvwHuGOSN&_nc_oc=AdpUTiQHP0F2DQWlJJsFhLjPwiKgiTaMBS9Gf3J_Ogy1Z6nYv2kt_BhKXvw8jPupOMg&_nc_zt=23&_nc_ht=scontent-atl3-1.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQCbS0Qc_-2kHNJh8Yysq78dbBXaaJS4Osw3-xA3_SHVlw&oe=6A89438E"
},
"media": [
"https://video-atl3-1.xx.fbcdn.net/o1/v/t2/f2/m412/AQNN757NtitUcJnpv0ODeMH6fXo-yFM-X90P2W82Zsrc70oOzST9lrKgscKf21SHBUtZ9pdKMclY8s32B0eRJ7o.mp4?_nc_cat=106&_nc_sid=ef5aa3&_nc_ht=video-atl3-1.xx.fbcdn.net&_nc_ohc=VIhm6QH6QpYQ7kNvwEGz32Z&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuMzQwLmFzaWNfaHExX3NkX3Byb2dyZXNzaXZlIiwieHB2X2Fzc2V0X2lkIjo4MzE0MTAwMzMxNDk2MzYsImFzc2V0X2FnZV9kYXlzIjoyMzcsInZpX3VzZWNhc2VfaWQiOjEwNjgwLCJkdXJhdGlvbl9zIjoxNSwidXJsZ2VuX3NvdXJjZSI6Ind3dyJ9&ccb=17-1&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&_nc_zt=28&oh=00_AQBmg1RWfbVvJ3MUBSfprUeNw4A1j1otLN5iP3DoZ8RxIw&oe=6A677448",
"https://scontent-atl3-2.xx.fbcdn.net/v/t39.35426-6/120065387_2711663819108220_8472417301728012411_n.jpg?_nc_cat=105&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=XJsOGtccv7UQ7kNvwFOmuvH&_nc_oc=AdqJh0Avn_pYIk_hzhEW3QS1dyOrrTJn4nBpQ38NLoUvb1OE8Kwj7qy75S7f1QbV1cs&_nc_zt=14&_nc_ht=scontent-atl3-2.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQBESYOW184a4FJWDENcSYwQSBzwkH5yonZh3U5v6ZZEgA&oe=6A67964A"
]
},
{
"platform": "facebook_ad_library",
"id": "372804137235499",
"url": "https://www.facebook.com/ads/library/?id=372804137235499",
"text": "The Voting Information Center on Facebook—one-tap voting info from election experts and authorities in one place.",
"headline": "Voting Information Center",
"cta": "Learn more",
"landingUrl": "http://facebook.com/votinginformationcenter",
"adFormat": "VIDEO",
"firstShown": "2020-10-05T07:00:00.000Z",
"lastShown": "2020-10-13T07:00:00.000Z",
"impressions": ">1M",
"spend": ">$1M",
"country": "US",
"advertiser": {
"id": "108824017345866",
"name": "Meta",
"url": "https://www.facebook.com/Meta/",
"logo": "https://scontent-atl3-1.xx.fbcdn.net/v/t1.6435-9/119568341_200337161527884_7846459746434232698_n.png?stp=dst-png_s60x60&_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=qaRlosGC9wUQ7kNvwHuGOSN&_nc_oc=AdpUTiQHP0F2DQWlJJsFhLjPwiKgiTaMBS9Gf3J_Ogy1Z6nYv2kt_BhKXvw8jPupOMg&_nc_zt=23&_nc_ht=scontent-atl3-1.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQCbS0Qc_-2kHNJh8Yysq78dbBXaaJS4Osw3-xA3_SHVlw&oe=6A89438E"
},
"media": [
"https://video-atl3-1.xx.fbcdn.net/o1/v/t2/f2/m412/AQPYrtdWcXYzwK9kZxgDiAgoU_IImyeS9Q8adbGcircR7RR1dDdUBrAQ0LiHO2OJoauE5pf8F4GyEcPVDLQ94uo.mp4?_nc_cat=100&_nc_sid=ef5aa3&_nc_ht=video-atl3-1.xx.fbcdn.net&_nc_ohc=TJVBi21FSYoQ7kNvwGc3J8g&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuMzQwLmFzaWNfaHExX3NkX3Byb2dyZXNzaXZlIiwieHB2X2Fzc2V0X2lkIjo4OTE2MjkwMDA0NTQwNDEsImFzc2V0X2FnZV9kYXlzIjoxNTcsInZpX3VzZWNhc2VfaWQiOjEwNjgwLCJkdXJhdGlvbl9zIjoxNCwidXJsZ2VuX3NvdXJjZSI6Ind3dyJ9&ccb=17-1&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&_nc_zt=28&oh=00_AQCMG2KnWhkyJxkleqImsnYBBqDKo2-gU04sjFZY6UOemA&oe=6A678682",
"https://scontent-atl3-1.xx.fbcdn.net/v/t39.35426-6/120439450_1980569842077757_2547343747583380554_n.jpg?_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=ghBwQrPN7IYQ7kNvwEK1Ioe&_nc_oc=Adq-eL0xdnXQzWG8i4nmzYYnwcV_Aa55yUcMBwzE5_rk0sejWdtPX_5QJKW6xounlWk&_nc_zt=14&_nc_ht=scontent-atl3-1.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQB1w19aEluVfs5pAiHsky2u5dZ4bgAW_AohS8QzRc8Wkg&oe=6A678BF4"
]
},
{
"platform": "facebook_ad_library",
"id": "352695862528588",
"url": "https://www.facebook.com/ads/library/?id=352695862528588",
"text": "Queen Latifah hosts a series of candid conversations honoring the 57th anniversary of the #MarchOnWashington and this new era of the civil rights movement. Change Together features notable civil rights leaders such as Patrisse Cullors, Reverend Al Sharpton, and Kendrick Sampson, as well as social justice advocates Amanda Seales, Common and musical guest, CHIKA. Let’s come together to #LiftBlackVoices, learn and move as one toward equality and freedom.",
"headline": "Change Together: From the March on Washington to Today",
"cta": null,
"landingUrl": null,
"adFormat": "VIDEO",
"firstShown": "2020-08-27T07:00:00.000Z",
"lastShown": "2020-08-30T07:00:00.000Z",
"impressions": ">1M",
"spend": ">$1M",
"country": "US",
"advertiser": {
"id": "20531316728",
"name": "Facebook",
"url": "https://www.facebook.com/facebook/",
"logo": "https://scontent-atl3-3.xx.fbcdn.net/v/t39.35426-6/123254501_376431443560946_8642123156381274111_n.jpg?stp=dst-jpg_s60x60_tt6&_nc_cat=108&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=uPcoVSVedoQQ7kNvwHgmWWe&_nc_oc=AdqwXTjc5hWqxKmTPliHRnVkbtl62MNcyuFRVtYt5e11rm_kKl_7cbhn2U6FxOqfz_4&_nc_zt=14&_nc_ht=scontent-atl3-3.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQAwgOXSH-Za4uSlnK2E_DN8SP8iELP-mBG2Fa6sq_k6fA&oe=6A678FB0"
},
"media": [
"https://video-atl3-3.xx.fbcdn.net/o1/v/t2/f2/m412/AQOhKuKthAVVa0rFEi41ggsiGpIjueM36xj6WP_vqqtBOe-ys_sa5nUBYG9fKBArU14yCLHp-zR-F0aBPcYRtpg.mp4?_nc_cat=107&_nc_sid=ef5aa3&_nc_ht=video-atl3-3.xx.fbcdn.net&_nc_ohc=_t6jTcvDRokQ7kNvwGEF3JZ&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuNDAwLmFzaWNfaHExX3NkX3Byb2dyZXNzaXZlIiwieHB2X2Fzc2V0X2lkIjoxMDUzMzI1NDAzNjA2NjM5LCJhc3NldF9hZ2VfZGF5cyI6Mzg1LCJ2aV91c2VjYXNlX2lkIjoxMDY4MCwiZHVyYXRpb25fcyI6MzY5OSwidXJsZ2VuX3NvdXJjZSI6Ind3dyJ9&ccb=17-1&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&_nc_zt=28&oh=00_AQB-yxRDZCNErGWI1fXJCz3c7uPPshjVivWZcuMY_fXKRg&oe=6A6795FF",
"https://scontent-atl3-3.xx.fbcdn.net/v/t39.35426-6/123131854_3586232378268717_4745383357747290556_n.jpg?_nc_cat=109&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=CBujsK3_RAYQ7kNvwGLIslX&_nc_oc=AdqugE8L4r1IjoIQfZPloPL5zYCw9T2PvW36W--FM6EwKE0s97CMYl5vHS5uvgucOB8&_nc_zt=14&_nc_ht=scontent-atl3-3.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQCdtQbYirMkwB6MPN1xoagoP9ljGYKRFTeMNVXwrXJFng&oe=6A678230"
]
},
{
"platform": "facebook_ad_library",
"id": "661142788113430",
"url": "https://www.facebook.com/ads/library/?id=661142788113430",
"text": "Get ready to vote and make your voice heard! Liza Koshy hosts Will Smith, Matthew McConaughey, Alicia Keys and more in Vote-A-Thon 2020, a #NationalVoterRegistrationDay celebration. \n\nFor information from election authorities, visit fb.com/votinginfocenter #Vote2020",
"headline": "Vote-A-Thon 2020: Get Ready to Vote!",
"cta": null,
"landingUrl": null,
"adFormat": "VIDEO",
"firstShown": "2020-09-23T07:00:00.000Z",
"lastShown": "2020-09-29T07:00:00.000Z",
"impressions": ">1M",
"spend": "$600K - $700K",
"country": "US",
"advertiser": {
"id": "20531316728",
"name": "Facebook App",
"url": "https://www.facebook.com/facebook/",
"logo": "https://scontent-atl3-1.xx.fbcdn.net/v/t1.6435-9/58818464_10158354585756729_7126855515920924672_n.png?stp=dst-png_s60x60&_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=cYlKOt4-GcUQ7kNvwEj2rPB&_nc_oc=AdoHGqorRQuAh1NodHbHYx2T0SKwlVlZZE9WmznEqmn2uvvLFB0aMuR8fLJef7D2itA&_nc_zt=23&_nc_ht=scontent-atl3-1.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQDFaJlAcj-4tia3IQ417oX2bxs7hepULywCIcQUtORkmQ&oe=6A893E2F"
},
"media": [
"https://video-atl3-2.xx.fbcdn.net/o1/v/t2/f2/m560/AQPTgFuknRcBF4Lc_DtMcH-qlZGFfCQi83pEJd1S2Rx7uirTcJhniVVQrX29KTbwpbmeEofg6qllV-Nw4oOwynbGFVZfEUoYqWo.mp4?_nc_cat=104&_nc_sid=ef5aa3&_nc_ht=video-atl3-2.xx.fbcdn.net&_nc_ohc=LAgfvy6KENoQ7kNvwG84FTD&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuNDI0LmFzaWNfaHExX3NkX3Byb2dyZXNzaXZlIiwieHB2X2Fzc2V0X2lkIjo5ODIzODk2MDc3OTIzNDQsImFzc2V0X2FnZV9kYXlzIjo5NiwidmlfdXNlY2FzZV9pZCI6MTA2ODAsImR1cmF0aW9uX3MiOjE5MzAsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&_nc_zt=28&oh=00_AQBP9B0O5L1XPrYbIA2nQ2YSQw58tY1oD2VaGk-pgOling&oe=6A63B26A",
"https://scontent-atl3-1.xx.fbcdn.net/v/t39.35426-6/125381272_280240523411642_8369623856772259236_n.jpg?_nc_cat=103&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=XyRK_lkth9MQ7kNvwGlTTfu&_nc_oc=AdpyKVXDhj9Y251dtE2MPybdoOcTQgK5aQOVfVoqrYjtlDDpADiKgCuUxnHKDgfCHj4&_nc_zt=14&_nc_ht=scontent-atl3-1.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQAo0Nzhu6femzVim7KW66JDEQAcuBXpTFdCPmF5uUi0RQ&oe=6A677FEC"
]
},
{
"platform": "facebook_ad_library",
"id": "475114446742483",
"url": "https://www.facebook.com/ads/library/?id=475114446742483",
"text": "Have you reviewed your ballot? Get to know what's on your ballot before Election Day through the Voting Information Center.",
"headline": "Double-Check Your Ballot",
"cta": "Learn more",
"landingUrl": "http://facebook.com/votinginfocenter/ballot?entry_point=Qmx1ZV9PTlA=",
"adFormat": "VIDEO",
"firstShown": "2020-10-23T07:00:00.000Z",
"lastShown": "2020-11-03T08:00:00.000Z",
"impressions": ">1M",
"spend": "$600K - $700K",
"country": "US",
"advertiser": {
"id": "20531316728",
"name": "Facebook App",
"url": "https://www.facebook.com/facebook/",
"logo": "https://scontent-atl3-1.xx.fbcdn.net/v/t1.6435-9/58818464_10158354585756729_7126855515920924672_n.png?stp=dst-png_s60x60&_nc_cat=100&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=cYlKOt4-GcUQ7kNvwEj2rPB&_nc_oc=AdoHGqorRQuAh1NodHbHYx2T0SKwlVlZZE9WmznEqmn2uvvLFB0aMuR8fLJef7D2itA&_nc_zt=23&_nc_ht=scontent-atl3-1.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQDFaJlAcj-4tia3IQ417oX2bxs7hepULywCIcQUtORkmQ&oe=6A893E2F"
},
"media": [
"https://video-atl3-1.xx.fbcdn.net/o1/v/t2/f2/m412/AQODMEZl7iplcGXJPBxXGuuh-WjlAPqsPLHH9EB0i7PARypul43ZBvenVloxoYkD-IUaEdBSmyDbTc5-kHBNxECY.mp4?_nc_cat=103&_nc_sid=ef5aa3&_nc_ht=video-atl3-1.xx.fbcdn.net&_nc_ohc=aQxYnWw9DrwQ7kNvwFxGOa7&efg=eyJ2ZW5jb2RlX3RhZyI6Inhwdl9wcm9ncmVzc2l2ZS5WSV9VU0VDQVNFX1BST0RVQ1RfVFlQRS4uQzMuMzQwLmFzaWNfaHExX3NkX3Byb2dyZXNzaXZlIiwieHB2X2Fzc2V0X2lkIjozNjE0ODg2NTI1MzE5NjczLCJhc3NldF9hZ2VfZGF5cyI6MjQwLCJ2aV91c2VjYXNlX2lkIjoxMDY4MCwiZHVyYXRpb25fcyI6MTUsInVybGdlbl9zb3VyY2UiOiJ3d3cifQ%3D%3D&ccb=17-1&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&_nc_zt=28&oh=00_AQDqlY-6Yt6F59kxtTMPrLsinAzaSpmAW9wChSkDXKdL_w&oe=6A67715C",
"https://scontent-atl3-3.xx.fbcdn.net/v/t39.35426-6/122569736_390651732307808_5011321040623151549_n.jpg?_nc_cat=108&ccb=1-7&_nc_sid=c53f8f&_nc_ohc=s0Jpfvn4SlgQ7kNvwFI6q5l&_nc_oc=Adq5xXs14dBn6M1y89p-mhFN_7LDpRUUYu4kxAyvKoR9GkLwN7rCAW9i2mxTNW3UcqE&_nc_zt=14&_nc_ht=scontent-atl3-3.xx&_nc_gid=kjSzmNhJvOQPmxnVKKr0xg&_nc_ss=72289&oh=00_AQAgInYoqIeK9Jq1kfsK47MfkfCHaI7EtgSg_lCE8MlVuQ&oe=6A6773AC"
]
}
]
}
}Billing metadata is returned in response headers: X-Captapi-Credits (credits charged), X-Captapi-Cache (hit or miss), and X-Captapi-Source. Failed requests (4xx/5xx) are never charged. See the full list of error codes in the error reference.
Response structure
A successful call returns success, cached, creditsUsed, and a data object with the following fields:
Top-level fields
queryThe search query you sent.countryCountry name (e.g. Mexico, United States).totalReturnedNumber of items returned in this response.
Ads
Each item in ads contains:
platformPlatform identifier (e.g. youtube, instagram).idStable platform ID for the item.urlCanonical URL of the item.textText content.headlineProfile headline.ctaCall-to-action text.landingUrlLanding page the ad links to.adFormatFormat of the ad creative.firstShownWhen the ad was first shown.lastShownWhen the ad was last shown.impressionsEstimated ad impressions.spendEstimated ad spend.countryCountry name (e.g. Mexico, United States).advertiserObject with id, name, url, logo.mediaMedia attached to the item.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| q | string | Yes | Keyword, brand, or advertiser to search Meta Ad Library (min 2 characters). |
| country | string | No | Two-letter ISO country code. Default US. |
| limit | integer | No | Max items to return (default 20, max 200). Billed per result. |
| cache | boolean | No | Set true to serve from the 24h response cache. Default false — always fetch fresh data. |
Authentication: send your key as Authorization: Bearer capt_live_.... A typical call costs 2 credits. Pass cache=true for a free 24h cache hit; default is always fresh.
facebook_ad_library_search via @captapi/mcp. Set it up →How it works
- 1. Sign up — get 100 free credits, no card required.
- 2. Create a key from your dashboard.
- 3. Send one request to
/v1/ad-library/facebook/searchand parse the JSON response.
Use cases
Trend Discovery
Find trending content by keyword or hashtag.
Content Sourcing
Build feeds and playlists programmatically.
Monitoring
Track topics, brands, and competitors.
Research
Sample large sets of content for analysis.
Frequently asked questions
What does the Facebook Ad Library Search API do?+
The Facebook Ad Library Search API lets you search and return matching results from a public Ad Library query using one GET request to /v1/ad-library/facebook/search. It returns clean JSON — no OAuth or infrastructure setup required.
How many credits does the Facebook Ad Library Search API cost?+
Each successful call costs 2 credits. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Failed or empty results are never charged.
Do I need a Ad Library API key or OAuth?+
No. A single Captapi key works across every platform Captapi supports — YouTube, TikTok, Instagram, Facebook, Twitter/X, Reddit, Threads, Bluesky, Pinterest, LinkedIn, Rumble, Spotify, Kwai, and more. We handle proxies, rate limits, retries, and authentication for you.
Is the Facebook Ad Library Search API suitable for production use?+
Yes. It is a stable REST endpoint with predictable JSON and automatic retries. Pass cache=true to serve from the 24h shared cache (0 credits on hit); default is always fresh. Use it for analytics, monitoring, and content automation.
More Ad Library APIs
Ready to use the Facebook Ad Library Search API?
Sign up, grab your key, and make your first call in 60 seconds.