https://api.visitors.now/v1/analytics/timeseriesReturns time-bucketed analytics data for charting. Granularity (hour, day, week, month) is determined automatically from the period.
const res = await fetch("https://api.visitors.now/v1/analytics/timeseries?period=7d", {
headers: { Authorization: `Bearer ${VISITORS_API_KEY}` },
});
const timeseries = await res.json();Time period. One of today, yesterday, 24h, 7d, 30d, 3m, 6m, 12m, this_week, this_month, this_year, all_time, custom. Default: 30d.
Custom start date (ISO 8601). Overrides period.
Custom end date (ISO 8601). Overrides period.
Timezone for date calculations. Default: UTC.
JSON-encoded filter object.
[
{
"date": "2026-03-01",
"people": 421,
"views": 1893,
"bounced": 38.24,
"duration": 28420.5,
"revenue": 46.15,
"sales": 2
},
{
"date": "2026-03-02",
"people": 389,
"views": 1654,
"bounced": 41.02,
"duration": 25103.8,
"revenue": 32.50,
"sales": 1
},
{
"date": "2026-03-03",
"people": 512,
"views": 2201,
"bounced": 35.71,
"duration": 31892.4,
"revenue": 58.90,
"sales": 3
}
// ...
]