> ## 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 analytics for the authenticated workspace.



## OpenAPI

````yaml GET /workspaces/{url}/analytics/stats
openapi: 3.1.0
info:
  title: Reqlick API
  description: >-
    REST API for Reqlick — link shortening, QR codes, file-to-link, custom
    domains and analytics.


    Authenticate with a workspace API key (`Authorization: Bearer rqk_...`),
    created under Settings → API Keys.


    A key is scoped to the single workspace it was created in. Using it against
    a different workspace returns 403, even when the owning user is a member of
    both.


    API access requires a paid plan.
  version: 3.0.0
  contact:
    name: Reqlick Support
    email: support@reqlick.com
servers:
  - url: https://api.reqlick.com
security:
  - bearerAuth: []
tags:
  - name: Links
  - name: QR Codes
  - name: Documents
  - name: Domains
  - name: Workspaces
  - name: Users
  - name: Subscriptions
paths:
  /workspaces/{url}/analytics/stats:
    get:
      tags:
        - Workspaces
      summary: Retrieve geographic analytics
      description: >-
        Country, region or city breakdown. Optionally scoped to a single link or
        document.
      operationId: getWorkspaceGeoStats
      parameters:
        - $ref: '#/components/parameters/WorkspaceSlug'
        - $ref: '#/components/parameters/StartDate'
        - $ref: '#/components/parameters/EndDate'
        - name: selector
          in: query
          description: Breakdown dimension.
          schema:
            type: string
            enum:
              - country
              - region
              - city
            default: country
        - name: linkId
          in: query
          description: Scope to one link.
          schema:
            type: string
        - name: documentId
          in: query
          description: Scope to one document's links.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GeoStats'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
        '404':
          $ref: '#/components/responses/NotFound'
components:
  parameters:
    WorkspaceSlug:
      name: url
      in: path
      required: true
      description: Workspace slug.
      schema:
        type: string
    StartDate:
      name: startDate
      in: query
      description: ISO date. Defaults to 30 days ago.
      schema:
        type: string
        format: date
    EndDate:
      name: endDate
      in: query
      description: >-
        ISO date. Defaults to today. The window is half-open: the end day is
        included.
      schema:
        type: string
        format: date
  schemas:
    GeoStats:
      type: object
      properties:
        total_views:
          type: integer
        list:
          type: array
          items:
            type: object
            properties:
              label:
                type: string
                description: Resolved display name, e.g. `France`.
              shortCode:
                type: string
                description: ISO alpha-2 country code.
              country:
                type: string
                description: Present for region and city selectors.
              total_views:
                type: integer
              new_views:
                type: integer
                description: Distinct visitors.
    Error:
      type: object
      properties:
        error:
          type: string
      required:
        - error
  responses:
    Unauthorized:
      description: >-
        Missing, malformed or revoked API key — or the plan no longer includes
        API access
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Forbidden:
      description: Authenticated, but the key has no access to this workspace or resource
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: This API key does not have access to this workspace
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Workspace API key, prefixed `rqk_`.

````