Call it
curl https://api.peume.com/v1/call/estimate-audience-reach \
-H "Authorization: Bearer $PEUME_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"input": {
"accountId": "your accountId",
"adAccountId": "your adAccountId"
}
}'const res = await fetch("https://api.peume.com/v1/call/estimate-audience-reach", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.PEUME_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"input": {
"accountId": "your accountId",
"adAccountId": "your adAccountId"
}
}),
});
const { output, cost_usd } = await res.json();import os, requests
res = requests.post(
"https://api.peume.com/v1/call/estimate-audience-reach",
headers={"Authorization": f"Bearer {os.environ['PEUME_API_KEY']}"},
json={
"input": {
"accountId": "your accountId",
"adAccountId": "your adAccountId"
}
},
)
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: estimate-audience-reach.
Parameters
accountIdRequiredstringaccount ID on the target ad platform (the estimate runs against its platform).
adAccountIdRequiredstringRequired. The platform ad-account ID the reach call runs against (Meta act_..., LinkedIn numeric sponsoredAccount ID, Pinterest ad-account ID, X account ID) - every backing reach API is scoped to one ad account. Get it from GET /v1/ads/accounts.
specstringThe targeting spec to estimate. Same shape used by POST /v1/ads/create. Required unless `rawTargeting` is sent; with `rawTargeting` it can be omitted or minimal.
rawTargetingobjectMeta only. A Meta-native targeting spec (snake_case: `geo_locations`, `age_min`, `flexible_spec`, `excluded_custom_audiences`, `user_os`,...), the same field `POST /v1/ads/create` accepts, so the estimate covers the exact audience the ad set will use. Sending it for an account on another platform returns 400 naming `rawTargeting`. For layered targeting, send `flexible_spec` here: entries AND together, ids inside one entry OR. **Merge rules** (same as `POST /v1/ads/create`): - rawTargeting is the BASE layer; `spec`, converted to Meta's wire shape, is merged on top key by key, with `spec` wi
optimizationGoalstringOptional. The optimization goal the estimate should assume (platform's own vocabulary, e.g. Meta `REACH`, `LINK_CLICKS`, `OFFSITE_CONVERSIONS`). Some platforms vary the estimate by goal; omit to use the platform default.
