PeumeAPI

Ads

Flexible live insights query

Runs a custom performance query against Meta, Google Ads or TikTok and returns the platform's rows as is, for reports the fixed endpoints don't cover. The account's platform picks the contract.

$0.002 per callRuns on an account you connect

Call it

curl https://api.peume.com/v1/call/flexible-live-insights-query \
  -H "Authorization: Bearer $PEUME_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "input": {
    "accountId": "your accountId",
    "reportType": "BASIC",
    "page": 1,
    "pageSize": 100,
    "limit": 25
  }
}'

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: flexible-live-insights-query.

Parameters

accountIdRequiredstring

SocialAccount id (posting or ads variant); its platform selects the Meta, Google or TikTok contract.

objectIdstring

Meta only (required there): insights node (act_<n>, campaign id, ad set id or ad id).

querystring

Google only (required there): the GAQL SELECT statement to run.

adAccountIdstring

Google: platform ad account ID (Google customer ID, digits only) when the connection has several Google Ads accounts. TikTok (required there): the advertiser id.

reportTypestring

TikTok only: report_type.

BASIC · AUDIENCE

Example: BASIC

dataLevelstring

TikTok only (required there): data_level.

AUCTION_ADVERTISER · AUCTION_CAMPAIGN · AUCTION_ADGROUP · AUCTION_AD

dimensionsstring

TikTok only (required there): 1-4 comma-separated TikTok dimensions (e.g. country_code, campaign_id, stat_time_day).

metricsstring

TikTok only (required there): comma-separated TikTok metrics (e.g. reach,impressions,frequency,spend).

pageinteger

TikTok only: page number.

Example: 1

pageSizeinteger

TikTok only: rows per page.

Example: 100

customerIdstring

Alias of adAccountId, kept for existing callers

pageTokenstring

Google only: cursor from paging.nextPageToken of the previous page.

levelstring

Row granularity

ad · adset · campaign · account

fieldsstring

Comma-separated Graph insights fields (e.g. spend,impressions,frequency,website_purchase_roas). Omitted = Meta's default set.

breakdownsstring

Meta only: comma-separated Graph breakdowns (e.g. age,gender or publisher_platform). Returns 400 on TikTok (add the breakdown to dimensions with reportType=AUDIENCE, e.g. dimensions=campaign_id,placement) and on Google (select segments.* in the query).

actionBreakdownsstring

Comma-separated Graph action breakdowns; segments the actions[] arrays in each row. Pass `none` to clear Meta's default action_type breakdown, required to combine some non-action breakdowns such as instagram_ads_follow_type (otherwise Meta returns a (#100) invalid-combination error).

actionAttributionWindowsstring

Comma-separated Meta attribution windows. Action values are returned keyed per window.

actionReportTimestring

When actions are counted: impression, conversion or mixed.

useUnifiedAttributionSettingboolean

Use the ad sets' own attribution settings for action counting.

filteringstring

JSON array of filter objects: [{"field", "operator", "value"}]. Applied server-side by Meta or TikTok (TikTok fields e.g. campaign_ids, adgroup_ids, ad_ids).

datePresetstring

Meta date_preset (e.g. last_7d, last_30d, this_month). Mutually exclusive with fromDate/toDate.

fromDatestring

Start of range (YYYY-MM-DD); requires toDate. Required on TikTok.

toDatestring

End of range (YYYY-MM-DD); requires fromDate.

timeIncrementstring

Days per row (1-90), monthly, or all_days.

limitinteger

Rows per page

Example: 25

afterstring

Cursor from paging.after of the previous page.

Start free · $1 of calls included

Every API your product needs. One key.

7,267 endpoints, one bill, and you only pay for calls that work.