6 Min. Lesedauer
GET /insights/:websiteId
Retrieve AI-generated insights for your website. Returns actionable observations including anomalies, trends, recommendations, and predictions based on your analytics data.
GET
/api/external/v1/insights/:websiteIdGet AI-generated insights for a website
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/insights/a1b2c3d4-e5f6-7890-abcd-ef1234567890?range=7d' \
-H 'X-API-Key: YOUR_API_KEY'This endpoint requires a Pro plan or higher. Free-tier API keys will receive a 403 Forbidden response.
Credit Cost
Each request to this endpoint costs 1 API credit.
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 |
type | string (query) | No | - | Filter by insight type: anomaly, trend, recommendation, prediction |
severity | string (query) | No | - | Filter by severity: info, warning, critical |
limit | integer (query) | No | 50 | Number of insights to return (max: 200) |
offset | integer (query) | No | 0 | Number of records to skip for pagination |
Response
Response (200 OK)JSON
{
"success": true,
"data": {
"insights": [
{
"id": "ins_7a1b2c3d-4e5f-6789-abcd-ef0123456789",
"type": "anomaly",
"severity": "warning",
"title": "Unusual traffic spike from Germany",
"description": "Traffic from Germany increased by 340% compared to the 7-day average. This spike started at 14:00 UTC and is concentrated on the /pricing page.",
"metric_name": "visitors_by_country",
"metric_value": 1284,
"metric_change": 340.5,
"recommendation": "Investigate whether a marketing campaign or external link is driving this traffic. Consider localizing the pricing page for German visitors.",
"created_at": "2026-03-16T14:30:00.000Z"
},
{
"id": "ins_8b2c3d4e-5f6a-7890-bcde-f01234567890",
"type": "trend",
"severity": "info",
"title": "Mobile traffic steadily increasing",
"description": "Mobile visitor share has grown from 38% to 52% over the past 30 days, with a consistent upward trend of approximately 2% per week.",
"metric_name": "mobile_share",
"metric_value": 52.3,
"metric_change": 14.3,
"recommendation": "Prioritize mobile experience optimization. Test page load times on mobile devices and consider implementing AMP or responsive improvements.",
"created_at": "2026-03-16T12:00:00.000Z"
},
{
"id": "ins_9c3d4e5f-6a7b-8901-cdef-012345678901",
"type": "recommendation",
"severity": "info",
"title": "High bounce rate on blog posts",
"description": "Blog pages have a 78% bounce rate, significantly above your site average of 45%. Visitors from organic search are the most likely to bounce.",
"metric_name": "bounce_rate",
"metric_value": 78.2,
"metric_change": -33.2,
"recommendation": "Add related article suggestions, internal links, and clear CTAs to blog posts. Consider adding a table of contents for longer articles.",
"created_at": "2026-03-16T10:15:00.000Z"
}
],
"pagination": {
"total": 12,
"limit": 50,
"offset": 0,
"has_more": false
}
},
"timestamp": "2026-03-16T15:00:00.000Z"
}Response Fields
| Field | Type | Description |
|---|---|---|
insights | array | List of AI-generated insight records |
insights[].id | string | Unique insight identifier |
insights[].type | string | Insight type: anomaly, trend, recommendation, prediction |
insights[].severity | string | Severity level: info, warning, critical |
insights[].title | string | Short summary of the insight |
insights[].description | string | Detailed explanation of the insight |
insights[].metric_name | string | The analytics metric this insight relates to |
insights[].metric_value | number | Current value of the metric |
insights[].metric_change | number | Percentage change from the comparison period |
insights[].recommendation | string | Actionable recommendation based on the insight |
insights[].created_at | string | ISO 8601 timestamp when the insight was generated |
pagination.total | number | Total number of matching insights |
pagination.limit | number | Records per page |
pagination.offset | number | Current offset |
pagination.has_more | boolean | Whether more records are available |
TypeScript Interface
InsightsResponseTypeScript
interface Insight {
id: string;
type: 'anomaly' | 'trend' | 'recommendation' | 'prediction';
severity: 'info' | 'warning' | 'critical';
title: string;
description: string;
metric_name: string;
metric_value: number;
metric_change: number;
recommendation: string;
created_at: string;
}
interface InsightsResponse {
success: true;
data: {
insights: Insight[];
pagination: {
total: number;
limit: number;
offset: number;
has_more: boolean;
};
};
timestamp: string;
}HTTP Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Invalid or missing API key |
| 403 | Forbidden - Pro plan or higher required |
| 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/insights/a1b2c3d4-e5f6-7890-abcd-ef1234567890?range=7d&type=anomaly&severity=warning' \
-H 'X-API-Key: YOUR_API_KEY' \
-H 'Content-Type: application/json'Error Handling
Error Response (403 Forbidden)JSON
{
"success": false,
"error": {
"message": "This endpoint requires a Pro plan or higher",
"code": "PLAN_REQUIRED",
"timestamp": "2026-03-16T15:00:00.000Z"
}
}War diese Seite hilfreich?