Call it
curl https://api.peume.com/v1/call/run-a-meta-marketing-api-insights-query-on-one \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"accountId": "your accountId",
"adAccountId": "your adAccountId",
"limit": 500
}
}'const res = await fetch("https://api.peume.com/v1/call/run-a-meta-marketing-api-insights-query-on-one", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"accountId": "your accountId",
"adAccountId": "your adAccountId",
"limit": 500
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/run-a-meta-marketing-api-insights-query-on-one",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"accountId": "your accountId",
"adAccountId": "your adAccountId",
"limit": 500
}
},
)
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: run-a-meta-marketing-api-insights-query-on-one.
Parameters
accountIdRequiredstringThe id of the connected account.
adAccountIdRequiredstringThe Meta ad account, act_<n>. Read its campaigns, ad sets or ads with level and filtering.
levelstringThe level of each row. Defaults to the ad account.
ad · adset · campaign · account
fieldsarrayMeta insights fields, such as spend or impressions, up to 100.
breakdownsarrayMeta breakdowns, up to 5.
actionBreakdownsarrayAn empty array asks Meta for no action breakdown at all.
actionAttributionWindowsarrayMeta attribution windows, such as 7d_click or 1d_view.
actionReportTimestringimpression, conversion or mixed.
useUnifiedAttributionSettingbooleanUse each ad set's own attribution setting.
filteringarrayMeta filters of field, operator and value, up to 25.
datePresetstringA Meta date preset, such as last_30d. Not with fromDate and toDate.
fromDatestringFirst day, YYYY-MM-DD, sent with toDate.
toDatestringLast day, YYYY-MM-DD, sent with fromDate.
timeIncrementstringDays per row, 1 to 90, or monthly or all_days.
limitintegerRows per page, up to 500. Defaults to 500.
Example: 500
cursorstringThe pagination.nextCursor of the previous page, unchanged.
