Call it
curl https://api.peume.com/v1/call/facebook-ad-search \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"country": "US",
"query": "nike",
"searchType": "keyword_exact_phrase",
"status": "ACTIVE"
}
}'const res = await fetch("https://api.peume.com/v1/call/facebook-ad-search", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"country": "US",
"query": "nike",
"searchType": "keyword_exact_phrase",
"status": "ACTIVE"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/facebook-ad-search",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"country": "US",
"query": "nike",
"searchType": "keyword_exact_phrase",
"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.
Parameters
fieldsstringComma-separated keys (dotted paths descend) to keep on each result item. Trims the response, not the charge.
max_itemsintegerCaps the result rows returned; `_truncated` says how many were withheld. Not the charge.
summaryboolean`true` returns only an outline: keys, item counts, per-field sizes.
jqstringjq expression over the result envelope; its output replaces `output`. A failed expression returns the full result with `jqError`.
adTypestringRestrict to all ads (default) or only political and issue ads.
all · political_and_issue_ads
countrystringTwo-letter country code to scope results. Omit for all countries.
Example: US
cursorstringOpaque pagination cursor from a previous response's nextCursor.
endDatestringFilter to ads with impressions on or before this date, in YYYY-MM-DD format.
mediaTypestringCreative media type filter.
ALL · IMAGE · VIDEO · MEME · IMAGE_AND_MEME · NONE
queryRequiredstringKeyword to search the for (e.g. "protein powder").
Example: nike
searchTypestringMatch mode for the query: loose keyword match (keyword_unordered, the default) or exact phrase (keyword_exact_phrase).
keyword_unordered · keyword_exact_phrase
Example: keyword_exact_phrase
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
