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

# Fetch analytics

> Fetch analytics



## OpenAPI

````yaml get /analytics
openapi: 3.0.3
info:
  title: Video API
  description: Use our Video API to handle your video storage, transcoding and delivery.
  contact:
    name: Vidbeo Support
    url: https://www.vidbeo.com
    email: support@vidbeo.com
  version: 2.0.0
servers:
  - url: https://api.vidbeo.com/v2
security:
  - bearerAuth: []
tags:
  - name: Analytics
  - name: API keys
  - name: Audit logs
  - name: Categories
  - name: Folders
  - name: Identity providers
  - name: Invites
  - name: JWT keys
  - name: Players
  - name: Services
  - name: Stream keys
  - name: Tokens
  - name: Transcribes
  - name: Uploads
  - name: Users
  - name: Videos
paths:
  /analytics:
    get:
      tags:
        - Analytics
      summary: Fetch analytics
      description: Fetch analytics
      parameters:
        - $ref: '#/components/parameters/analyticsDimension'
        - $ref: '#/components/parameters/analyticsMetric'
        - $ref: '#/components/parameters/analyticsStart'
        - $ref: '#/components/parameters/analyticsEnd'
        - $ref: '#/components/parameters/analyticsFilter'
        - $ref: '#/components/parameters/analyticsBy'
        - $ref: '#/components/parameters/analyticsLimit'
      responses:
        '200':
          $ref: '#/components/responses/Analytics'
        '400':
          $ref: '#/components/responses/Error400'
components:
  parameters:
    analyticsDimension:
      name: dimension
      in: query
      description: The bucket each value falls into (the x-axis)
      required: true
      schema:
        type: string
        enum:
          - day
          - country
          - domain
        example: day
    analyticsMetric:
      name: metric
      in: query
      description: The value within each metric (the y-axis))
      required: true
      schema:
        type: string
        enum:
          - views
        example: views
    analyticsStart:
      name: start
      in: query
      description: The start date
      required: true
      schema:
        type: string
        format: date
        example: '2023-12-20T00:00:00.000Z'
    analyticsEnd:
      name: end
      in: query
      description: The end date
      required: true
      schema:
        type: string
        format: date
        example: '2023-12-21T00:00:00.000Z'
    analyticsFilter:
      name: filter
      in: query
      description: >-
        Only include events that match a particular restriction. For example to
        only include the views for a particular video ID. This should be
        'name:operator:value'. You need to URL-encode the value if it contains
        non-alphanumeric characters
      required: false
      schema:
        type: string
        example: video_id:eq:abcde12345abcde12345a
    analyticsBy:
      name: by
      in: query
      description: >-
        Order by the x-axis (the chosen dimension) or y-axis (the chosen
        metric). For example to see the days that had the most views, you would
        use 'views'. If you were plotting the results on a graph, you might like
        to use 'date'
      required: false
      schema:
        type: string
        enum:
          - views
        example: views
    analyticsLimit:
      name: limit
      in: query
      description: >-
        The number of rows returned. Useful to show the top X, such as the top
        10
      required: false
      schema:
        type: integer
        minimum: 1
        maximum: 100
        example: 10
  responses:
    Analytics:
      description: Analytics
      content:
        application/json:
          schema:
            type: object
            required:
              - success
              - result
              - links
              - errors
            properties:
              success:
                type: boolean
                example: true
              result:
                type: array
                items:
                  $ref: '#/components/schemas/AnalyticsRow'
              links:
                type: object
                example: {}
              errors:
                type: array
                items:
                  type: object
                minLength: 0
                maxLength: 0
                example: []
    Error400:
      description: Invalid request
      content:
        application/json:
          schema:
            type: object
            required:
              - success
              - result
              - links
              - errors
            properties:
              success:
                type: boolean
                example: false
              result:
                type: object
                example: {}
              links:
                type: object
                example: {}
              errors:
                type: array
                items:
                  type: object
                  properties:
                    message:
                      type: string
                      example: Invalid data sent
            example:
              success: false
              result: {}
              links: {}
              errors:
                - message: Invalid data sent
  schemas:
    AnalyticsRow:
      type: object
      properties:
        day:
          type: string
          format: date
          example: '2023-12-20'
        country:
          type: string
          enum:
            - gb
            - de
            - es
            - us
            - unknown
          example: gb
        domain:
          type: string
          example: example.com
        views:
          type: integer
          example: 25
      example:
        day: '2023-12-21'
        views: 10
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````