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

# Get URL Statistics

> This endpoint allows you to retrieve comprehensive statistics about a shortened URL, including click analytics, browser data, geographical information, and more.



## OpenAPI

````yaml /openapi-v0.json post /stats/{shortCode}
openapi: 3.0.3
info:
  title: Spoo.me API
  description: >-
    Spoo.me is a free and open-source URL shortening service that provides
    powerful features for creating and managing shortened URLs with
    comprehensive analytics.
  version: 0.0.1
  contact:
    name: Spoo.me Support
    url: https://spoo.me/contact
    email: support@spoo.me
  license:
    name: Apache 2.0
    url: https://github.com/spoo-me/spoo/blob/main/LICENSE
servers:
  - url: https://spoo.me
    description: Production server
security: []
tags:
  - name: URL Shortening
    description: Operations for creating shortened URLs
  - name: Analytics
    description: Operations for retrieving URL analytics and statistics
  - name: Data Export
    description: Operations for exporting URL data in various formats
paths:
  /stats/{shortCode}:
    post:
      tags:
        - Analytics
      summary: Get URL Statistics
      description: >-
        This endpoint allows you to retrieve comprehensive statistics about a
        shortened URL, including click analytics, browser data, geographical
        information, and more.
      operationId: getUrlStatistics
      parameters:
        - name: shortCode
          in: path
          required: true
          description: >-
            The short code of the URL. Can represent the short code of both
            regular and emoji URLs.
          schema:
            type: string
          example: exa
      requestBody:
        required: false
        content:
          application/x-www-form-urlencoded:
            schema:
              type: object
              properties:
                password:
                  type: string
                  description: >-
                    Password of the shortened URL if it's password protected.
                    Required only for password-protected URLs.
                  example: Example@12
      responses:
        '200':
          description: URL statistics retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UrlStatistics'
        '400':
          description: Invalid password
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: PasswordError
                message: Invalid password
        '404':
          description: URL not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: UrlError
                message: The requested URL never existed
components:
  schemas:
    UrlStatistics:
      type: object
      properties:
        _id:
          type: string
          description: The short code of the shortened URL
        short_code:
          type: string
          description: The short code of the shortened URL
        url:
          type: string
          format: uri
          description: Original long URL that the short link redirects to
        total-clicks:
          type: integer
          description: Total number of clicks since the short link was created
        total_unique_clicks:
          type: integer
          description: Total number of unique clicks since the short link was created
        creation-date:
          type: string
          format: date
          description: Date when the short link was created
        last-click:
          type: string
          format: date-time
          description: Timestamp of the last time the short link was accessed
          nullable: true
        last-click-browser:
          type: string
          description: Last browser used to access the short link
          nullable: true
        last-click-os:
          type: string
          description: Last operating system used to access the short link
          nullable: true
        average_daily_clicks:
          type: number
          format: float
          description: Average clicks per day since the link was created
        average_weekly_clicks:
          type: number
          format: float
          description: Average clicks per week since the link was created
        average_monthly_clicks:
          type: number
          format: float
          description: Average clicks per month since the link was created
        average_redirection_time:
          type: number
          format: float
          description: Average redirection time of the short link in milliseconds
        max-clicks:
          type: integer
          description: Maximum clicks set by the user
          nullable: true
        password:
          type: string
          description: Password set by the user
          nullable: true
        expired:
          type: boolean
          description: Whether the link has expired
          nullable: true
        block-bots:
          type: boolean
          description: Whether bots are blocked from accessing the short link
        counter:
          type: object
          description: Data about clicks per day since the link was created
          additionalProperties:
            type: integer
        unique_counter:
          type: object
          description: Data about unique clicks per day since the link was created
          additionalProperties:
            type: integer
        browser:
          type: object
          description: Data about the browsers used to access the short link
          additionalProperties:
            type: integer
        unique_browser:
          type: object
          description: Data about unique browsers used to access the short link
          additionalProperties:
            type: integer
        os_name:
          type: object
          description: Data about the operating systems used to access the short link
          additionalProperties:
            type: integer
        unique_os_name:
          type: object
          description: Data about unique operating systems used to access the short link
          additionalProperties:
            type: integer
        country:
          type: object
          description: Data about the countries from which the short link was accessed
          additionalProperties:
            type: integer
        unique_country:
          type: object
          description: Data about unique countries from which the short link was accessed
          additionalProperties:
            type: integer
        referrer:
          type: object
          description: Data about the referrers from which the short link was accessed
          additionalProperties:
            type: integer
        unique_referrer:
          type: object
          description: Data about unique referrers from which the short link was accessed
          additionalProperties:
            type: integer
        bots:
          type: object
          description: Data about the bots that accessed the short link
          additionalProperties:
            type: integer
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: Error type identifier
        message:
          type: string
          description: Human-readable error message
      required:
        - error
        - message

````