APIStats
Overview
Retrieve high-level analytics metrics for a site
See the API Reference for authentication, common parameters, and filters.
Endpoints
GET
/api/overview/:siteGET/api/overview-bucketed/:siteGET/api/metric/:siteGET/api/live-user-count/:siteGet Overview
GET /api/overview/:siteReturns high-level analytics metrics for a site.
Path Parameters
Prop
Type
Query Parameters
Accepts all Common Parameters (time and filters).
Response
Prop
Type
curl -X GET "https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York" \
-H "Authorization: Bearer your_api_key_here"const response = await fetch(
'https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York',
{
headers: {
'Authorization': 'Bearer your_api_key_here'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://api.rybbit.io/api/overview/123',
params={
'start_date': '2024-01-01',
'end_date': '2024-01-31',
'time_zone': 'America/New_York'
},
headers={
'Authorization': 'Bearer your_api_key_here'
}
)
data = response.json()$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer your_api_key_here'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);require 'net/http'
require 'json'
uri = URI('https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)let client = reqwest::Client::new();
let res = client
.get("https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York")
.header("Authorization", "Bearer your_api_key_here")
.send()
.await?;
let data: serde_json::Value = res.json().await?;HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York"))
.header("Authorization", "Bearer your_api_key_here")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
var response = await client.GetAsync("https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York");
var data = await response.Content.ReadAsStringAsync();{
"data": {
"sessions": 15420,
"pageviews": 48933,
"users": 12847,
"pages_per_session": 3.17,
"bounce_rate": 42.8,
"session_duration": 182.5
}
}Get Overview (Time Series)
GET /api/overview-bucketed/:siteReturns time-series analytics data broken down by configurable time buckets. Useful for charting trends over time.
Path Parameters
Prop
Type
Query Parameters
Accepts all Common Parameters plus the following:
Prop
Type
Bucket Selection Guide
| Bucket | Best For |
|---|---|
minute | Real-time monitoring (last hour) |
five_minutes | Short-term analysis (last few hours) |
hour | Daily analysis |
day | Weekly/monthly analysis |
week | Monthly/quarterly analysis |
month | Yearly analysis |
Response
Prop
Type
curl -X GET "https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York" \
-H "Authorization: Bearer your_api_key_here"const response = await fetch(
'https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York',
{
headers: {
'Authorization': 'Bearer your_api_key_here'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://api.rybbit.io/api/overview-bucketed/123',
params={
'bucket': 'day',
'start_date': '2024-01-01',
'end_date': '2024-01-07',
'time_zone': 'America/New_York'
},
headers={
'Authorization': 'Bearer your_api_key_here'
}
)
data = response.json()$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer your_api_key_here'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);require 'net/http'
require 'json'
uri = URI('https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)let client = reqwest::Client::new();
let res = client
.get("https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York")
.header("Authorization", "Bearer your_api_key_here")
.send()
.await?;
let data: serde_json::Value = res.json().await?;HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York"))
.header("Authorization", "Bearer your_api_key_here")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
var response = await client.GetAsync("https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York");
var data = await response.Content.ReadAsStringAsync();{
"data": [
{
"time": "2024-01-01T00:00:00.000Z",
"sessions": 1250,
"pageviews": 3890,
"users": 1100,
"pages_per_session": 3.11,
"bounce_rate": 41.5,
"session_duration": 165.2
},
{
"time": "2024-01-02T00:00:00.000Z",
"sessions": 1420,
"pageviews": 4520,
"users": 1280,
"pages_per_session": 3.18,
"bounce_rate": 39.8,
"session_duration": 178.4
},
{
"time": "2024-01-03T00:00:00.000Z",
"sessions": 1380,
"pageviews": 4210,
"users": 1190,
"pages_per_session": 3.05,
"bounce_rate": 42.1,
"session_duration": 162.8
}
]
}Get Metric
GET /api/metric/:siteReturns dimensional analytics data broken down by a specific parameter. Supports pagination.
Path Parameters
Prop
Type
Query Parameters
Accepts all Common Parameters plus the following:
Prop
Type
Response
Prop
Type
MetricItem Structure
Prop
Type
curl -X GET "https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10" \
-H "Authorization: Bearer your_api_key_here"const response = await fetch(
'https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10',
{
headers: {
'Authorization': 'Bearer your_api_key_here'
}
}
);
const data = await response.json();import requests
response = requests.get(
'https://api.rybbit.io/api/metric/123',
params={
'parameter': 'country',
'start_date': '2024-01-01',
'end_date': '2024-01-31',
'time_zone': 'America/New_York',
'limit': 10
},
headers={
'Authorization': 'Bearer your_api_key_here'
}
)
data = response.json()$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer your_api_key_here'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);require 'net/http'
require 'json'
uri = URI('https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)let client = reqwest::Client::new();
let res = client
.get("https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10")
.header("Authorization", "Bearer your_api_key_here")
.send()
.await?;
let data: serde_json::Value = res.json().await?;HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10"))
.header("Authorization", "Bearer your_api_key_here")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
var response = await client.GetAsync("https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10");
var data = await response.Content.ReadAsStringAsync();{
"data": {
"data": [
{
"value": "US",
"count": 8420,
"percentage": 54.63,
"pageviews": 26891,
"pageviews_percentage": 54.96,
"bounce_rate": 41.2
},
{
"value": "GB",
"count": 2150,
"percentage": 13.95,
"pageviews": 6847,
"pageviews_percentage": 13.99,
"bounce_rate": 43.8
}
],
"totalCount": 87
}
}Get Live Visitors
GET /api/live-user-count/:siteReturns the count of unique active sessions within the specified time window. Useful for displaying real-time visitor counts.
Path Parameters
Prop
Type
Query Parameters
Prop
Type
Response
Prop
Type
Time Window Guide
| Minutes | Use Case |
|---|---|
1 | Very active visitors (currently browsing) |
5 | Standard "live" count (default) |
15 | Recently active visitors |
30 | Short-term engagement window |
curl -X GET "https://api.rybbit.io/api/live-user-count/123?minutes=5" \
-H "Authorization: Bearer your_api_key_here"const response = await fetch(
'https://api.rybbit.io/api/live-user-count/123?minutes=5',
{
headers: {
'Authorization': 'Bearer your_api_key_here'
}
}
);
const { count } = await response.json();
console.log(`Live visitors: ${count}`);import requests
response = requests.get(
'https://api.rybbit.io/api/live-user-count/123',
params={'minutes': 5},
headers={
'Authorization': 'Bearer your_api_key_here'
}
)
data = response.json()
print(f"Live visitors: {data['count']}")$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/live-user-count/123?minutes=5');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Authorization: Bearer your_api_key_here'
]);
$response = curl_exec($ch);
curl_close($ch);
$data = json_decode($response, true);
echo "Live visitors: " . $data['count'];require 'net/http'
require 'json'
uri = URI('https://api.rybbit.io/api/live-user-count/123?minutes=5')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer your_api_key_here'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body)
puts "Live visitors: #{data['count']}"req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/live-user-count/123?minutes=5", nil)
req.Header.Set("Authorization", "Bearer your_api_key_here")
client := &http.Client{}
resp, _ := client.Do(req)
defer resp.Body.Close()
var data map[string]interface{}
json.NewDecoder(resp.Body).Decode(&data)
fmt.Printf("Live visitors: %v\n", data["count"])let client = reqwest::Client::new();
let res = client
.get("https://api.rybbit.io/api/live-user-count/123?minutes=5")
.header("Authorization", "Bearer your_api_key_here")
.send()
.await?;
let data: serde_json::Value = res.json().await?;
println!("Live visitors: {}", data["count"]);HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.rybbit.io/api/live-user-count/123?minutes=5"))
.header("Authorization", "Bearer your_api_key_here")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());using var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
var response = await client.GetAsync("https://api.rybbit.io/api/live-user-count/123?minutes=5");
var data = await response.Content.ReadAsStringAsync();{
"count": 42
}Polling Example
async function updateLiveCount() {
const response = await fetch(
'https://api.rybbit.io/api/live-user-count/123?minutes=5',
{
headers: {
'Authorization': 'Bearer your_api_key'
}
}
);
const { count } = await response.json();
document.getElementById('live-visitors')
.textContent = count;
}
// Update every 15 seconds
setInterval(updateLiveCount, 15000);