API Documentation

Stats API: https://stats.shortid.me

Capture API: https://api.shortid.me

Common Parameters

All endpoints accept these query parameters:

domainYour domain (required)
period7d | 30d | 90d | today
limitNumber of results (default: 10)

Endpoints

GET

Overview

https://stats.shortid.me/api/stats/overview?domain=example.com

Total pageviews, unique visitors, and events

{"pageviews": 316, "unique_visitors": 16, "events": 667}
GET

Top Pages

https://stats.shortid.me/api/stats/pages?domain=example.com

Most visited pages on your site

[{"name": "/", "count": 55}, {"name": "/dashboard/", "count": 76}]
GET

Traffic Sources

https://stats.shortid.me/api/stats/sources?domain=example.com

Where your visitors come from

[{"name": "Direct", "count": 128}, {"name": "google.com", "count": 45}]
GET

Devices

https://stats.shortid.me/api/stats/devices?domain=example.com

Browser and device breakdown

{"browsers": [{"name": "Chrome", "count": 659}], "devices": [{"name": "desktop", "count": 663}]}
GET

Geography

https://stats.shortid.me/api/stats/geo?domain=example.com

Visitor locations by country

[{"name": "US", "count": 120}, {"name": "DE", "count": 45}]
GET

Pageviews Timeline

https://stats.shortid.me/api/stats/pageviews?domain=example.com

Pageviews over time (hourly/daily)

[{"time": "2024-01-15T10:00:00Z", "count": 25}]
GET

Event Breakdown

https://stats.shortid.me/api/stats/event-breakdown?domain=example.com

Events grouped by type

[{"name": "pageview", "count": 316}, {"name": "click", "count": 284}]
GET

Funnel

https://stats.shortid.me/api/stats/funnel?domain=example.com&steps=/,/signup/,/dashboard/

Conversion funnel analysis

[{"step": "/", "visitors": 100}, {"step": "/signup/", "visitors": 45}]
POST

SQL Query

Advanced
/api/query

Run custom SQL queries on your data. Only SELECT allowed. Max 10,000 rows, 30s timeout.

POST /api/query
Content-Type: application/json

{
  "sql": "SELECT pathname, COUNT(*) as views FROM events GROUP BY pathname",
  "domain": "example.com"
}