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
- In Retool, go to Resources → + Create new → REST API.
- Name it Antlytics.
- Set the Base URL to
https://www.antlytics.com/api/v1. - Under Headers, add:
- Key:
Authorization - Value:
Bearer ant_YOUR_TOKEN
- Key:
- 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_id→YOUR_SITE_IDfrom→ (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
| Component | Data source |
|---|---|
| Stat cards (visitors, pageviews, bounce rate) | statsQuery.data |
| Table — Top pages | pagesQuery.data |
| Table — Top referrers | referrersQuery.data |
| Date picker | controls 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.