> ## Documentation Index
> Fetch the complete documentation index at: https://gcore-doc-1256a.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Get views by countries in built-in player

> Aggregates the number of views grouping them by country in the built-in player.

Note. This method operates only on data collected by the built-in HTML player. It will not show statistics if you are using another player or viewing in native OS players through direct .m3u8/.mpd/.mp4 links. For such cases, use calculations through CDN (look at method /statistics/cdn/uniqs) or statistics of the players you have chosen.



## OpenAPI

````yaml /api-reference/services_docs_mintlify/streaming_api.yaml get /streaming/statistics/countries
openapi: 3.1.0
info:
  title: Gcore OpenAPI – Streaming API
  description: >-
    This OpenAPI is an aggregated OpenAPI specification that unifies all Gcore
    products into a single file. It covers Cloud, CDN, DNS, WAAP, DDoS
    Protection, Object Storage, Streaming, and FastEdge services.
  version: a86182e33895
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: AI
  - name: Broadcasts
  - name: Directories
  - name: Overlays
  - name: Players
  - name: Playlists
  - name: QualitySets
  - name: Restreams
  - name: Statistics
  - name: Streams
  - name: Subtitles
  - name: Videos
paths:
  /streaming/statistics/countries:
    get:
      tags:
        - Statistics
      summary: Get views by countries in built-in player
      description: >-
        Aggregates the number of views grouping them by country in the built-in
        player.


        Note. This method operates only on data collected by the built-in HTML
        player. It will not show statistics if you are using another player or
        viewing in native OS players through direct .m3u8/.mpd/.mp4 links. For
        such cases, use calculations through CDN (look at method
        /statistics/cdn/uniqs) or statistics of the players you have chosen.
      operationId: getCountries
      parameters:
        - name: date_from
          in: query
          required: true
          description: Start of time frame. Datetime in ISO 8601 format.
          schema:
            type: string
          example: '2024-05-01T00:00:00Z'
        - name: date_to
          in: query
          required: true
          description: End of time frame. Datetime in ISO 8601 format.
          schema:
            type: string
          example: '2024-05-31T23:59:59Z'
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/countries'
        '400':
          $ref: '#/components/responses/error_bad_request'
        '500':
          $ref: '#/components/responses/error_internal_server'
components:
  schemas:
    countries:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            required:
              - views
              - country
              - country_name
            properties:
              views:
                type: integer
              country:
                type: string
              country_name:
                type: string
      example:
        data:
          - views: 100500
            country: AU
            country_name: Australia
          - views: 3000
            country: US
            country_name: United States
    error_common:
      required:
        - data
        - errors
      type: object
      properties:
        data:
          type: array
          items:
            type: string
        errors:
          type: array
          items:
            type: string
  responses:
    error_bad_request:
      description: Bad Request
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_common'
          examples:
            missingParam:
              summary: Missing query param
              value:
                data: []
                errors:
                  - 'from: query param is not set'
    error_internal_server:
      description: Internal Server Error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error_common'
          examples:
            internalServerError:
              summary: Internal Server Error
              value:
                data: []
                errors:
                  - internal server error
  securitySchemes:
    APIKey:
      description: >-
        API key for authentication. Make sure to include the word `apikey`,
        followed by a single space and then your token.

        Example: `apikey 1234$abcdef`
      type: apiKey
      in: header
      name: Authorization

````