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

# Retrieve a Bitsy Link Analytics

> Retrieve a Bitsy Link Analytics



## OpenAPI

````yaml GET /link/stats
openapi: 3.0.1
info:
  title: OpenAPI BitsyLink Store
  description: >-
    A sample API that uses a BitsyLink store as an example to demonstrate
    features in the OpenAPI specification
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://api.bsy.sh/v1
security:
  - bearerAuth: []
paths:
  /link/stats:
    get:
      description: Retrieve a Bitsy Link Analytics
      parameters:
        - name: id
          in: query
          required: true
          description: The unique identifier for the Bitsy Link.
          schema:
            type: string
            format: uuid
        - name: start_date
          in: query
          required: true
          description: >-
            Start date for filtering link analytics. Must be in 'YYYY-MM-DD'
            format.
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
        - name: end_date
          in: query
          required: true
          description: >-
            End date for filtering link analytics. Must be in 'YYYY-MM-DD'
            format.
          schema:
            type: string
            pattern: ^\d{4}-\d{2}-\d{2}$
      responses:
        '200':
          description: Details of the requested Bitsy Link Analytics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetBitsyLinkAnalyticsSuccess'
                type: object
        '400':
          description: Default Client Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultClientError'
        '401':
          description: Authorization Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthorizationError'
        '403':
          description: Permission Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PermissionError'
        '422':
          description: Request Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationError'
        '500':
          description: Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DefaultServerError'
components:
  schemas:
    GetBitsyLinkAnalyticsSuccess:
      required:
        - status
        - data
      type: object
      properties:
        status:
          type: string
          enum:
            - success
        data:
          type: object
          properties:
            timeframe:
              type: string
              description: The time period for which the analytics data is being provided.
            total_count:
              type: number
              description: The total number of clicks during the specified timeframe.
            unique_count:
              type: number
              description: The count of unique clicks during the specified timeframe.
            stats:
              type: object
              properties:
                country:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the country for geo-targeting.
                      total_count:
                        type: number
                        description: The total number of clicks from users in this country.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users in this
                          country.
                  description: Clicks by country.
                region:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the region for geo-targeting.
                      total_count:
                        type: number
                        description: The total number of clicks from users in this region.
                      unique_count:
                        type: number
                        description: The number of unique clicks from users in this region.
                  description: Clicks by region.
                city:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the city for geo-targeting.
                      total_count:
                        type: number
                        description: The total number of clicks from users in this city.
                      unique_count:
                        type: number
                        description: The number of unique clicks from users in this city.
                  description: Clicks by city.
                os_name:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The name of the operating system used by the user.
                      total_count:
                        type: number
                        description: >-
                          The total number of clicks from users on this
                          operating system.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users on this
                          operating system.
                  description: Clicks by operating system.
                device_type:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: >-
                          The type of device used by the user (e.g., mobile,
                          desktop).
                      total_count:
                        type: number
                        description: >-
                          The total number of clicks from users on this device
                          type.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users on this device
                          type.
                  description: Clicks by device type.
                device_brand:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The brand of the device used by the user.
                      total_count:
                        type: number
                        description: >-
                          The total number of clicks from users with this device
                          brand.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users with this
                          device brand.
                  description: Clicks by device brand.
                device_model:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The specific model of the device used by the user.
                      total_count:
                        type: number
                        description: >-
                          The total number of clicks from users with this device
                          model.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users with this
                          device model.
                  description: Clicks by device model.
                client_name:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The client used by the user (e.g., Chrome, Firefox).
                      total_count:
                        type: number
                        description: The total number of clicks from this client.
                      unique_count:
                        type: number
                        description: The number of unique clicks from this client.
                  description: Clicks by client name.
                timezone:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: >-
                          The name of the timezone in which the interaction
                          occurred.
                      total_count:
                        type: number
                        description: >-
                          The total number of clicks from users in this
                          timezone.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users in this
                          timezone.
                  description: Clicks by timezone.
                language:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The language used by the user.
                      total_count:
                        type: number
                        description: >-
                          The total number of clicks from users speaking this
                          language.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users speaking this
                          language.
                  description: Clicks by language.
                referrer:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        description: The referrer source from which the user arrived.
                      total_count:
                        type: number
                        description: >-
                          The total number of clicks from users who came from
                          this referrer.
                      unique_count:
                        type: number
                        description: >-
                          The number of unique clicks from users who came from
                          this referrer.
                  description: Clicks by referrer.
                interval:
                  type: object
                  properties:
                    hour:
                      type: array
                      items:
                        type: object
                        properties:
                          date:
                            type: string
                            description: The date and time for the hour interval.
                          total_count:
                            type: number
                            description: The total number of clicks during this hour.
                          unique_count:
                            type: number
                            description: The number of unique clicks during this hour.
                      description: Clicks by hour.
                    day:
                      type: array
                      items:
                        type: object
                        properties:
                          date:
                            type: string
                            description: The date for the day interval.
                          total_count:
                            type: number
                            description: The total number of clicks during this day.
                          unique_count:
                            type: number
                            description: The number of unique clicks during this day.
                      description: Clicks by day.
                    week:
                      type: array
                      items:
                        type: object
                        properties:
                          date:
                            type: string
                            description: The start date for the week interval.
                          total_count:
                            type: number
                            description: The total number of clicks during this week.
                          unique_count:
                            type: number
                            description: The number of unique clicks during this week.
                      description: Clicks by week.
                    month:
                      type: array
                      items:
                        type: object
                        properties:
                          date:
                            type: string
                            description: The start date for the month interval.
                          total_count:
                            type: number
                            description: The total number of clicks during this month.
                          unique_count:
                            type: number
                            description: The number of unique clicks during this month.
                      description: Clicks by month.
                    year:
                      type: array
                      items:
                        type: object
                        properties:
                          date:
                            type: string
                            description: The start date for the year interval.
                          total_count:
                            type: number
                            description: The total number of clicks during this year.
                          unique_count:
                            type: number
                            description: The number of unique clicks during this year.
                      description: Clicks by year.
                  description: >-
                    Clicks by various time intervals (hour, day, week, month,
                    year).
    DefaultClientError:
      required:
        - status
        - message
      type: object
      properties:
        status:
          type: string
          enum:
            - failure
          description: Indicates the status of the error.
        message:
          type: string
          description: A message providing additional details about the default error.
    AuthorizationError:
      required:
        - status
        - message
      type: object
      properties:
        status:
          type: string
          enum:
            - failure
          description: Indicates the status of the authorization.
        message:
          type: string
          description: >-
            A message providing additional details about the authorization
            error.
    PermissionError:
      required:
        - status
        - message
      type: object
      properties:
        status:
          type: string
          enum:
            - failure
          description: Indicates the status of the authorization.
        message:
          type: string
          description: >-
            A message providing additional details about the authorization
            error.
    ValidationError:
      required:
        - status
        - message
        - errors
      type: object
      properties:
        status:
          type: string
          enum:
            - failure
          description: Indicates the status of the validation.
        message:
          type: string
          description: A message providing additional details about the validation error.
        errors:
          type: object
          properties:
            formErrors:
              type: array
              items:
                type: string
              description: List of form-level errors.
            fieldErrors:
              type: object
              additionalProperties:
                type: array
                items:
                  type: string
              description: >-
                Object containing field-specific errors, where keys are field
                names and values are arrays of error messages.
          description: Detailed error information regarding validation failures.
    DefaultServerError:
      required:
        - status
        - message
      type: object
      properties:
        status:
          type: string
          enum:
            - error
          description: Indicates the status of the error.
        message:
          type: string
          description: A message providing additional details about the default error.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````