> ## 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 VOD watching duration total via CDN

> Calculates the total duration of video watching in minutes. Views of only those videos that meet the specified filters are summed up.


The statistics are taken from the data of CDN and work regardless of which player the views were made with.



## OpenAPI

````yaml /api-reference/services_documented/streaming_api.yaml get /streaming/statistics/vod/watching_duration/total
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-11T15:10:30.328297+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/vod/watching_duration/total:
    get:
      tags:
        - Streaming Statistics
      summary: Get VOD watching duration total via CDN
      description: >-
        Calculates the total duration of video watching in minutes. Views of
        only those videos that meet the specified filters are summed up.



        The statistics are taken from the data of CDN and work regardless of
        which player the views were made with.
      operationId: getVodWatchingDurationTotal
      parameters:
        - name: from
          in: query
          required: false
          description: >-
            Start of the time period for counting minutes of watching. Format is
            date time in ISO 8601. If omitted, the earliest start time for
            viewing is taken
          schema:
            type: string
          example: '2024-05-01T00:00:00Z'
        - name: to
          in: query
          required: false
          description: >-
            End of time frame. Datetime in ISO 8601 format. If omitted, then the
            current time is taken
          schema:
            type: string
          example: '2024-05-31T23:59:59Z'
        - name: slug
          in: query
          required: false
          description: Filter by video's slug
          schema:
            type: string
        - name: client_user_id
          in: query
          required: false
          description: Filter by field "client_user_id"
          schema:
            type: integer
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/vod_watching_total'
        '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
            )

            response =
            client.streaming.statistics.get_vod_watch_time_total_cdn()

            print(response)
        - 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\tresponse, err := client.Streaming.Statistics.GetVodWatchTimeTotalCDN(context.TODO(), streaming.StatisticGetVodWatchTimeTotalCDNParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response)\n}\n"
components:
  schemas:
    vod_watching_total:
      type: array
      items:
        type: object
        required:
          - client
          - duration
        properties:
          client:
            type: integer
          duration:
            type: integer
            format: int64
            description: count of minutes
          slug:
            type: string
          client_user_id:
            type: integer
      example:
        - client: 123
          client_user_id: 102
          duration: 1000
    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

````