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

# Get campaign metrics

> Returns the views, spend, CPM and engagement of one campaign. These are the figures on the campaign Analytics tab. A metric that was not measured is null.



## OpenAPI

````yaml /brand-api/openapi.json get /campaigns/{campaign_id}/metrics
openapi: 3.1.0
info:
  title: Clipstake Brand API
  description: >-
    Read the brands, campaigns and clips of your Clipstake account. The API is
    read-only.
  version: 0.1.0
servers:
  - url: https://app.clipstake.com/api/v1/brand
security: []
paths:
  /campaigns/{campaign_id}/metrics:
    get:
      tags:
        - Campaigns
      summary: Get campaign metrics
      description: >-
        Returns the views, spend, CPM and engagement of one campaign. These are
        the figures on the campaign Analytics tab. A metric that was not
        measured is null.
      operationId: campaigns-metrics
      parameters:
        - in: path
          name: campaign_id
          schema:
            type: string
            description: >-
              Campaign ID. Format: cmp_ followed by 32 lowercase hexadecimal
              characters.
            example: cmp_8a1d4e2f6b7c4d9e8f0a1b2c3d4e5f60
          required: true
          description: >-
            Campaign ID. Format: cmp_ followed by 32 lowercase hexadecimal
            characters.
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  campaign_id:
                    type: string
                    pattern: ^cmp_[0-9a-f]{32}$
                    description: Campaign ID.
                    example: cmp_8a1d4e2f6b7c4d9e8f0a1b2c3d4e5f60
                  geo_enabled:
                    type: boolean
                    description: >-
                      True when the campaign pays by the country of the viewers.
                      Then the counted views are only the views from the
                      countries that the campaign pays for.
                    example: false
                  total_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The views that the campaign counts: views on clips that
                      can earn, from the countries that the campaign pays for.
                      This is the number that the campaign dashboard shows.
                    example: 1180000
                  all_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      Every view on every clip of the campaign, including clips
                      that cannot earn.
                    example: 1250000
                  payable_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The views left after the most that one clip can earn, at
                      the highest rate. This is the last stage of the funnel. On
                      a paused campaign it can be more than `paid_views`.
                    example: 1100000
                  funnel:
                    type: array
                    items:
                      type: object
                      properties:
                        stage:
                          type: string
                          description: >-
                            `total`: every view on every clip. `eligible`: views
                            on clips that can earn. `targeted`: views from the
                            countries that the campaign pays for (geo targeting
                            only). `priced`: the views that have a rate, counted
                            at the highest rate of the campaign. `capped`: the
                            same views, after the most that one clip can earn.
                            More values can be added.
                          example: eligible
                        views:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: >-
                            The views that are left after this stage. Each stage
                            is never more than the stage before it.
                          example: 1180000
                      required:
                        - stage
                        - views
                      additionalProperties: false
                      description: One stage of the views funnel.
                    description: >-
                      The views at each stage, from all views to
                      `payable_views`. The stages are in order.
                  goal_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The views that the full budget pays for, at the highest
                      rate of the campaign. 0 when the campaign has no rate.
                    example: 2500000
                  spend_cents:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The amount that the counted views earned, in cents. It is
                      never more than the budget. It includes amounts that are
                      not paid out yet.
                    example: 220000
                  paid_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: The counted views that the spend pays for.
                    example: 1100000
                  free_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The counted views that nobody pays for. A view is free
                      when its clip reached the most that one clip can earn,
                      when the budget is used up, or when it came after the
                      campaign paused.
                    example: 80000
                  selected_cpm_cents:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                    description: >-
                      The rate the campaign pays for 1,000 counted views, in
                      cents, without free views. When clips were paid at
                      different rates, this is the average. Null when no view is
                      counted yet.
                    example: 200
                  selected_cpm_is_average:
                    type: boolean
                    description: >-
                      True when the counted views were paid at more than one
                      rate, so `selected_cpm_cents` is an average.
                    example: false
                  effective_cpm_cents:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                    description: >-
                      The spend for each 1,000 views, in cents, over the views
                      in `effective_cpm_views`. Free views make it lower than
                      `selected_cpm_cents`. Null when there are no views yet.
                    example: 176
                  effective_cpm_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The views that `effective_cpm_cents` divides the spend by:
                      every view, from every country, on the clips that can
                      earn. With geo targeting on, this is more than
                      `total_views`.
                    example: 1250000
                  reach:
                    anyOf:
                      - type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                      - type: 'null'
                    description: >-
                      The unique viewers of each clip, added together. One
                      person who saw two clips counts two times. Null when no
                      clip reported reach.
                    example: 640000
                  reach_clip_count:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The number of clips that reported reach. Compare it with
                      `clip_count`.
                    example: 41
                  reach_clip_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      Every view on the clips that reported reach. Use it to
                      compare reach with views.
                    example: 1020000
                  clip_count:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: The number of clips that can earn.
                    example: 48
                  likes:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: Likes on the clips that can earn.
                    example: 61000
                  comments:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: Comments on the clips that can earn.
                    example: 4300
                  shares:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: Shares of the clips that can earn.
                    example: 2700
                  engagements:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: Likes, comments and shares added together.
                    example: 68000
                  engagement_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      Every view, from every country, on the clips that can
                      earn. `engagement_rate` divides by this number.
                    example: 1250000
                  engagement_rate:
                    description: >-
                      `engagements` divided by `engagement_views`, as a fraction
                      to four decimal places. For example, 0.0544 is 5.44%. Null
                      when there are no views yet.
                    example: 0.0544
                    type:
                      - number
                      - 'null'
                required:
                  - campaign_id
                  - geo_enabled
                  - total_views
                  - all_views
                  - payable_views
                  - funnel
                  - goal_views
                  - spend_cents
                  - paid_views
                  - free_views
                  - selected_cpm_cents
                  - selected_cpm_is_average
                  - effective_cpm_cents
                  - effective_cpm_views
                  - reach
                  - reach_clip_count
                  - reach_clip_views
                  - clip_count
                  - likes
                  - comments
                  - shares
                  - engagements
                  - engagement_views
                  - engagement_rate
                additionalProperties: false
                description: >-
                  The views, spend and engagement of one campaign. These are the
                  figures on the campaign Analytics tab.
              example:
                campaign_id: cmp_8a1d4e2f6b7c4d9e8f0a1b2c3d4e5f60
                geo_enabled: false
                total_views: 1180000
                all_views: 1250000
                payable_views: 1100000
                funnel:
                  - stage: total
                    views: 1250000
                  - stage: eligible
                    views: 1180000
                  - stage: priced
                    views: 1180000
                  - stage: capped
                    views: 1100000
                goal_views: 2500000
                spend_cents: 220000
                paid_views: 1100000
                free_views: 80000
                selected_cpm_cents: 200
                selected_cpm_is_average: false
                effective_cpm_cents: 186
                effective_cpm_views: 1180000
                reach: 640000
                reach_clip_count: 41
                reach_clip_views: 1020000
                clip_count: 48
                likes: 61000
                comments: 4300
                shares: 2700
                engagements: 68000
                engagement_views: 1180000
                engagement_rate: 0.0576
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.UNAUTHORIZED'
              example:
                error:
                  code: unauthorized
                  message: >-
                    Provide a valid API key as `Authorization: Bearer
                    cb_live_...`.
                  request_id: 0b7e4d2c-9a1f-4e3b-8c6d-5f2a1b9c7e34
        '404':
          description: Not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.NOT_FOUND'
              example:
                error:
                  code: not_found
                  message: No such campaign.
                  request_id: 3c9a8b7d-2e1f-4a6b-9c8d-7e6f5a4b3c21
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error.INTERNAL_SERVER_ERROR'
              example:
                error:
                  code: internal_error
                  message: An unexpected error occurred.
                  request_id: 5a4b3c2d-1e0f-4a9b-8c7d-6e5f4a3b2c19
      security:
        - Authorization: []
