get_ad_performance

Google Ads Read

๐Ÿšจ **IF THIS TOOL RETURNS A QUOTA ERROR:** - The error message will include a clickable upgrade link - Show the FULL error message to the user (it contains the upgrade link) - DO NOT attempt to work ar

Endpoint

POST https://api.adspirer.ai/api/v1/tools/get_ad_performance/execute

Headers

Description

๐Ÿšจ **IF THIS TOOL RETURNS A QUOTA ERROR:** - The error message will include a clickable upgrade link - Show the FULL error message to the user (it contains the upgrade link) - DO NOT attempt to work around the error or use alternative data - DO NOT create campaigns or perform actions without valid tool data - STOP and direct the user to upgrade via the provided link Per-AD performance breakdown โ€” one row per ad, with individual metrics. This tool retrieves READ-ONLY data via 1 live GAQL query (cached 5 min in Redis). Safe to call multiple times. **Why this tool:** `get_campaign_performance` stops at ad-group granularity. When an ad group contains several live ads, this is the only tool that shows which creative is winning so you can pause losers and scale winners. **Returns one row per ad:** - Identity: `ad_id`, `ad_name`, `ad_group_id`, `ad_group_name`, `campaign_id`, `campaign_name` - State: `ad_type` (e.g. DEMAND_GEN_VIDEO_RESPONSIVE_AD, DEMAND_GEN_MULTI_ASSET_AD, RESPONSIVE_SEARCH_AD), `status`, `ad_strength`, `is_live` (ad + ad group + campaign all ENABLED) - Metrics for the date range: `impressions`, `clicks`, `ctr`, `cost`, `conversions`, `conversion_value`, `cpc`, `cpa`, `roas`, `video_views`, `video_view_rate` (video ads) - `totals` block + explicit truncation info (`total_ads_matched` vs `returned`) **Coverage:** Search, Display, Demand Gen, YouTube campaigns. NOT PMax โ€” PMax has no per-ad rows (asset-group model); use `get_pmax_asset_performance` instead. **Row filter:** REMOVED ads excluded. Paused ads are included only if they actually served in the window (so per-ad numbers still roll up to ad-group totals without zero-row noise). **Parameters:** - customer_id: Optional (uses connected account if omitted) - lookback_days: 7, 30, 60, 90, 120 (default 30). Ignored when both start_date and end_date set. - start_date / end_date: YYYY-MM-DD (override lookback_days when both provided) - campaign_id: Optional โ€” scope to one campaign - ad_group_id: Optional โ€” scope to one ad group - limit: Max ads returned, cost-desc (default 100, max 500) **Execution time:** 1-3 seconds (1 GAQL query, then cached 5 min) **Use this tool when:** - User asks "which ad/creative is performing best?" or "which video is winning?" - User wants to pause losing creatives or scale winning ones (follow with pause_ad) - User needs per-ad CTR / CPA / ROAS / video view rate inside an ad group - After get_campaign_performance shows an ad group worth drilling into **Tip:** Pair with `get_ad_creative` to see WHAT each winning/losing ad is made of (videos, images, headlines).

Request body

All tool arguments are wrapped in an arguments object.

FieldTypeDescription
start_datestring optionalStart date (YYYY-MM-DD). If provided with end_date, overrides lookback_days for custom date range queries.
end_datestring optionalEnd date (YYYY-MM-DD). If provided with start_date, overrides lookback_days for custom date range queries.
date_rangestring optionalDate range preset: 'last_7_days', 'last_14_days', 'last_30_days', 'last_60_days', 'last_90_days'. Overrides lookback_days. Ignored if start_date/end_date are provided.
raw_databoolean optionalIf true, return ONLY raw metrics as a JSON code block (spend, clicks, impressions, conversions, CPA, CPC, CTR, CVR, ROAS by campaign/ad/date). Strips severity labels, suggested bids/budgets, industry benchmarks, and optimization recommendations. Use when you run your own attribution model or want to minimize token usage. default: false
customer_idstring optionalGoogle Ads customer ID. Required for multi-account users. Get from get_connections_status.
lookback_daysinteger optionalNumber of days to analyze (7, 30, 60, 90, 120). Default 30. Ignored when both start_date and end_date are provided. default: 30
campaign_idstring optionalOptional. Scope to a single campaign (from list_campaigns). Omit for account-wide per-ad breakdown.
ad_group_idstring optionalOptional. Scope to a single ad group (from get_campaign_structure).
limitinteger optionalMax ads returned, sorted by cost desc (default 100, max 500). Response flags truncation explicitly via total_ads_matched/returned. default: 100

Example request

{
  "arguments": {
    "start_date": "string",
    "end_date": "string",
    "date_range": "string",
    "raw_data": false,
    "customer_id": "string",
    "lookback_days": 30
  }
}

Example responses

200 โ€” Success

{
  "success": true,
  "data": {
    "text": "(tool-specific textual output for get_ad_performance)",
    "quota": {
      "used": 42,
      "limit": 150,
      "tier": "plus",
      "period_end": "2026-05-01"
    }
  },
  "tool": "get_ad_performance"
}

400 โ€” Tool-level error (bad arguments / multi-account selection)

{
  "success": false,
  "error": "You have 25 meta_ads accounts connected. Please specify which account to use by passing the ad_account_id parameter:\n  - Acme Holdings (ad_account_id=\"act_123456789\")\n  - Acme EU (ad_account_id=\"act_987654321\")",
  "is_error": true,
  "tool": "get_ad_performance"
}

402 โ€” Quota exhausted

{
  "success": false,
  "error": "\ud83d\udea8 Monthly limit reached (150/150 tool calls on Plus tier).\nUpgrade to Pro at https://adspirer.ai to keep building.",
  "is_error": true,
  "tool": "get_ad_performance",
  "quota": {
    "used": 150,
    "limit": 150,
    "tier": "plus",
    "period_end": "2026-05-01",
    "upgrade_url": "https://adspirer.ai"
  }
}

Try it live


Adspirer REST API โ€” get an API key at adspirer.ai/keys ยท adspirer.ai