Call it
curl https://api.peume.com/v1/call/facebook-search-2 \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"query": "your query"
}
}'const res = await fetch("https://api.peume.com/v1/call/facebook-search-2", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"query": "your query"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/facebook-search-2",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"query": "your query"
}
},
)
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-search-2.
Parameters
end_datestringImpressions end date. Needs to be in YYYY-MM-DD format.
cursorstringCursor to paginate through results
countrystringThis can only be one country. It has to be the 2 letter code for the country. It defaults to ALL.
ad_typestringSearch for all ads or only political and issue ads
all · political_and_issue_ads
trimbooleanSet to true for a trimmed down version of the response
media_typestringMedia type of the ad. Defaults to ALL. Meme just means the ad has text and an image. No clue why they call it meme.
ALL · IMAGE · VIDEO · MEME · IMAGE_AND_MEME · NONE
queryRequiredstringKeyword to search for
languagestringLanguage to filter ads on. Needs to be a 2 letter language code, such as EN, ES, or FR.
sort_bystringSort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.
total_impressions · relevancy_monthly_grouped
search_typestringIf you want to search by exact phrase or not
keyword_unordered · keyword_exact_phrase
statusstringStatus of the ad. Defaults to ACTIVE.
ALL · ACTIVE · INACTIVE
start_datestringImpressions start date. Needs to be in YYYY-MM-DD format.