components:
  schemas:
    error.UNAUTHORIZED:
      type: object
      title: Unauthorized error (401)
      description: The error envelope every failed request returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - unauthorized
              description: A stable, machine-readable error code.
            message:
              type: string
              description: What went wrong, in words a person can act on.
            request_id:
              type: string
              description: The id of this request. Quote it when you contact support.
          required:
            - code
            - message
            - request_id
          additionalProperties: false
      required:
        - error
      additionalProperties: false
    error.NOT_FOUND:
      type: object
      title: Not found error (404)
      description: The error envelope every failed request returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - not_found
              description: A stable, machine-readable error code.
            message:
              type: string
              description: What went wrong, in words a person can act on.
            request_id:
              type: string
              description: The id of this request. Quote it when you contact support.
          required:
            - code
            - message
            - request_id
          additionalProperties: false
      required:
        - error
      additionalProperties: false
    error.INTERNAL_SERVER_ERROR:
      type: object
      title: Internal server error error (500)
      description: The error envelope every failed request returns.
      properties:
        error:
          type: object
          properties:
            code:
              type: string
              enum:
                - internal_error
              description: A stable, machine-readable error code.
            message:
              type: string
              description: What went wrong, in words a person can act on.
            request_id:
              type: string
              description: The id of this request. Quote it when you contact support.
          required:
            - code
            - message
            - request_id
          additionalProperties: false
      required:
        - error
      additionalProperties: false
  securitySchemes:
    Authorization:
      type: http
      scheme: bearer

````

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