Skip to content

API reference

Stats

Platform infrastructure health for an engine or path over the last hour. Free.

GEThttp://localhost:4000/v1/stats
Credit cost
Free
Async
No
404 billed
—
Plans
All plans

Authenticate with the x-api-key header. See authentication and credits & billing.

Parameters

Query

ParameterDescription
engine
string

API family, e.g. capture, content, analyze, website.

path
string

Specific endpoint path, e.g. /v1/capture.

Code examples

curl "http://localhost:4000/v1/stats?engine=capture" \
  -H "x-api-key: $SNAPLENS_API_KEY"

Responses

200 — application/json

{
  "engine": "capture",
  "path": null,
  "health": "operational",
  "success_rate": 99.4,
  "avg_response_time_ms": 1184,
  "window": "1h"
}

Usage

Pass either engine (an API family: capture, content, analyze, website) or path (a specific endpoint such as /v1/capture).

Response fields

Field Type Description
engine string | null Engine queried.
path string | null Path queried.
health string operational, degraded or down.
success_rate number Percentage of successful requests across the platform.
avg_response_time_ms number Average response time in milliseconds.
window string Always "1h" — the last hour.

Health thresholds

Health Success rate
operational ≥ 90%
degraded 50–90%
down < 50%

Use it to route traffic, pause batch jobs or show a banner in your app. The public status page shows the same data.

Availability

Stats access must be enabled for your workspace. If it isn't, the endpoint returns 403 — contact support to enable it.

Errors

Errors return JSON { "error": "…" }. Failed requests are never billed. Full list in Status codes.

StatusMeaning
400Neither or an invalid engine / path
401Invalid, inactive or expired API key; plan rate limit (Rate limit exceeded: …) or key quota (…: quota daily)
403Stats are not enabled for your account, or IP temporarily blocked
500Unexpected server error