Call it
curl https://api.peume.com/v1/call/instagram-ads-a-facebook-page-runs-by-page-id \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"search_page_ids": [
"20531316728"
],
"ad_reached_countries": [
"US"
],
"fields": "id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,media_type",
"ad_active_status": "ACTIVE",
"limit": 50
}
}'const res = await fetch("https://api.peume.com/v1/call/instagram-ads-a-facebook-page-runs-by-page-id", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"search_page_ids": [
"20531316728"
],
"ad_reached_countries": [
"US"
],
"fields": "id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,media_type",
"ad_active_status": "ACTIVE",
"limit": 50
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/instagram-ads-a-facebook-page-runs-by-page-id",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"search_page_ids": [
"20531316728"
],
"ad_reached_countries": [
"US"
],
"fields": "id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,media_type",
"ad_active_status": "ACTIVE",
"limit": 50
}
},
)
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: instagram-ads-a-facebook-page-runs-by-page-id.
Parameters
search_page_idsRequiredarrayJSON array of up to 10 numeric Facebook Page ids. You need the id, not the vanity handle — get it from a keyword search's page_id, or from the Page's About section
Example: ["20531316728"]
ad_reached_countriesRequiredarrayExample: ["US"]
fieldsRequiredstringExample: id,page_id,page_name,ad_creative_bodies,ad_creative_link_titles,ad_snapshot_url,ad_delivery_start_time,ad_delivery_stop_time,publisher_platforms,media_type
ad_active_statusstringACTIVE (default) | INACTIVE | ALL
Example: ACTIVE
ad_delivery_date_minstringYYYY-MM-DD
limitintegerExample: 50
afterstringOther ways to do it
Same job, other sources, cheapest first.
