REST API
Claw Insights provides REST endpoints for health checks and snapshot generation.
GET /health
Health check endpoint. No authentication required.
bash
curl http://127.0.0.1:41041/healthReturns 200 OK with server status.
POST /api/snapshot
Generate a dashboard snapshot image or data export.
Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
detail | string | standard | Detail level: compact, standard, full |
format | string | png | Output format: png, svg, json |
range | string | 24h | Time range: 30m, 1h, 6h, 12h, 24h |
theme | string | dark | Theme: dark, light |
lang | string | en | Language: en, zh |
Example
bash
curl -X POST http://127.0.0.1:41041/api/snapshot \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{"format": "png", "detail": "full", "range": "24h", "theme": "dark"}' \
-o snapshot.pngResponse Headers
| Header | Description |
|---|---|
Content-Type | MIME type of the response (image/png, image/svg+xml, application/json) |
X-Snapshot-Degraded-Sources | Comma-separated list of data sources that failed gracefully |
Error Codes
| Code | Description |
|---|---|
INVALID_PARAM | Invalid or unsupported parameter value |
RATE_LIMITED | Too many snapshot requests — try again later |
COLLECT_TIMEOUT | Data collection timed out for one or more sources |
RENDER_FAILED | Snapshot rendering failed |