PeumeAPI

Social publishing & inbox

Run a Meta Marketing API insights query on one ad account

Reads Meta's insights for one ad account (`act_<n>`). Read its campaigns, ad sets or ads with `level` and `filtering` on the same ad account.

$0.002 per callRuns on an account you connect

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
  }
}'

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

accountIdRequiredstring

The id of the connected account.

adAccountIdRequiredstring

The Meta ad account, act_<n>. Read its campaigns, ad sets or ads with level and filtering.

levelstring

The level of each row. Defaults to the ad account.

ad · adset · campaign · account

fieldsarray

Meta insights fields, such as spend or impressions, up to 100.

breakdownsarray

Meta breakdowns, up to 5.

actionBreakdownsarray

An empty array asks Meta for no action breakdown at all.

actionAttributionWindowsarray

Meta attribution windows, such as 7d_click or 1d_view.

actionReportTimestring

impression, conversion or mixed.

useUnifiedAttributionSettingboolean

Use each ad set's own attribution setting.

filteringarray

Meta filters of field, operator and value, up to 25.

datePresetstring

A Meta date preset, such as last_30d. Not with fromDate and toDate.

fromDatestring

First day, YYYY-MM-DD, sent with toDate.

toDatestring

Last day, YYYY-MM-DD, sent with fromDate.

timeIncrementstring

Days per row, 1 to 90, or monthly or all_days.

limitinteger

Rows per page, up to 500. Defaults to 500.

Example: 500

cursorstring

The pagination.nextCursor of the previous page, unchanged.

Start free · $1 of calls included

Every API your business needs. One key.

7,000+ data and AI APIs behind one key, with backup sources built in.