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

AuthenticationPermalink for this section

No authentication required. This is a public endpoint.

Example RequestsPermalink for this section

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

ResponsePermalink for this section

Healthy (200)Permalink for this section

{ "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" } } }

Degraded (200)Permalink for this section

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)Permalink for this section

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 HeadersPermalink for this section

X-Request-Id: req_health456def

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

Response FieldsPermalink for this section

Top-Level FieldsPermalink for this section

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

Status ValuesPermalink for this section

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

Redis CheckPermalink for this section

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

Data CheckPermalink for this section

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

Schema CheckPermalink for this section

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”)

Status LogicPermalink for this section

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 AvailabilityPermalink for this section

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 CasesPermalink for this section

Monitoring and AlertingPermalink for this section

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 VerificationPermalink for this section

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 DashboardPermalink for this section

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