Skip to content

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/health

Returns 200 OK with server status.

POST /api/snapshot

Generate a dashboard snapshot image or data export.

Parameters

ParameterTypeDefaultDescription
detailstringstandardDetail level: compact, standard, full
formatstringpngOutput format: png, svg, json
rangestring24hTime range: 30m, 1h, 6h, 12h, 24h
themestringdarkTheme: dark, light
langstringenLanguage: 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.png

Response Headers

HeaderDescription
Content-TypeMIME type of the response (image/png, image/svg+xml, application/json)
X-Snapshot-Degraded-SourcesComma-separated list of data sources that failed gracefully

Error Codes

CodeDescription
INVALID_PARAMInvalid or unsupported parameter value
RATE_LIMITEDToo many snapshot requests — try again later
COLLECT_TIMEOUTData collection timed out for one or more sources
RENDER_FAILEDSnapshot rendering failed

Released under the MIT License.