# Get best NISP at height

`GET /mining/bestNISP` · Lithos client API · Mining · requires the `api_key` header

Source: https://lithosprotocol.org/docs/api/get-best-nisp-at-height

Returns the best NISP produced for a given height and score, with exactly 10 super-shares

## Parameters

| Name | In | Type | Required | Description |

|---|---|---|---|---|

| `height` | query | integer · int32 | yes | Height that all super shares in the NISP must be below |

| `score` | query | integer · int64 | yes | Score that all super shares in this NISP must be above |

## Responses

### 200: Best NISP representation with 10 super shares

`NISPRepresentation`

- `score` (integer · int64, required): Score associated with this NISP, to be used in payout calculations
- `height` (integer · int32, required): Height all super-shares in this NISP must be under
- `headers` (string[], required): Header bytes associated with each super-share in this NISP
- `bytes` (string, required): Serialized (hex-encoded) bytes of this NISP

### 404: Could not produce a NISP for the given height

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

### default: Error

`ApiError`

- `error` (integer, required): Error code
- `reason` (string, required): Error message explaining the reason of the error
- `detail` (string, required): Detailed error description

## Example request

```bash
curl -X GET "http://localhost:9000/mining/bestNISP?height=0&score=5000000" \
  -H "api_key: $LITHOS_API_KEY"
```

## Example response

```json
{
  "score": 5000000,
  "height": 45096,
  "headers": [
    "04ecc45f0b20659f0a8a791872cf625d24b45832cfd3ac910da7cc9f560d42332b6ce08f276d1f3e8b45e637fa4918b3ea3c9d8c6d57ed8ee9fb1379d1b3d7756819a95ffafa172cb015ebf8e16c4ab4d3afcd34297e16206c4c8811a25bae6be43cd9c5e521b40ed281ddb1a1ebc52dfc1aa2835e20b20e795d979c8c025d23ae10edacdfe5ac330b65ac4eb10bdc52a7ab78abdfba7ef606a82c95168840839f1ca4da46c597630502383dc9be010000000002856c5e4eb4b915005dccb8e0f42bed1777cae48565be13a77cbf31e3c93f45150000000000000000"
  ],
  "bytes": "00f6318aa84791d0...a0bdc8045a70f931"
}
```
