Skip to Content
API ReferenceHealth Check

Health Check

Check the operational status of the SharpAPI service, including backend connectivity and data freshness.

GET /api/v1/health

Authentication

No authentication required. This is a public endpoint.

Example Requests

curl -X GET "https://api.sharpapi.io/api/v1/health"

Response

Healthy (200)

{ "status": "ok", "version": "v1", "timestamp": "2026-02-08T15:00:00.123Z", "checks": { "redis": { "status": "ok", "latency_ms": 2 }, "data": { "status": "ok", "message": "5 sportsbook snapshots available" }, "schema": { "status": "ok", "message": "All 14 required fields present" } }, "eventLoop": { "min": 0.1, "max": 2.5, "mean": 0.4, "p99": 1.8 } }

Degraded (200)

When the service is partially functional, the status will be degraded:

{ "status": "degraded", "version": "v1", "timestamp": "2026-02-08T15:00:00.123Z", "checks": { "redis": { "status": "ok", "latency_ms": 5 }, "data": { "status": "degraded", "message": "No snapshot data in Redis" }, "schema": { "status": "degraded", "message": "Schema drift: missing fields [selectionType] in draftkings snapshot" } } }

Down (503)

When the service is unable to function, the status will be down and the HTTP status code will be 503:

{ "status": "down", "version": "v1", "timestamp": "2026-02-08T15:00:00.123Z", "checks": { "redis": { "status": "down", "message": "Redis unreachable" } } }

Response Headers

X-Request-Id: req_health456def

The health endpoint does not return rate limit headers or tier headers since it does not require authentication.

Response Fields

Top-Level Fields

FieldTypeDescription
statusstringOverall system status: ok, degraded, or down
versionstringCurrent API version
timestampstringISO 8601 timestamp of this health check
checksobjectIndividual subsystem health checks

Status Values

StatusHTTP CodeMeaning
ok200All systems operational
degraded200Functional but with reduced performance or stale data
down503Service is unavailable

Redis Check

FieldTypeDescription
statusstringRedis connectivity status: ok or down
latency_msnumber | nullRound-trip latency to Redis in milliseconds
messagestringHuman-readable status message

Data Check

FieldTypeDescription
statusstringData freshness status: ok or degraded
messagestringHuman-readable status message (e.g., “5 sportsbook snapshots available”)

Schema Check

Included on GET requests only (not HEAD). Verifies that upstream snapshot data contains all required fields.

FieldTypeDescription
statusstringSchema compatibility status: ok or degraded
messagestringHuman-readable status message (e.g., “All 14 required fields present”)

Event Loop

Optional object included when event loop monitoring is active. Reports main-thread delay statistics to detect blocking operations.

FieldTypeDescription
minnumberMinimum event loop delay (ms)
maxnumberMaximum event loop delay (ms)
meannumberMean event loop delay (ms)
p99number99th percentile event loop delay (ms)

Status Logic

The overall status is determined by the worst individual check:

  • ok - All checks are ok
  • degraded - At least one check is degraded, none are down
  • down - At least one check is down

Data Availability

ConditionStatusDescription
1+ sportsbook snapshotsokSnapshot data available in Redis
0 snapshots in RedisdegradedNo snapshot data found
Redis unreachable(not checked)Data check is skipped when Redis is down

Use Cases

Monitoring and Alerting

Use the health endpoint in your monitoring stack (Prometheus, Datadog, UptimeRobot, etc.) to detect issues:

# Simple health check for monitoring scripts STATUS=$(curl -s https://api.sharpapi.io/api/v1/health | jq -r '.status') if [ "$STATUS" != "ok" ]; then echo "ALERT: SharpAPI status is $STATUS" fi

Pre-Request Health Verification

Check health before making critical requests:

async function safeRequest(endpoint) { const health = await fetch('https://api.sharpapi.io/api/v1/health') .then(r => r.json()); if (health.status === 'down') { throw new Error('SharpAPI is currently down'); } if (health.status === 'degraded') { console.warn('SharpAPI is degraded - data may be stale'); } return fetch(`https://api.sharpapi.io/api/v1${endpoint}`, { headers: { 'X-API-Key': 'YOUR_API_KEY' } }).then(r => r.json()); }

Uptime Dashboard

import requests from datetime import datetime response = requests.get('https://api.sharpapi.io/api/v1/health') health = response.json() print(f"SharpAPI Status: {health['status'].upper()}") print(f"Version: {health['version']}") print(f"Checked at: {health['timestamp']}") print() for name, check in health['checks'].items(): status_icon = {'ok': 'PASS', 'degraded': 'WARN', 'down': 'FAIL'} print(f" [{status_icon.get(check['status'], '???')}] {name}: {check.get('message', 'healthy')}") if name == 'redis' and check.get('latency_ms') is not None: print(f" Latency: {check['latency_ms']}ms")
Last updated on