# getBlockHeight

> Returns the current block height the node has processed.

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

`getBlockHeight` returns the number of confirmed blocks beneath the current bank. Unlike slot number, block height does not count skipped slots, so it advances by one for every produced block.

A blockhash's `lastValidBlockHeight`, compared against this value, indicates whether that blockhash, and any transaction built on it, is still usable.

- 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: Blocks
- Availability: All plans
- Rate limits: Free 5/s · Operator 50/s · Blade Runner 200/s · Nexus 500/s

## Parameters

`params` is a positional JSON array, in this order:

- `config` (object, optional): Optional configuration.
  - `commitment` (string, optional, one of `finalized`, `confirmed`, `processed`, default `"finalized"`): Bank state to read the block height from.
  - `minContextSlot` (integer, optional): Minimum slot the node must have processed before answering.

## Result

- `result` (integer, optional): Current block height. A plain integer, not wrapped in a context/value envelope.

## Example: Get current block height

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": "getBlockHeight", "params": [] }'
```

Response:

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

## Notes

- Block height and slot number diverge over time because skipped slots do not advance block height, so the two are not interchangeable.
- Once `getBlockHeight` exceeds a transaction's `lastValidBlockHeight` (from `getLatestBlockhash`), that blockhash can no longer be used.

