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

# Get Stat Summary

> Get a summary of the website's stats.



## OpenAPI

````yaml get /website/{hostname}/summary
openapi: 3.0.3
info:
  title: Medama Analytics API
  version: 0.5.0
  description: |
    This is the Medama Analytics OpenAPI 3.0 specification.
  contact:
    email: hello@ayuhito.com
    name: Medama Analytics
    url: https://medama.io/contact
  license:
    url: https://github.com/medama-io/medama/blob/main/core/LICENSE
    name: Apache License 2.0
servers:
  - url: http://localhost:8080
    description: Local Server
security: []
tags:
  - name: Authentication
    description: Authentication
  - name: Event
    description: Page Events
  - name: User
    description: User Management
  - name: Website
    description: Website Management
  - name: Stats
    description: Statistics
paths:
  /website/{hostname}/summary:
    get:
      tags:
        - Stats
      summary: Get Stat Summary
      description: Get a summary of the website's stats.
      operationId: get-website-id-summary
      parameters:
        - in: query
          name: previous
          description: >-
            Retrieve the data from the previous period as well. This is useful
            when comparing data from the previous period to the current period.
            Requires the start and end period parameters to be set.
          schema:
            type: boolean
            default: false
        - in: query
          name: interval
          description: >-
            The interval to group the data by. This can be set to minute, hour,
            day, week or month. This will return an interval property if set.
          schema:
            type: string
            enum:
              - minute
              - hour
              - day
              - week
              - month
        - $ref: '#/components/parameters/SessionAuth'
        - $ref: '#/components/parameters/Hostname'
        - $ref: '#/components/parameters/PeriodStart'
        - $ref: '#/components/parameters/PeriodEnd'
        - $ref: '#/components/parameters/Path'
        - $ref: '#/components/parameters/Referrer'
        - $ref: '#/components/parameters/UTMSource'
        - $ref: '#/components/parameters/UTMMedium'
        - $ref: '#/components/parameters/UTMCampaign'
        - $ref: '#/components/parameters/Browser'
        - $ref: '#/components/parameters/OS'
        - $ref: '#/components/parameters/Device'
        - $ref: '#/components/parameters/Country'
        - $ref: '#/components/parameters/Language'
        - $ref: '#/components/parameters/PropertyName'
        - $ref: '#/components/parameters/PropertyValue'
      responses:
        '200':
          description: OK
          headers:
            X-Api-Commit:
              $ref: '#/components/headers/X-Api-Commit'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StatsSummary'
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorisedError'
        '404':
          $ref: '#/components/responses/NotFoundError'
        '500':
          $ref: '#/components/responses/InternalServerError'
      security:
        - CookieAuth: []
components:
  parameters:
    SessionAuth:
      name: _me_sess
      in: cookie
      description: Session token for authentication.
      required: true
      schema:
        type: string
        example: _me_sess=token; Path=/; HttpOnly; SameSite=Lax; Secure
    Hostname:
      name: hostname
      in: path
      description: Hostname for the website.
      required: true
      schema:
        type: string
        minLength: 1
        maxLength: 253
        format: hostname
    PeriodStart:
      name: start
      in: query
      description: >-
        Period start date using date-time notation in RFC3339 format, for
        example, (2017-07-21T17:32:28Z).
      required: false
      schema:
        type: string
        format: date-time
    PeriodEnd:
      name: end
      in: query
      description: >-
        Period end date using fdate-time notation in RFC3339 format, for
        example, (2017-07-21T17:32:28Z).
      required: false
      schema:
        type: string
        format: date-time
    Path:
      name: path
      in: query
      description: Path of the page.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    Referrer:
      name: referrer
      in: query
      description: Referrer URL of the page hit.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    UTMSource:
      name: utm_source
      in: query
      description: UTM source of the page hit.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    UTMMedium:
      name: utm_medium
      in: query
      description: UTM medium of the page hit.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    UTMCampaign:
      name: utm_campaign
      in: query
      description: UTM campaign of the page hit.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    Browser:
      name: browser
      in: query
      description: Browser name.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    OS:
      name: os
      in: query
      description: Operating system name.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    Device:
      name: device
      in: query
      description: Device type.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    Country:
      name: country
      in: query
      description: Country name.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    Language:
      name: language
      in: query
      description: Language code.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    PropertyName:
      name: prop_name
      in: query
      description: Name of the property.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
    PropertyValue:
      name: prop_value
      in: query
      description: Value of the property.
      required: false
      style: deepObject
      explode: true
      allowReserved: true
      schema:
        $ref: '#/components/schemas/FilterString'
  headers:
    X-Api-Commit:
      description: >-
        A custom header used to identify the commit of the API. This can be used
        to force reload the client if the API has been updated.
      schema:
        type: string
        example: 97dd2ae
  schemas:
    StatsSummary:
      type: object
      title: StatsSummary
      properties:
        current:
          type: object
          properties:
            visitors:
              type: integer
            pageviews:
              type: integer
            bounce_percentage:
              type: number
              format: float
            duration:
              type: integer
          required:
            - visitors
            - pageviews
            - bounce_percentage
            - duration
        previous:
          type: object
          properties:
            visitors:
              type: integer
            pageviews:
              type: integer
            bounce_percentage:
              type: number
              format: float
            duration:
              type: integer
          required:
            - visitors
            - pageviews
            - bounce_percentage
            - duration
        interval:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
              visitors:
                type: integer
              pageviews:
                type: integer
              bounce_percentage:
                type: number
                format: float
              duration:
                type: integer
            required:
              - date
      required:
        - current
    FilterString:
      type: object
      properties:
        eq:
          type: string
          description: Equal to.
        neq:
          type: string
          description: Not equal to.
        contains:
          type: string
          description: Contains.
        not_contains:
          type: string
          description: Does not contain.
        starts_with:
          type: string
          description: Starts with.
        not_starts_with:
          type: string
          description: Does not start with.
        ends_with:
          type: string
          description: Ends with.
        not_ends_with:
          type: string
          description: Does not end with.
        in:
          type: string
          description: In.
        not_in:
          type: string
          description: Not in.
  responses:
    BadRequestError:
      description: 400 Bad Request.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 400
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
    UnauthorisedError:
      description: 401 Unauthorised.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 401
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
    NotFoundError:
      description: 404 Not Found.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 404
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
    InternalServerError:
      description: 500 Unexpected Internal Server Error.
      headers:
        X-Api-Commit:
          $ref: '#/components/headers/X-Api-Commit'
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: object
                additionalProperties: false
                properties:
                  code:
                    type: integer
                    format: int32
                    default: 500
                  message:
                    type: string
                required:
                  - code
                  - message
            required:
              - error
  securitySchemes:
    CookieAuth:
      name: _me_sess
      in: cookie
      type: apiKey
      description: Session token for authentication.

````