Call it
curl https://api.peume.com/v1/call/search-the-public-ad-library \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"adType": "ALL",
"status": "ACTIVE",
"searchType": "KEYWORD_UNORDERED",
"fields": "id,page_name,ad_delivery_start_time,ad_creative_bodies",
"includeMedia": false,
"limit": 25
}
}'const res = await fetch("https://api.peume.com/v1/call/search-the-public-ad-library", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"adType": "ALL",
"status": "ACTIVE",
"searchType": "KEYWORD_UNORDERED",
"fields": "id,page_name,ad_delivery_start_time,ad_creative_bodies",
"includeMedia": false,
"limit": 25
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/search-the-public-ad-library",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"adType": "ALL",
"status": "ACTIVE",
"searchType": "KEYWORD_UNORDERED",
"fields": "id,page_name,ad_delivery_start_time,ad_creative_bodies",
"includeMedia": False,
"limit": 25
}
},
)
print(res.json()["output"])Answer: {"id": "run_…", "status": "completed", "cost_usd": …, "output": {…}}. Long jobs answer 202 with a run id to read later. From an AI agent, connect the MCP server and ask for this by name: search-the-public-ad-library.
Parameters
platformstringWhich archive to search. `meta` needs no accountId. Required unless accountId is given.
meta · linkedin
accountIdstringSocialAccount id. Required for LinkedIn (linkedin / linkedinads: its token searches). Optional for Meta, where any facebook / instagram / metaads account only selects the platform.
qstringKeyword search. Meta does not translate it, so write it in the ads' language. Required unless pageIds (Meta) or advertiser (LinkedIn) is given.
pageIdsstringMeta only. Comma-separated Facebook Page ids (max 10) whose ads to list.
advertiserstringLinkedIn only. Advertiser (Page) name to search.
countriesstringComma-separated ISO 3166-1 alpha-2 codes the ads reached. Meta defaults to ALL (an explicit ALL is Meta-only); LinkedIn searches every market when omitted.
adTypestringMeta only.
ALL · POLITICAL_AND_ISSUE_ADS · HOUSING_ADS · EMPLOYMENT_ADS · FINANCIAL_PRODUCTS_AND_SERVICES_ADS
Example: ALL
statusstringMeta only. ACTIVE = eligible for delivery right now.
ACTIVE · INACTIVE · ALL
Example: ACTIVE
platformsstringMeta only. Comma-separated publisher platforms: FACEBOOK, INSTAGRAM, AUDIENCE_NETWORK, MESSENGER, WHATSAPP, OCULUS, THREADS, STREAMING_SERVICES.
mediaTypestringMeta only.
ALL · IMAGE · MEME · VIDEO · NONE
languagesstringMeta only. Comma-separated ISO 639-1 codes of the ad text.
sincestringMeta only. Earliest delivery date (YYYY-MM-DD). LinkedIn's archive does not filter by date, so it is a 400 there: filter on details.adStatistics.firstImpressionAt / latestImpressionAt instead (EU-delivered ads only).
untilstringMeta only. Latest delivery date (YYYY-MM-DD); a 400 on LinkedIn, see since.
searchTypestringMeta only. Whether q matches words in any order or as an exact phrase (comma-separate phrases to match all of them).
KEYWORD_UNORDERED · KEYWORD_EXACT_PHRASE
Example: KEYWORD_UNORDERED
fieldsstringMeta only. Comma-separated Graph field override. Supports nested {} projections and Graph field modifiers, so a nested edge can be paged explicitly: without a.limit modifier the expansion runs at the Meta default page size and the tail is dropped silently.
Example: id,page_name,ad_delivery_start_time,ad_creative_bodies
includeMediabooleanMeta only. When `true`, each row also carries `media`: the ad's rendered creative (images, videos, carousel cards) as direct file URLs, so you don't have to open `ad_snapshot_url` yourself. It also carries `destination_urls`: where the ad sends people (landing page, WhatsApp, app store), unwrapped from Facebook's redirect, in the order the ad shows them. Meta's archive does not return these itself. - Meta CDN links are signed and expire: download what you need before each item's `expires_at`. - `media` and `destination_urls` are `null` when Meta would not render the snapshot for that ad. `me
Example: false
limitintegerRows per page, up to 100 on Meta. LinkedIn and `includeMedia=true` accept at most 25 (400 above that).
Example: 25
afterstringpaging.after of the previous page.
