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

# Get unique viewers in built-in player

> Get the number of unique viewers in the built-in player. 

Counts the number of unique IPs.

Allows flexible grouping and filtering. The fields in the response depend on the selected grouping.

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_documented/streaming_api.yaml get /streaming/statistics/uniqs
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: '2026-05-07T20:33:46.548242+00:00'
servers:
  - url: https://api.gcore.com
security:
  - APIKey: []
tags:
  - name: AI
    x-displayName: AI
  - name: Broadcasts
    x-displayName: Broadcasts
  - name: Directories
    x-displayName: Directories
  - name: Overlays
    x-displayName: Overlays
  - name: Players
    x-displayName: Players
  - name: Playlists
    x-displayName: Playlists
  - name: QualitySets
    x-displayName: QualitySets
  - name: Restreams
    x-displayName: Restreams
  - name: Streaming Statistics
    x-displayName: Statistics
  - name: Streams
    x-displayName: Streams
  - name: Subtitles
    x-displayName: Subtitles
  - name: Videos
    x-displayName: Videos
paths:
  /streaming/statistics/uniqs:
    get:
      tags:
        - Streaming Statistics
      summary: Get unique viewers in built-in player
      description: >-
        Get the number of unique viewers in the built-in player. 


        Counts the number of unique IPs.


        Allows flexible grouping and filtering. The fields in the response
        depend on the selected grouping.


        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: getUniqs
      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'
        - name: type
          in: query
          description: filter by entity's type
          schema:
            type: string
            enum:
              - live
              - vod
              - playlist
        - name: id
          in: query
          description: filter by entity's id
          schema:
            type: string
        - name: event
          in: query
          description: filter by event's name
          schema:
            type: string
            enum:
              - init
              - start
              - watch
        - name: host
          in: query
          description: filter by host
          schema:
            type: string
        - name: country
          in: query
          description: filter by country
          schema:
            type: string
        - name: group
          in: query
          schema:
            description: group=1,2,4 OR group=1&group=2&group=3
            type: array
            items:
              type: string
              enum:
                - date
                - host
                - os
                - browser
                - platform
                - ip
                - country
                - event
                - id
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/uniqs'
        '400':
          $ref: '#/components/responses/error_bad_request'
        '500':
          $ref: '#/components/responses/error_internal_server'
      x-codeSamples:
        - lang: Python
          source: |-
            import os
            from gcore import Gcore

            client = Gcore(
                api_key=os.environ.get("GCORE_API_KEY"),  # This is the default and can be omitted
            )
            unique_viewers = client.streaming.statistics.get_unique_viewers(
                date_from="date_from",
                date_to="date_to",
            )
            print(unique_viewers.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/G-Core/gcore-go\"\n\t\"github.com/G-Core/gcore-go/option\"\n\t\"github.com/G-Core/gcore-go/streaming\"\n)\n\nfunc main() {\n\tclient := gcore.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tuniqueViewers, err := client.Streaming.Statistics.GetUniqueViewers(context.TODO(), streaming.StatisticGetUniqueViewersParams{\n\t\tDateFrom: \"date_from\",\n\t\tDateTo:   \"date_to\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", uniqueViewers.Data)\n}\n"
components:
  schemas:
    uniqs:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            required:
              - unique_ips
              - date
            properties:
              unique_ips:
                type: integer
              date:
                type: string
              type:
                type: string
              host:
                type: string
              os:
                type: string
              browser:
                type: string
              platform:
                type: string
              ip:
                type: string
              country:
                type: string
              event:
                type: string
              id:
                type: integer
      example:
        data:
          - unique_ips: 100
            date: '2022-10-15'
            type: vod
          - unique_ips: 300
            date: '2022-10-15'
            type: live
    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

````