GET
/v1/facebook/adLibrary/search/adsSearch ads API
Keyword-based search across every public ad in the Facebook Ad Library. Supports filters by country, status, ad type, media type, and date range. Paginates via the opaque `cursor` value in the response.
Authentication
Include
x-api-key: <your_key> in your request headersRequests without a valid key get a
401 Unauthorized. Revoked keys return 403 Forbidden.Parameters
Name
Type
Description
queryRequiredstring
Search string — keyword(s) to match against ad copy.
sort_byOptionalstring
Facebook's ordering hint. Leave empty for default.
search_typeOptionalenumdefault: keyword_unordered
How `query` is interpreted.
keyword_unorderedkeyword_exact_phrasead_typeOptionalenumdefault: ALL
Ad type filter.
ALLPOLITICAL_AND_ISSUE_ADSEMPLOYMENT_ADSHOUSING_ADSCREDIT_ADScountryOptionalstringdefault: ALL
2-letter ISO country code, or "ALL".
statusOptionalenumdefault: all
Active status filter.
allactiveinactivemedia_typeOptionalenumdefault: all
Creative format filter.
allimagevideomemestart_dateOptionalstring
YYYY-MM-DD lower bound on first-shown date.
end_dateOptionalstring
YYYY-MM-DD upper bound on last-shown date.
cursorOptionalstring
Pagination cursor — pass the previous response's `cursor`.
trimOptionalboolean
Set to "true" to drop snapshot.images/videos/cards arrays (faster, smaller).
Example request
curl "https://mesmer.tools/api/v1/facebook/adLibrary/search/ads?query=AI+agent&country=US&status=active" \
-H "x-api-key: <YOUR_API_KEY>"Try it now
Hits the live endpoint with your API key.
Saved locally in your browser. Mint a key in /admin/api-keys.
Response schema
Trimmed example — see Field reference for descriptions.
{
"success": true,
"credits_remaining": -1,
"searchResultsCount": 12480,
"cursor": "AQHRl4y7v...",
"searchResults": [
{
"ad_archive_id": "1234567890123456",
"ad_id": null,
"page_id": "232540286768801",
"page_name": "Notion",
"is_active": true,
"start_date": 1775520000,
"start_date_string": "2026-04-04",
"end_date": null,
"end_date_string": null,
"publisher_platform": [
"FACEBOOK",
"INSTAGRAM"
],
"snapshot": {
"body": {
"text": "Meet Notion AI — your second brain..."
},
"page_name": "Notion",
"page_profile_picture_url": "https://...jpg",
"cta_text": "Try for free",
"link_url": "https://www.notion.so/product/ai",
"images": [
"...trimmed..."
],
"videos": [],
"cards": []
},
"currency": "",
"url": "https://www.facebook.com/ads/library/?id=1234567890123456"
},
"...29 more ads"
]
}Field reference
Each searchResults[] entry — the fields you'll most likely use.
searchResults[].field
Type
Description
ad_archive_idstring
Stable Ad Library archive id. Use this with /v1/facebook/adLibrary/ad for detail lookups.
page_idstring
Facebook Page id of the advertiser.
page_namestring
Display name of the advertising Page.
is_activeboolean
Whether the ad is currently running.
start_datenumber
Run-start time as Unix epoch seconds (null if unknown).
end_datenumber
Run-end time as Unix epoch seconds (null if still active).
publisher_platformstring[]
Surfaces the ad ran on, e.g. ["FACEBOOK", "INSTAGRAM"].
snapshotobject
Creative payload — body text, images, videos, cta, link, page_profile_picture_url.
currencystring
Currency code of any disclosed spend bucket.
urlstring
Public Ad Library URL for this archive id.