REST API
Read-only JSON API for your sites' statistics, real-time data, and people.
Authentication
Create a key under Settings → API keys. Keys look like tally_ followed by 40 characters and are shown once. Send them as a bearer token:
curl -H "Authorization: Bearer $TALLY_KEY" https://tally.example.com/api/v1/sites- A key bound to one site can only read that site (other sites answer
404). - Members can create keys for themselves; admins see and can delete every key.
- Rate limit: 120 requests per minute per key and IP. Over the limit you get
429withRetry-After. - Errors are JSON:
{"message": "..."}with401(missing/invalid key),404,422(bad parameters),429, or504(query took longer than 15 seconds: narrow the range or remove a filter).
Endpoints
| Method | Path | Returns |
|---|---|---|
| GET | /api/v1/sites |
{ "data": [site...], "meta": { "total": n } } |
| GET | /api/v1/sites/{site} |
{ "data": site } |
| GET | /api/v1/sites/{site}/stats/{report} |
A report (below) |
| GET | /api/v1/sites/{site}/realtime |
Real-time view |
| GET | /api/v1/sites/{site}/people |
People list |
| GET | /api/v1/sites/{site}/people/{person} |
One person with their visits and events |
{site} is the site's public ID (the data-site value).
Report parameters
| Param | Values | Default |
|---|---|---|
period |
today, yesterday, 24h, 7d, 30d, 3m, 6m, 12m, month (this month), year (this year), all |
30d |
start, end |
YYYY-MM-DD (end inclusive) or ISO datetimes (end exclusive); override period |
|
tz |
IANA timezone | the site's timezone |
interval |
hour, day, week, month |
auto: hour up to 2 days, day up to 92 days, week up to 6 months, then month |
filters |
URL-encoded JSON object, such as {"country":"US","page":"/pricing"} |
{} |
limit, offset |
1–1000 | 10, 0 |
search |
substring match on the row key (breakdowns) |
Filter keys: page, entry_page, exit_page, referrer, channel, utm_source, utm_medium, utm_campaign, utm_term, utm_content, country, region, city, browser, os, device, hostname, event. Values are exact matches (use a row's key). region keys look like US/Texas and city keys like US/Texas/Austin. Filters are AND-ed. page and event filters select visits that include that page or event.
Reports
summary
{
"range": { "start": "2026-11-03T06:00:00Z", "end": "2026-12-03T06:00:00Z", "tz": "America/Chicago", "interval": "day", "period": "30d" },
"current": { "visitors": 1234, "visits": 1502, "pageviews": 4011, "bounce_rate": 0.42, "avg_duration_s": 95, "events": 120, "revenue_cents": 4900 },
"previous": { "visitors": 1100, "visits": 1380, "pageviews": 3700, "bounce_rate": 0.45, "avg_duration_s": 88, "events": 96, "revenue_cents": 0 },
"approximate_visitors": true,
"source": "rollup"
}approximate_visitors is true when multi-day unique visitors came from merged HyperLogLog sketches (about 1% error). source says whether the numbers came from raw events or daily rollups.
timeseries
{ "interval": "day",
"points": [ { "t": "2026-11-03T00:00:00-06:00", "visitors": 40, "visits": 52, "pageviews": 130, "bounce_rate": 0.4, "avg_duration_s": 80, "events": 3, "revenue_cents": 0, "partial": false } ],
"previous": [ ... same shape, aligned by index ... ] }Breakdowns
pages, entry-pages, exit-pages, referrers, channels, utm (with dimension=source|medium|campaign|term|content), countries, regions, cities, browsers, os, devices, hostnames, events:
{ "dimension": "country",
"rows": [ { "key": "US", "label": "United States", "visitors": 310, "visits": 340, "pageviews": 512,
"bounce_rate": 0.4, "avg_duration_s": 90, "events": 12, "revenue_cents": 0, "conversion_rate": null } ],
"has_more": true }Fields that don't apply are null (for example bounce_rate on pages). conversion_rate (on events) is the event's visitors divided by all visitors in the range. For unfiltered ranges over two days, breakdown visitors are sums of daily unique visitors; add any filter for exact counts.
event-props
?event=Signup&prop=plan breaks one custom event down by a property:
{ "event": "Signup", "prop": "plan", "rows": [ { "key": "pro", "visitors": 12, "events": 14, "revenue_cents": 58800 } ], "props": ["plan", "source"] }Real time
{ "visitors": 12,
"pageviews_per_minute": [0, 2, 5],
"top_pages": [ { "key": "/", "visitors": 7 } ],
"top_sources": [ { "key": "Google", "label": "Google", "visitors": 4 } ],
"top_countries": [ { "key": "US", "label": "United States", "visitors": 6 } ],
"recent": [ { "ts": "...", "kind": "pageview", "name": "", "path": "/pricing", "visit_id": "7409...", "visitor": "a1b2c3",
"person": { "id": 4, "name": "Ada" }, "country": "US", "city": "Austin", "device": "desktop",
"browser": "Chrome", "referrer_source": "Google", "revenue_cents": 0 } ] }visitors counts browsers with an event in the last 5 minutes; everything else covers the last 30 minutes. Public share links omit recent.
People
GET /people?q=&sort=last_seen|first_seen|revenue|visits&identified=1&cursor= returns 50 people per page:
{ "data": [ { "id": 4, "external_id": "user_123", "name": "Ada", "email": "a@b.co", "anonymous": false,
"first_seen_at": "...", "last_seen_at": "...", "visits": 9, "pageviews": 41, "events": 3,
"revenue_cents": 4900, "last_country": "US", "first_referrer_source": "Google", "online": true } ],
"meta": { "next_cursor": "50" } }GET /people/{id}?cursor= returns { "person": {...all fields..., "devices": 2}, "visits": [...], "meta": { "next_cursor": "20" } } with 20 visits per page, each with its events and time_on_page_s for page views. Visit IDs are strings because they exceed JavaScript's safe integer range.