Antlytics logoAntlytics

Use Antlytics data in Retool

Retool lets you build internal tools on top of any REST API. Connect the Antlytics API as a resource to display live analytics data in custom dashboards.

Setup

Create a REST API resource

  1. In Retool, go to Resources → + Create new → REST API.
  2. Name it Antlytics.
  3. Set the Base URL to https://www.antlytics.com/api/v1.
  4. Under Headers, add:
    • Key: Authorization
    • Value: Bearer ant_YOUR_TOKEN
  5. Click Create resource.

Create your API token in Settings → API tokens.


Querying the API

Summary stats query

In a Retool app, add a Resource query and select the Antlytics resource:

  • Method: GET
  • Path: /stats
  • Query parameters:
    • site_idYOUR_SITE_ID
    • from → (optional) e.g. {{ moment().subtract(30, 'days').toISOString() }}
    • to → (optional) e.g. {{ moment().toISOString() }}

The query returns:

{ "visitors": 1240, "pageviews": 3820, "bounce_rate": 42, "sessions": 1240 }

Bind components directly: {{ statsQuery.data.visitors }}.

Top pages query

  • Path: /pages
  • Query parameters: site_id, from, to, limit (optional, default 10)

Bind to a Table component with columns path, pageviews, visitors.

Top referrers query

  • Path: /referrers
  • Query parameters: site_id, from, to, limit (optional, default 10)

Bind to a Table component with columns referrer, visits.


Example dashboard layout

ComponentData source
Stat cards (visitors, pageviews, bounce rate)statsQuery.data
Table — Top pagespagesQuery.data
Table — Top referrersreferrersQuery.data
Date pickercontrols from / to params in all queries

Need help?

Email support@antlytics.com with your site ID.

Something missing? Get in touch and we will update these docs.