4 Min. Lesedauer
GET /analytics/:websiteId
Retrieve a comprehensive analytics overview for a website. Returns total visitors, page views, unique visitors, and daily aggregated statistics for the specified time range.
GET
/api/external/v1/analytics/:websiteIdGet analytics overview with daily breakdowns
Authentication
All requests require an API key passed via the X-API-Key header. Alternatively, you can use the Authorization: Bearer YOUR_API_KEY header.
AuthenticationBash
curl -X GET 'https://api.zenovay.com/api/external/v1/analytics/a1b2c3d4-e5f6-7890-abcd-ef1234567890?range=30d' \
-H 'X-API-Key: YOUR_API_KEY'Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
websiteId | string (path) | Yes | - | The UUID of the website |
range | string (query) | No | 7d | Time range: 24h, 7d, 30d, 90d, 1y |
Response
Response (200 OK)JSON
{
"success": true,
"data": {
"website": {
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"domain": "mywebsite.com",
"name": "My Website"
},
"time_range": "30d",
"date_range": {
"start": "2026-01-08",
"end": "2026-02-07",
"startDateTime": "2026-01-08T12:00:00.000Z",
"endDateTime": "2026-02-07T12:00:00.000Z"
},
"summary": {
"total_visitors": 28450,
"total_page_views": 94312,
"unique_visitors": 18230
},
"daily_stats": [
{
"date": "2026-01-08",
"website_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"total_visitors": 921,
"unique_visitors": 612,
"page_views": 3102
},
{
"date": "2026-01-09",
"website_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"total_visitors": 1043,
"unique_visitors": 687,
"page_views": 3451
}
]
},
"timestamp": "2026-02-07T12:00:00.000Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
website.id | string | Website UUID |
website.domain | string | Website domain |
website.name | string | Website display name |
time_range | string | The requested time range |
date_range.start | string | Start date (YYYY-MM-DD) |
date_range.end | string | End date (YYYY-MM-DD) |
date_range.startDateTime | string | Start date as ISO 8601 |
date_range.endDateTime | string | End date as ISO 8601 |
summary.total_visitors | number | Total visitor count |
summary.total_page_views | number | Total page view count |
summary.unique_visitors | number | Unique visitor count |
daily_stats | array | Array of daily aggregated statistics |
TypeScript Interface
AnalyticsOverviewResponseTypeScript
interface DailyStat {
date: string;
website_id: string;
total_visitors: number;
unique_visitors: number;
page_views: number;
}
interface AnalyticsOverviewResponse {
success: true;
data: {
website: {
id: string;
domain: string;
name: string;
};
time_range: string;
date_range: {
start: string;
end: string;
startDateTime: string;
endDateTime: string;
};
summary: {
total_visitors: number;
total_page_views: number;
unique_visitors: number;
};
daily_stats: DailyStat[];
};
timestamp: string;
}HTTP Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - API key does not have access to this website |
| 404 | Not Found - Website not found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error |
Code Examples
cURLBash
curl -X GET 'https://api.zenovay.com/api/external/v1/analytics/a1b2c3d4-e5f6-7890-abcd-ef1234567890?range=30d' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json'Error Handling
Error Response (404 Not Found)JSON
{
"success": false,
"error": {
"message": "Website not found",
"code": "NOT_FOUND",
"timestamp": "2026-02-07T12:00:00.000Z"
}
}War diese Seite hilfreich?