Ads

Query ad insights

Changed on

A live performance query for reports the fixed endpoints don't cover, answered by the platform as is (rows snake_cased). The connection's platform picks the contract. Google Ads: any read-only GAQL SELECT in query (search terms, keywords and Quality Score, geo, demographics, assets, shopping, change_event), with counters as strings and cost in micros. Meta: Graph insights fields, breakdowns and filtering on object_id, which must be this connection's ad account (act_…) or one of its campaigns, ad sets or ads. TikTok: ad_account_id, data_level, dimensions, metrics, from and to. A query the platform rejects returns 400 with its message. Follow next_cursor for more rows.

get/ads/insights

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Query parameters

account_id, string required

Connected Meta, Google Ads or TikTok ad channel id (sacct_…).

query, string

Google Ads (required there): a GAQL SELECT, e.g. SELECT search_term_view.search_term, metrics.cost_micros FROM search_term_view WHERE segments.date DURING LAST_30_DAYS. Selecting segments.date needs a finite date filter.

object_id, string

Meta (required there): the insights node, the connection's ad account (act_…) or one of its campaign, ad set or ad ids.

level, string

Meta: row granularity (account, campaign, adset, ad).

fields, string

Meta: comma-separated Graph insights fields, e.g. campaign_name,spend,impressions,actions.

breakdowns, string

Meta: comma-separated breakdowns, e.g. age,gender or publisher_platform.

action_breakdowns, string

Meta: comma-separated action breakdowns; none clears the default action_type breakdown.

action_attribution_windows, string

Meta: comma-separated attribution windows, e.g. 7d_click,1d_view.

action_report_time, string

Meta: when actions are counted: impression, conversion or mixed.

filtering, string

Meta and TikTok: JSON array of [{"field", "operator", "value"}] filters.

date_preset, string

Meta: a date preset such as last_7d, last_30d or this_month, instead of from/to.

time_increment, string

Meta: days per row (1-90), monthly, or all_days.

ad_account_id, string

Google: customer id when the connection has several Google Ads accounts. TikTok (required there): the advertiser id.

report_type, string

TikTok: report type (default BASIC).

data_level, string

TikTok (required there): e.g. AUCTION_CAMPAIGN, AUCTION_ADGROUP, AUCTION_AD.

dimensions, string

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

metrics, string

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

from, string

Start of date range (YYYY-MM-DD). Required on TikTok.

to, string

End of date range (YYYY-MM-DD).

limit, integer

Meta: rows per page.

page_size, integer

TikTok: rows per page.

cursor, string

Cursor for the next page — the next_cursor of the previous response

Response

Rows as the platform returned them.

object required
object, 'list' required
data, object[] required
has_more, boolean required
url, string
next_cursor, string nullable

Changes

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    4 more changes in this revision