> ## 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.

# Performance query

> Query ad performance

CLI: `adside reporting performance query`



## OpenAPI

````yaml /api-reference/openapi.yaml post /v1/workspaces/{workspaceId}/reporting/performance/query
openapi: 3.1.0
info:
  title: Adside API
  version: 1.0.0
  description: >-
    Campaigns, creatives, assets and reporting across your ad accounts. Call it
    with a personal API key as a bearer token, or with the `adside` CLI: each
    page names its command.
servers:
  - url: https://api.adside.ai
    description: Production
security:
  - userAccess: []
tags:
  - name: Account
  - name: Reporting
  - name: Meta
  - name: Google Ads
  - name: LinkedIn
  - name: TikTok
  - name: Reddit
  - name: Snapchat
  - name: X
  - name: Google Tag Manager
  - name: Creatives
  - name: Creative styles
  - name: Media
  - name: Characters
  - name: Assets
  - name: Brands
  - name: Brain
  - name: Research
  - name: Boards
  - name: Artifacts
  - name: Audiences
  - name: Ad comments
  - name: Publications
  - name: Routines
  - name: Skills
  - name: To-dos
  - name: Audit
  - name: Credits
paths:
  /v1/workspaces/{workspaceId}/reporting/performance/query:
    post:
      tags:
        - Reporting
      summary: Performance query
      description: |-
        Query ad performance

        CLI: `adside reporting performance query`
      operationId: reporting.performance.query
      parameters:
        - name: workspaceId
          in: path
          required: true
          schema:
            type: string
            minLength: 1
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $schema: https://json-schema.org/draft/2020-12/schema
              type: object
              properties:
                level:
                  default: campaign
                  description: What each result row represents. Defaults to campaign.
                  type: string
                  enum:
                    - channel
                    - campaign
                    - ad
                from:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: Inclusive start date, yyyy-MM-dd.
                to:
                  type: string
                  pattern: ^\d{4}-\d{2}-\d{2}$
                  description: Inclusive end date, yyyy-MM-dd.
                metrics:
                  description: >-
                    Metrics to show per row. Defaults to spend, impressions,
                    clicks, ctr, cpc, cpm. reach, conversions and
                    costPerConversion need level `ad`.
                  minItems: 1
                  type: array
                  items:
                    type: string
                    enum:
                      - spend
                      - impressions
                      - clicks
                      - ctr
                      - cpc
                      - cpm
                      - reach
                      - conversions
                      - costPerConversion
                orderBy:
                  default: spend
                  description: Metric to rank rows by. Defaults to spend.
                  type: string
                  enum:
                    - spend
                    - impressions
                    - clicks
                    - ctr
                    - cpc
                    - cpm
                    - reach
                    - conversions
                    - costPerConversion
                orderDirection:
                  default: desc
                  description: Sort direction. Defaults to desc (highest first).
                  type: string
                  enum:
                    - asc
                    - desc
                limit:
                  default: 10
                  description: Maximum rows to return (1-50). Defaults to 10.
                  type: integer
                  minimum: 1
                  maximum: 50
                channels:
                  description: >-
                    Channel filter for level `channel` or `campaign`, e.g.
                    ["META", "GOOGLE_SEARCH"]. Omit for every channel.
                  type: array
                  items:
                    type: string
                    enum:
                      - META
                      - TIKTOK
                      - LINKEDIN
                      - SNAPCHAT
                      - REDDIT
                      - GOOGLE_SEARCH
                      - GOOGLE_SHOPPING
                      - GOOGLE_DEMAND_GEN
                      - GOOGLE_VIDEO
                      - GOOGLE_DISPLAY
                      - GOOGLE_PERFORMANCE_MAX
                      - GOOGLE_OTHER
                source:
                  default: META
                  description: >-
                    Level `ad` only: the ad platform to read ads from. Defaults
                    to META.
                  type: string
                  enum:
                    - META
                    - TIKTOK
                    - GOOGLE
                    - LINKEDIN
                    - SNAPCHAT
                    - REDDIT
                campaignName:
                  description: 'Level `ad` only: keep ads whose campaign name contains this.'
                  type: string
                  minLength: 1
                  maxLength: 200
                adSetName:
                  description: >-
                    Level `ad` only: keep ads whose ad set name contains this
                    (Meta).
                  type: string
                  minLength: 1
                  maxLength: 200
                conversionEvent:
                  description: >-
                    Level `ad` only: the platform conversion event to count
                    (e.g. a Meta action_type). Defaults to the workspace's
                    primary mapped conversion for that platform.
                  type: string
                  minLength: 1
                  maxLength: 256
                timeSeries:
                  default: false
                  description: >-
                    Level `channel` or `campaign`: also return totals per time
                    bucket.
                  type: boolean
                granularity:
                  default: day
                  description: 'Bucket width for the time series: day, week or month.'
                  type: string
                  enum:
                    - day
                    - week
                    - month
                compareWithPreviousPeriod:
                  default: false
                  description: >-
                    Level `channel` or `campaign`: compare with the equally long
                    period just before `from`.
                  type: boolean
              required:
                - from
                - to
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $schema: https://json-schema.org/draft/2020-12/schema
                type: object
                properties:
                  text:
                    type: string
                required:
                  - text
                additionalProperties: false
      security:
        - userAccess: []
components:
  securitySchemes:
    userAccess:
      type: http
      scheme: bearer
      description: >-
        A personal API key (`adside_pat_…`) or a token from `adside login`.
        Either carries the permissions of the person it belongs to.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.