Analytics Endpoints

Query your analytics programmatically. Every analytics endpoint requires JWT authentication, belongs to exactly one API key, and takes the period as `days` (1–365, default 30); `form_key` narrows it to a single form.

Base URL: https://api.silentshield.io

GET/api/v1/keys/{id}/analytics/summary

Get an overview of requests, verdicts, and trends for a given period.

Parameters: ?days=30&form_key=contact

Response:

{"period_days": 30, "overview": {...}, "timeline": [...], "verdicts": [...], "pages": [...], "devices": [...], "browsers": [...], "reasons": [...], "blocks": {...}, "score_distribution": [...]}

GET/api/v1/keys/{id}/analytics/timeline

Get request counts grouped by time interval (hour, day, week).

Parameters: ?days=7&form_key=contact

Response:

[{"date": "2025-01-01", "total": 1800, "human": 1620, "suspicious": 110, "bot": 70}, ...]

GET/api/v1/keys/{id}/analytics/verdicts

Get detailed verdict distribution with scores.

Parameters: ?days=30&form_key=contact

Response:

{"distribution": {"human": 89.6, "suspicious": 6.4, "bot": 4.0}, "avgScore": 0.82}

GET/api/v1/keys/{id}/analytics/devices

Get device and browser breakdown.

Parameters: ?days=30&form_key=contact

Response:

{"devices": {"desktop": 65.2, "mobile": 28.1, "tablet": 4.2, "unknown": 2.5}, "browsers": {"Chrome": 58.3, "Safari": 22.1, "Firefox": 12.4, "Edge": 5.8, "Other": 1.4}}