get_meta_adset_performance

Meta Ads Read

User wants ad-set-level Meta performance — the middle layer between campaigns and individual ads

Endpoint

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

Headers

Description

User wants ad-set-level Meta performance — the middle layer between campaigns and individual ads. Use this when the user asks about ad set performance, has accounts with one campaign and many ad sets, or wants to compare audiences/budgets at the ad set level. This tool fills the gap between `get_meta_campaign_performance` (campaign rollups) and `analyze_meta_ad_performance` (per-ad creatives). Returns: - Per-ad-set metrics: spend, impressions, CTR, frequency, conversions, CPA, ROAS, reach - Top performing ad sets (ranked by ROAS when conversions exist, else CTR) - Underperforming ad sets (high spend, zero conversions, or ROAS < 1) - Frequency fatigue alerts (frequency ≥ 3.0) - Recommendations for budget reallocation and creative refresh When to use this tool: - "How are my Meta ad sets performing?" - "Which ad sets in this campaign are best?" - "Compare ad set performance across audiences" - "Find ad sets with high frequency" - "Which ad sets should I scale or pause?" - Any question about ad-set-level (ad group / audience-level) Meta performance Parameters: - lookback_days: 7, 14, 30 (default), 60, or 90 days - date_range: preset alternative to lookback_days / start_date / end_date. One of: 'last_7_days', 'last_14_days', 'last_30_days', 'last_60_days', 'last_90_days'. (Both 'last_30_days' and 'last_30d' / 'last_month' aliases accepted.) - start_date: Optional start date (YYYY-MM-DD). Overrides lookback_days when used with end_date. - end_date: Optional end date (YYYY-MM-DD). Overrides lookback_days when used with start_date. ⚠️ DATE CLARIFICATION: If the user's date request is vague or ambiguous (e.g., "March to June" without a year, "last quarter", "recently"), ask the user to specify exact dates before calling this tool. - campaign_id: Optional - filter to a single campaign (recommended when one campaign has many ad sets) - include_video_metrics: true (default) or false - include_recommendations: true (default) or false - limit: max ad sets to return (default 100, max 200) - offset: pagination offset (default 0) - ad_account_id: Required for multi-account users. Get from get_connections_status. Execution time: 1-3 seconds (cached database query) Data source: ad_group_daily_metrics table (Meta ad sets stored as ad groups)

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
lookback_daysinteger optionalNumber of days to analyze (7, 14, 30, 60, or 90 days). Default is 30 days. default: 30
campaign_idstring optionalFilter to a single campaign ID (optional). Useful when one campaign contains many ad sets.
include_video_metricsboolean optionalInclude video completion metrics (25%, 50%, 75%, 100% watched) per ad set. Default is true. default: true
include_recommendationsboolean optionalInclude optimization recommendations. Default is true. default: true
limitinteger optionalMaximum number of ad sets to return (default 100, max 200). Use with offset for pagination. default: 100
offsetinteger optionalNumber of ad sets to skip for pagination (default 0). Use with limit to get next page. default: 0
ad_account_idstring optionalMeta Ad Account ID. Required for multi-account users. Get from get_connections_status.

Example request

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

Example responses

200 — Success

{
  "success": true,
  "data": {
    "text": "(tool-specific textual output for get_meta_adset_performance)",
    "quota": {
      "used": 42,
      "limit": 150,
      "tier": "plus",
      "period_end": "2026-05-01"
    }
  },
  "tool": "get_meta_adset_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_meta_adset_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_meta_adset_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