# getHealth

> Reports whether the RPC node is caught up with the cluster and safe to send traffic to.

Source: https://docs.constant-k.com/rpc/http/gethealth/

`getHealth` is a liveness probe: it reports whether the backend node that answers the call considers itself healthy, meaning its slot distance behind the cluster is within an acceptable bound. It takes no parameters and resolves quickly, so load balancers, failover scripts and keepalive pings use it instead of a heavier call like `getSlot`.

constant-k's edge routers poll it to decide whether a backend node keeps receiving traffic. A healthy response means the node is not stale, not that every other method is fast.

- Transport: HTTP, JSON-RPC 2.0 `POST` to `https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY` (New York) or `https://rpc-frankfurt.constant-k.com/?api-key=YOUR_API_KEY` (Frankfurt) or `https://rpc-amsterdam.constant-k.com/?api-key=YOUR_API_KEY` (Amsterdam). The key also works as an `x-api-key` header.
- Category: Network & Cluster
- Availability: All plans
- Rate limits: Free 5/s · Operator 50/s · Blade Runner 200/s · Nexus 500/s

## Parameters

None.

## Result

- `result` (string, optional, one of `ok`): The literal string `ok` when the node is healthy. An unhealthy node does not return an alternate string here — it returns a JSON-RPC error instead (see Notes).

## Example: Check node health

Request:

```bash
curl "https://rpc-newyork.constant-k.com/?api-key=YOUR_API_KEY" \
  -X POST \
  -H "Content-Type: application/json" \
  -d '{ "jsonrpc": "2.0", "id": 1, "method": "getHealth" }'
```

Response:

```json
{
  "jsonrpc": "2.0",
  "result": "ok",
  "id": 1
}
```

## Notes

- An unhealthy node replies with a JSON-RPC error, code `-32005` (`Node is unhealthy`), whose `data` payload includes `numSlotsBehind` when known; any error response here indicates an unhealthy node, not only that specific code.
- `getHealth` is the recommended keepalive call for long-lived WebSocket connections on constant-k.
- A healthy result reflects only the one backend node that answered, not the whole constant-k fleet, so it functions as a spot check rather than a fleet-wide guarantee.

