Call it
curl https://api.peume.com/v1/call/facebook-list-meta-company-ads \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"end_date": "your end date",
"cursor": "your cursor"
}
}'const res = await fetch("https://api.peume.com/v1/call/facebook-list-meta-company-ads", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"end_date": "your end date",
"cursor": "your cursor"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/facebook-list-meta-company-ads",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"end_date": "your end date",
"cursor": "your cursor"
}
},
)
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-list-meta-company-ads.
Parameters
end_datestringEnd date to search for. Format: YYYY-MM-DD
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.
trimbooleanSet to true for a trimmed down version of the response
media_typestringMedia type of the ad. Defaults to ALL. Meme refers to ads with image and text. Not sure why they call it meme.
ALL · IMAGE · VIDEO · MEME · IMAGE_AND_MEME · NONE
companyNamestringCompany name for a convenience lookup. We look up the Page for you, but the match may not be the company you intended and can lead to inaccurate results. Use pageId to target the correct company. Provide companyName or pageId.
languagestringLanguage to filter ads on. Needs to be 2 letter language code, ie EN, ES, FR, etc
sort_bystringSort by impressions (high to low), or Most Recent (relevancy_monthly_grouped). Defaults to impressions.
total_impressions · relevancy_monthly_grouped
pageIdstringThe intended company's Facebook Page ID. Use pageId for accurate Page selection instead of relying on the companyName lookup. You can get it from Search for Companies; verify that the result is the company you want. Provide pageId or companyName.
statusstringStatus of the ad. Defaults to ACTIVE.
ALL · ACTIVE · INACTIVE
start_datestringStart date to search for. Format: YYYY-MM-DD
