How to get KPIs and metrics from the Simple Analytics API

In this article we will explain how we get your metrics data from Simple Analytics to display in MinimalDashboard, but if you want to use this data in your own application you can either use our API or follow the instructions below to write your own implementation.

Simple Analytics is a privacy-focused web analytics platform to track your website visitor, page view analytics and supports auto-collecting events like downloads, outbound links, and email clicks and has a simple JSON API. You can find their documentation here: SimpleAnalytics's API.

Contents

Authentication

For authentication you provide a Bearer token, which you can create for your account under the Account Settings > API access page in Simple Analytics.

Endpoint

To get metrics you simply append .json to the URL you are seeing in your dashboard comprised of the site domain you want to get data for:

https://simpleanalytics.com/EXAMPLE.COM.json

How to get page view metrics from

To get aggregated data (Simple Analytics calls it a histogram) you can use a GET query for fields=histogram

https://simpleanalytics.com/EXAMPLE.COM.json
  ?fields=histogram
  &version=5
  // this removes any debugging or diagnostic information from the response
  &info=false
  // the following produces all daily metrics for a specific date period
  &timezone=UTC
  &start=2024-01-01
  &end=2024-01-31

Simple Analytics API Results

The endpoint will return the following data:

{
  "histogram": [
    {
      "date": "2024-08-18",
      "pageviews": 123,
      "visitors": 42
    },
    ...
  ],
}

As of September 2024 this endpoint does not have any pagination and returns all matching results for this query.

Note

There seems to be a discrepancy between data returned as a histogram for a specific date vs when the data is requested directly (not aggregated) which we assume is due to timezone handling. As of writing a report on the community forums has been made but not resolved yet.

Looking for more?

Have a look at our API knowledge base with many more services...

icon related to Simple Analytics

Simple Analytics

Website Analytics

If you'd like to have a ready-made dashboard with all the metrics from Simple Analytics instead, you can create one with MinimalDashboard in a few clicks.

Create dashboards to show

  • Total Page Views
  • Visitors
  • Seconds on Page
Create your Simple Analytics dashboard today