Call it
curl https://api.peume.com/v1/call/facebook-ad-search-2 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"query": "your query",
"status": "ACTIVE"
}
}'const res = await fetch("https://api.peume.com/v1/call/facebook-ad-search-2", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"query": "your query",
"status": "ACTIVE"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/facebook-ad-search-2",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"query": "your query",
"status": "ACTIVE"
}
},
)
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: facebook-ad-search-2.
Parameters
cursorstringOpaque pagination cursor from a previous response's nextCursor. Pages can overlap: a page may repeat items an earlier page returned and is billed like any other, so de-duplicate by item id and stop when a page adds no new id.
countrystringTwo-letter country code to scope results. Omit for all countries.
adTypestringRestrict to all ads (default) or only political and issue ads.
all · political_and_issue_ads
routestringUpstream source to run on; omit for "tiger". tiger ($0.00079 per call, 97.7% uptime); lemur ($0.0011 per call, 99% uptime); giraffe ($0.0012 per call, 99.8% uptime); dolphin ($0.004 per call, 100% uptime); fox ($0.016 per call, 97.3% uptime). Output fields only some routes return: totalResults (lemur, giraffe). A route can refuse an input it cannot apply with a 400 source_unknown (not charged): retry on another route, or omit that input. Route `dolphin` has answered `sortBy`, `startDate`, `endDate` and `searchType` with HTTP 400: use another route when you need them.
tiger · lemur · giraffe · dolphin · fox
endDatestringFilter to ads with impressions on or before this date, in YYYY-MM-DD format.
searchTypestringMatch mode for the query: loose keyword match (keyword_unordered, the default) or exact phrase (keyword_exact_phrase).
keyword_unordered · keyword_exact_phrase
queryRequiredstringKeyword to search the for (e.g. "protein powder").
mediaTypestringCreative media type filter.
ALL · IMAGE · VIDEO · MEME · IMAGE_AND_MEME · NONE
sortBystringSort order: impressions (highest first, the default) or recent (most recent).
impressions · recent
startDatestringFilter to ads with impressions on or after this date, in YYYY-MM-DD format.
statusstringAd status filter.
ALL · ACTIVE · INACTIVE
Example: ACTIVE
