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

# Retrieve analytics

> Retrieve docuemnt analytics for the authenticated workspace.



## OpenAPI

````yaml GET /documents/{id}/stats
openapi: 3.0.0
info:
  title: Reqlick API
  version: 1.0.0
  description: Reqlick API Documentation
servers:
  - url: https://api.reqlick.com
security:
  - bearerAuth: []
tags:
  - name: Documents
    description: Documents management
  - name: Domains
    description: Domains management
  - name: GoogleAuth
    description: Google Authentication
  - name: Links
    description: Links management
  - name: Payments
    description: Payments management
  - name: QRCodes
    description: QR Codes management
  - name: Resources
    description: Resources management
  - name: Subscriptions
    description: Subscription management
  - name: Users
    description: User management and authentication
  - name: Workspaces
    description: Workspaces management
paths:
  /documents/{id}/stats:
    get:
      tags:
        - Documents
      summary: retrieve document stats
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: Document ID
        - name: workspace
          in: query
          required: true
          schema:
            type: string
          description: Workspace URL
        - name: startDate
          in: query
          required: false
          schema:
            type: string
            format: date
            nullable: true
        - name: endDate
          in: query
          required: false
          schema:
            type: string
            format: date
            nullable: true
      responses:
        '200':
          description: Get detailed analytics data
          content:
            application/json:
              schema:
                type: object
                properties:
                  views:
                    type: array
                    items:
                      type: object
                      properties:
                        id:
                          type: string
                          description: View ID
                          example: 1110580a82031111aaa03333
                        linkId:
                          type: string
                          description: Link ID
                          example: 1110580a82031111aaa03333
                        documentId:
                          type: string
                          description: Document ID
                          example: 1110580a82031111aaa03333
                        projectId:
                          type: string
                          description: Workspace ID
                          example: 6660580a43f1a356b97f64b9
                        viewedAt:
                          type: string
                          format: date-time
                          description: Time when the document was viewed
                          example: '2024-07-17T07:17:04.264Z'
                        isBot:
                          type: boolean
                          description: Indicates if the viewer is a bot
                          example: false
                        qrcodeId:
                          type: string
                          description: QR code ID associated with the view
                          example: null
                        viewData:
                          type: object
                          properties:
                            id:
                              type: string
                              description: View data ID
                              example: 1110580a82031111aaa03333
                            viewId:
                              type: string
                              description: View ID
                              example: 1110580a82031111aaa03333
                            h_userAgent:
                              type: string
                              description: User agent string
                              example: >-
                                Mozilla/5.0 (Windows NT 10.0; Win64; x64)
                                AppleWebKit/537.36 (KHTML, like Gecko)
                                Chrome/126.0.0.0 Safari/537.36
                            h_referer:
                              type: string
                              description: Referrer URL
                              example: https://www.linkedin.com/
                            h_acceptLanguage:
                              type: string
                              description: Accepted languages
                              example: fr-FR,fr;q=0.9,en-US;q=0.8,en;q=0.7
                            h_sec_ch_ua_platform:
                              type: string
                              description: User agent platform
                              example: Windows
                            sessionId:
                              type: string
                              description: Session ID
                              example: 688d2118-acaf-5d2f-854b-5baf4eb5093b
                            b_screen_width:
                              type: integer
                              description: Screen width
                              example: 1366
                            b_screen_height:
                              type: integer
                              description: Screen height
                              example: 768
                            b_hostname:
                              type: string
                              description: Hostname
                              example: rqk.sh
                            b_pathname:
                              type: string
                              description: Pathname
                              example: /try-reqlick
                            b_language:
                              type: string
                              description: Browser language
                              example: fr-FR
                            b_search:
                              type: string
                              description: Search query
                              example: ''
                            b_geo:
                              type: object
                              properties:
                                b_isLocated:
                                  type: boolean
                                  description: Indicates if the location is determined
                                  example: false
                                b_error:
                                  type: object
                                  description: Location error details
                            newProjectVisitor:
                              type: boolean
                              description: Indicates if this is a new project visitor
                              example: false
                            newLinkVisitor:
                              type: boolean
                              description: Indicates if this is a new link visitor
                              example: false
                            v_start_time:
                              type: string
                              format: date-time
                              description: View start time
                              example: '2024-07-17T07:17:04.264Z'
                            v_end_time:
                              type: string
                              format: date-time
                              description: View end time
                              example: '2024-07-23T12:51:17.457Z'
                            updatedAt:
                              type: string
                              format: date-time
                              description: Last update time
                              example: '2024-07-23T12:51:17.458Z'
                            recordingEventsId:
                              type: string
                              description: Recording events ID
                            device:
                              type: string
                              description: Device type
                              example: Desktop
                            screenResolution:
                              type: string
                              description: Screen resolution
                              example: 1366x768
                            deviceVendor:
                              type: string
                              description: Device vendor
                            browser:
                              type: string
                              description: Browser name
                              example: Chrome
                            browserEngine:
                              type: string
                              description: Browser engine
                              example: Blink
                            os:
                              type: string
                              description: Operating system
                              example: Windows
                            source:
                              type: string
                              description: Traffic source
                              example: www.linkedin.com
                            country:
                              type: string
                              description: Country name
                              example: France
                            countryCode:
                              type: string
                              description: Country code
                              example: FR
                            region:
                              type: string
                              description: Region name
                              example: Île-de-France
                            regionCode:
                              type: string
                              description: Region code
                            city:
                              type: string
                              description: City name
                              example: Paris
                            lat:
                              type: number
                              format: float
                              description: Latitude
                              example: 48.8323
                            long:
                              type: number
                              format: float
                              description: Longitude
                              example: 2.4075
                  uniqueVisitorCount:
                    type: integer
                    description: Number of unique visitors
                    example: 4
                  averageVisitTime:
                    type: string
                    description: Average visit time in ms
                    example: '79375.20'
                  chartdata:
                    type: array
                    items:
                      type: object
                      properties:
                        date:
                          type: string
                          description: Date
                          example: Jul 16
                        UniqueVisitors:
                          type: integer
                          description: Number of unique visitors
                          example: 4
                        PageViews:
                          type: integer
                          description: Number of page views
                          example: 5
                        newVisitors:
                          type: integer
                          description: Number of new visitors
                          example: 4
                        returnVisitors:
                          type: integer
                          description: Number of return visitors
                          example: 1
                  links:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Link name
                        value:
                          type: integer
                          description: Value associated with the link
                          example: 7
                  linksMax:
                    type: integer
                    description: Maximum value for links
                    example: 7
                  all:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Name of the source
                          example: www.linkedin.com
                        value:
                          type: integer
                          description: Value associated with the source
                          example: 2
                  allMax:
                    type: integer
                    description: Maximum value for all sources
                    example: 7
                  browsersMax:
                    type: integer
                    description: Maximum value for browsers
                    example: 7
                  osMax:
                    type: integer
                    description: Maximum value for operating systems
                    example: 7
                  devicesMax:
                    type: integer
                    description: Maximum value for devices
                    example: 7
                  deviceTypeMax:
                    type: integer
                    description: Maximum value for device types
                    example: 7
                  browsers:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Browser name
                          example: Chrome
                        value:
                          type: integer
                          description: Value associated with the browser
                          example: 7
                  engines:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Browser engine name
                          example: Blink
                        value:
                          type: integer
                          description: Value associated with the browser engine
                          example: 7
                  os:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Operating system name
                          example: Windows
                        value:
                          type: integer
                          description: Value associated with the operating system
                          example: 5
                  devices:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Device name
                        value:
                          type: integer
                          description: Value associated with the device
                          example: 5
                  deviceType:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Device type name
                          example: Desktop
                        value:
                          type: integer
                          description: Value associated with the device type
                          example: 7
                  languages:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Language name
                          example: French
                        value:
                          type: integer
                          description: Value associated with the language
                          example: 2
                  languagesMax:
                    type: integer
                    description: Maximum value for languages
                    example: 7
                  countries:
                    type: array
                    items:
                      type: object
                      properties:
                        name:
                          type: string
                          description: Country name
                          example: France
                        shortCode:
                          type: string
                          description: Country short code
                          example: FR
                        value:
                          type: integer
                          description: Value associated with the country
                          example: 6
                  regions:
                    type: array
                    items:
                      type: object
                      properties:
                        country:
                          type: string
                          description: Country name
                          example: France
                        name:
                          type: string
                          description: Region name
                          example: Occitanie
                        value:
                          type: integer
                          description: Value associated with the region
                          example: 3
                  cities:
                    type: array
                    items:
                      type: object
                      properties:
                        country:
                          type: string
                          description: Country name
                          example: France
                        name:
                          type: string
                          description: City name
                          example: Toulouse
                        value:
                          type: integer
                          description: Value associated with the city
                          example: 3
                  internetProviders:
                    type: array
                    items:
                      type: object
                      description: List of internet providers
        '401':
          description: Authentication Error
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Authentication Error
                  feedback:
                    type: string
                    example: You are unauthenticated!
        '500':
          description: Internal server error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````