Analytics API
The analytics API has two halves:
- Beacon endpoints — public, high-volume endpoints doc sites call to record page views, searches, and chat interactions. Deployed doc sites include the tracking beacon automatically; you only call these yourself for custom integrations.
- Dashboard endpoints — authenticated endpoints that return aggregated metrics.
Beacon Endpoints (public, no auth)
All beacons return 202 Accepted immediately and process asynchronously.
Track Page View
/guides/quickstart.desktop, mobile, or tablet.
Track Search
Track Chat Interaction
thumbs_up or thumbs_down.
Dashboard Endpoints (auth required)
All accept an optional ?days=30 query parameter (default 30).
| Endpoint | Returns |
|---|---|
GET /analytics/summary |
Totals: views, visitors, searches, AI questions — see Get Summary |
GET /analytics/top-pages |
Most viewed pages (?limit=20) |
GET /analytics/views-over-time |
Daily page view series |
GET /analytics/searches |
Popular searches + zero-result queries |
GET /analytics/gaps |
Documentation gaps detected from AI chat |
GET /analytics/health |
Per-page content health scores |
GET /analytics/content-health |
Aggregate health — see Content Health |
GET /analytics/annotation-coverage |
@stx coverage — see Annotation Coverage |
All are relative to /v1/projects/{projectId}.
Example
curl "https://api.syntext.dev/v1/projects/prj_abc123/analytics/top-pages?days=7&limit=10" \
-H "Authorization: Bearer stx_abc12345_..."
The dashboard at syntext.dev visualizes all of this — the API exists for custom reporting and exports. See Analytics & Insights for the feature guide.