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

> Returns the views and spend of one campaign for each country, most views first. The country of a view comes from the audience of the account that posted the clip.



## OpenAPI

````yaml /agency-api/openapi.json get /campaigns/{campaign_id}/countries
openapi: 3.1.0
info:
  title: Clipstake Agency API
  description: >-
    Read your agency's brands, campaigns and clips, and create campaigns with an
    API key that has write access.
  version: 0.1.0
servers:
  - url: https://app.clipstake.com/api/v1/agency
security: []
paths:
  /campaigns/{campaign_id}/countries:
    get:
      tags:
        - Campaigns
      summary: Get campaign countries
      description: >-
        Returns the views and spend of one campaign for each country, most views
        first. The country of a view comes from the audience of the account that
        posted the clip.
      operationId: campaigns-countries
      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
                  total_views:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      Every view on the clips that can earn. The countries and
                      `other` add up to this number.
                    example: 1180000
                  total_spend_cents:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The spend of every country and `other` added together, in
                      cents.
                    example: 236000
                  budget_cents:
                    type: integer
                    minimum: -9007199254740991
                    maximum: 9007199254740991
                    description: >-
                      The campaign budget, in cents. `spend_percent` is a
                      percentage of this amount.
                    example: 500000
                  countries:
                    type: array
                    items:
                      type: object
                      properties:
                        country_code:
                          type: string
                          description: >-
                            The two-letter ISO 3166-1 country code, in upper
                            case.
                          example: US
                        views:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: >-
                            The views from this country, estimated from the
                            audience of each clip's account.
                          example: 410000
                        views_percent:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: >-
                            The views from this country as a percentage of
                            `total_views`, rounded. The countries and `other`
                            add up to 100.
                          example: 35
                        spend_cents:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: >-
                            The amount that the views from this country earned,
                            in cents, at the campaign rates and after the most
                            that one clip can earn.
                          example: 82000
                        spend_percent:
                          type: integer
                          minimum: -9007199254740991
                          maximum: 9007199254740991
                          description: >-
                            `spend_cents` as a percentage of the budget,
                            rounded.
                          example: 16
                      required:
                        - country_code
                        - views
                        - views_percent
                        - spend_cents
                        - spend_percent
                      additionalProperties: false
                      description: The views and spend from one country.
                    description: Each country, most views first.
                  other:
                    type: object
                    properties:
                      views:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: >-
                          Views that have no country. This is
                          `unattributed_views` plus `views_without_geo_data`.
                        example: 52000
                      views_percent:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: '`views` as a percentage of `total_views`, rounded.'
                        example: 4
                      spend_cents:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: The amount that these views earned, in cents.
                        example: 6400
                      spend_percent:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: '`spend_cents` as a percentage of the budget, rounded.'
                        example: 1
                      unattributed_views:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: >-
                          Views on clips with audience data, from the part of
                          the audience that has no country.
                        example: 30000
                      views_without_geo_data:
                        type: integer
                        minimum: -9007199254740991
                        maximum: 9007199254740991
                        description: Views on clips whose account has no audience data.
                        example: 22000
                    required:
                      - views
                      - views_percent
                      - spend_cents
                      - spend_percent
                      - unattributed_views
                      - views_without_geo_data
                    additionalProperties: false
                    description: The views that have no country.
                required:
                  - campaign_id
                  - total_views
                  - total_spend_cents
                  - budget_cents
                  - countries
                  - other
                additionalProperties: false
                description: >-
                  Where the viewers of a campaign's clips are. These are the
                  figures on the campaign Analytics tab.
              example:
                campaign_id: cmp_8a1d4e2f6b7c4d9e8f0a1b2c3d4e5f60
                total_views: 1180000
                total_spend_cents: 220000
                budget_cents: 500000
                countries:
                  - country_code: US
                    views: 610000
                    views_percent: 52
                    spend_cents: 114000
                    spend_percent: 23
                  - country_code: GB
                    views: 290000
                    views_percent: 25
                    spend_cents: 54000
                    spend_percent: 11
                  - country_code: CA
                    views: 228000
                    views_percent: 19
                    spend_cents: 42000
                    spend_percent: 8
                other:
                  views: 52000
                  views_percent: 4
                  spend_cents: 10000
                  spend_percent: 2
                  unattributed_views: 30000
                  views_without_geo_data: 22000
        '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
                    ck_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.