> ## Documentation Index
> Fetch the complete documentation index at: https://docs.adside.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Insights

> LIVE performance insights straight from the Meta Graph API (impressions, clicks, spend, CTR, CPC, actions) for a campaign, ad set, ad, or account. Supports date presets, custom date ranges, breakdowns, and custom field selection.

If reporting-warehouse tools are available to you in this session (`get_top_creatives_data`, `get_campaign_spend`, `get_account_summary`, `query_reporting`), this tool is the fallback, not the default. Use it only for what the warehouse cannot answer: today and the last 24h, or a breakdown it does not carry. Ranking ads or campaigns over a past period ('which ads should I kill/scale', 'top creatives'), multi-day totals, and week- or month-over-month trends all belong to the warehouse — it aggregates in SQL, answers for every object in one call, and returns a ranked handful of rows instead of one row per object.

This tool returns one raw JSON row per object per time bucket, each carrying full `actions` and `cost_per_action_type` arrays. At `level: 'ad'` over a multi-day range that is tens of thousands of tokens — enough to fill your context and truncate your own answer. If you call it anyway, narrow it: the smallest `limit` that answers the question, an explicit `fields` list, and one call with `time_increment` rather than one call per period.

The response is capped in size. Past that, rows are dropped and a `truncation` object says how many — the rows you get back are an arbitrary page, NOT the top performers, because this endpoint returns no ranking. `summary` is always computed over every fetched row, so totals and averages stay correct even when rows are dropped. If you see `truncation`, do not rank from what remains: ask the warehouse.



## OpenAPI

````yaml /api-reference/openapi.yaml post /meta/mcp#get_insights
openapi: 3.1.0
info:
  title: Multi-Source Ads API
  version: 1.0.0
  description: >-
    Unified API for managing ad campaigns across Meta, LinkedIn, and Google. MCP
    tools are accessed via JSON-RPC 2.0 over HTTP (`POST /{source}/mcp`). Google
    Sheets/Drive endpoints use standard REST.
servers:
  - url: https://api.adside.ai
    description: Production
  - url: http://localhost:3100
    description: Local development
security:
  - bearerAuth: []
tags:
  - name: Accounts
    description: ''
  - name: Ads
    description: ''
  - name: Analytics
    description: ''
  - name: Asset Groups
    description: ''
  - name: Assets
    description: ''
  - name: Audiences
    description: ''
  - name: Campaign Groups
    description: ''
  - name: Campaigns
    description: ''
  - name: Conversions
    description: ''
  - name: Creatives
    description: ''
  - name: Drive
    description: ''
  - name: Google
    description: ''
  - name: Google Ads
    description: ''
  - name: Google Tag Manager
    description: ''
  - name: Keywords
    description: ''
  - name: Linkedin
    description: ''
  - name: Meta
    description: ''
  - name: Meta Reporting
    description: ''
  - name: OAuth
    description: ''
  - name: Other
    description: ''
  - name: Reports
    description: ''
  - name: Sheets
    description: ''
  - name: Targeting
    description: ''
  - name: Tiktok
    description: ''
  - name: Workspace
    description: ''
