Simple Analytics Stats API

The Stats API from Simple Analytics — the aggregated dashboard statistics (pageviews, visitors, histogram, pages, countries, referrers, UTM and device breakdowns) as JSON for any tracked hostname.

Operations 1

GET /{hostname}.json Get aggregated statistics for a website. #

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/simpleanalytics-stats-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

simpleanalytics-stats-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Simple Analytics Events Stats API
  description: Specification of the Simple Analytics REST API. Simple Analytics is a privacy-first, cookieless web analytics platform. The API exposes aggregated dashboard statistics (Stats API), raw data point exports (Export API), server-side event collection, and website administration (Admin API).
  termsOfService: https://www.simpleanalytics.com/terms
  contact:
    name: Simple Analytics Support
    email: support@simpleanalytics.com
  version: '6'
servers:
- url: https://simpleanalytics.com
  description: Stats, Export, and Admin API
- url: https://queue.simpleanalyticscdn.com
  description: Event collection endpoint
security:
- ApiKeyAuth: []
  UserId: []
tags:
- name: Stats
paths:
  /{hostname}.json:
    get:
      operationId: getStats
      tags:
      - Stats
      summary: Get aggregated statistics for a website.
      description: Returns the aggregated statistics shown in the dashboard as JSON for the given hostname. Public websites can be queried without credentials; private websites require Api-Key and User-Id headers.
      parameters:
      - name: hostname
        in: path
        required: true
        description: The website hostname, e.g. simpleanalytics.com
        schema:
          type: string
      - name: version
        in: query
        description: API version. Latest is 6.
        schema:
          type: integer
          default: 6
      - name: start
        in: query
        description: Start date in YYYY-MM-DD format. Defaults to one month ago.
        schema:
          type: string
      - name: end
        in: query
        description: End date in YYYY-MM-DD format. Defaults to today.
        schema:
          type: string
      - name: fields
        in: query
        description: Comma-separated list of fields to return, e.g. pageviews,visitors,histogram,pages,countries,referrers,utm_sources.
        schema:
          type: string
      - name: limit
        in: query
        description: Number of results for list fields (1-1000).
        schema:
          type: integer
      - name: timezone
        in: query
        description: A valid timezone such as Europe/Amsterdam.
        schema:
          type: string
      - name: interval
        in: query
        description: Histogram interval.
        schema:
          type: string
          enum:
          - hour
          - day
          - week
          - month
          - year
      - name: page
        in: query
        description: Filter by a page path, supports the * wildcard.
        schema:
          type: string
      - name: country
        in: query
        description: Filter by ISO country code.
        schema:
          type: string
      - name: referrer
        in: query
        description: Filter by referrer.
        schema:
          type: string
      - name: utm_source
        in: query
        schema:
          type: string
      - name: utm_medium
        in: query
        schema:
          type: string
      - name: utm_campaign
        in: query
        schema:
          type: string
      responses:
        '200':
          description: Aggregated statistics for the website.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Stats'
components:
  schemas:
    Stats:
      type: object
      properties:
        ok:
          type: boolean
        pageviews:
          type: integer
        visitors:
          type: integer
        start:
          type: string
        end:
          type: string
        histogram:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
              pageviews:
                type: integer
              visitors:
                type: integer
        pages:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              pageviews:
                type: integer
              visitors:
                type: integer
        referrers:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              pageviews:
                type: integer
              visitors:
                type: integer
        countries:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              visitors:
                type: integer
        utm_sources:
          type: array
          items:
            type: object
            properties:
              value:
                type: string
              visitors:
                type: integer
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Api-Key
      description: API key starting with sa_api_key_
    UserId:
      type: apiKey
      in: header
      name: User-Id
      description: User identifier starting with sa_user_id_