paths:
  /meta/mcp#get_insights:
    post:
      tags:
        - Meta
        - Analytics
      summary: Get Insights
      description: >-
        LIVE performance insights straight from the Meta Graph API (impressions,
        clicks, spend, CTR, CPC, actions) for a campaign, ad set, ad, or
        account. Supports date presets, custom date ranges, breakdowns, and
        custom field selection.


        If reporting-warehouse tools are available to you in this session
        (`get_top_creatives_data`, `get_campaign_spend`, `get_account_summary`,
        `query_reporting`), this tool is the fallback, not the default. Use it
        only for what the warehouse cannot answer: today and the last 24h, or a
        breakdown it does not carry. Ranking ads or campaigns over a past period
        ('which ads should I kill/scale', 'top creatives'), multi-day totals,
        and week- or month-over-month trends all belong to the warehouse — it
        aggregates in SQL, answers for every object in one call, and returns a
        ranked handful of rows instead of one row per object.


        This tool returns one raw JSON row per object per time bucket, each
        carrying full `actions` and `cost_per_action_type` arrays. At `level:
        'ad'` over a multi-day range that is tens of thousands of tokens —
        enough to fill your context and truncate your own answer. If you call it
        anyway, narrow it: the smallest `limit` that answers the question, an
        explicit `fields` list, and one call with `time_increment` rather than
        one call per period.


        The response is capped in size. Past that, rows are dropped and a
        `truncation` object says how many — the rows you get back are an
        arbitrary page, NOT the top performers, because this endpoint returns no
        ranking. `summary` is always computed over every fetched row, so totals
        and averages stay correct even when rows are dropped. If you see
        `truncation`, do not rank from what remains: ask the warehouse.
      operationId: meta_get_insights
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - jsonrpc
                - method
                - params
              properties:
                jsonrpc:
                  type: string
                  const: '2.0'
                id:
                  type: string
                  example: '1'
                method:
                  type: string
                  const: tools/call
                params:
                  type: object
                  required:
                    - name
                    - arguments
                  properties:
                    name:
                      type: string
                      const: get_insights
                    arguments:
                      $ref: '#/components/schemas/meta_get_insights_input'
      responses:
        '200':
          description: JSON-RPC response with tool result
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpToolResponse'
        '401':
          description: Missing or invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '403':
          description: Channel not connected or access denied
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - bearerAuth: []
components:
  schemas:
    meta_get_insights_input:
      type: object
      properties:
        object_id:
          description: >-
            ID of the object to get insights for. Omit it to use the connected
            ad account (recommended for account-wide queries at any level).
            Otherwise pass a campaign ID, ad set ID, or ad ID matching `level`.
            Account IDs other than the connected account are rejected. Passing a
            page/business/user ID returns Meta error #100.
          type: string
        level:
          type: string
          enum:
            - account
            - campaign
            - adset
            - ad
          description: Level of insights to retrieve
        date_preset:
          description: Date preset for insights
          type: string
          enum:
            - today
            - yesterday
            - last_3d
            - last_7d
            - last_14d
            - last_28d
            - last_30d
            - last_90d
            - this_week_mon_today
            - this_week_sun_today
            - last_week_mon_sun
            - last_week_sun_sat
            - this_month
            - last_month
            - this_quarter
            - last_quarter
            - this_year
            - last_year
            - maximum
            - data_maximum
        time_range:
          description: Custom date range for insights
          type: object
          properties:
            since:
              type: string
              pattern: ^\d{4}-\d{2}-\d{2}$
              description: Start date (YYYY-MM-DD)
            until:
              type: string
              pattern: ^\d{4}-\d{2}-\d{2}$
              description: End date (YYYY-MM-DD)
          required:
            - since
            - until
        fields:
          description: Specific fields to retrieve (e.g., impressions, clicks, spend)
          type: array
          items:
            type: string
        breakdowns:
          description: Breakdown dimensions (e.g., age, gender, placement)
          type: array
          items:
            type: string
        time_increment:
          description: >-
            Time granularity: "monthly" for monthly rows, "all_days" for daily
            rows, or a number 1-90 for N-day increments
          anyOf:
            - type: string
              enum:
                - monthly
                - all_days
            - type: integer
              minimum: 1
              maximum: 90
        limit:
          default: 25
          description: Number of insights to return
          type: number
          minimum: 1
          maximum: 100
      required:
        - level
      $schema: http://json-schema.org/draft-07/schema#
    McpToolResponse:
      type: object
      properties:
        jsonrpc:
          type: string
          const: '2.0'
        id:
          type: string
        result:
          type: object
          properties:
            content:
              type: array
              items:
                type: object
                properties:
                  type:
                    type: string
                    const: text
                  text:
                    type: string
                    description: JSON-stringified tool result
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error message
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - NOT_FOUND
            - RATE_LIMITED
            - INTERNAL_ERROR
          description: Error code
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key (sk_live_*) — SHA256 hashed, looked up in Redis. Generate via
        the web app's workspace settings.

````