<!-- source: https://secondlayer.tools/docs/api-reference#list-bitcoin-headers -->

## Bitcoin block headers

`GET /v1/proofs/bitcoin-headers`

Raw 80-byte Bitcoin headers from `from`, at most 2016 (one difficulty period) per call. Check proof of work and linkage yourself from a checkpoint you trust. Free and keyless: never metered, no account needed. Hosted limits: 10 requests per second per IP (1 for witnesses), or 20 (2) per account with a key. Bytes are passed through unchanged; verify them, do not trust them.

### Query parameters

| Name | Type | Description |
| --- | --- | --- |
| `from` | integer, required | First Bitcoin height to return. |
| `count` | integer · 1 to 2016, required | Number of headers, 1 to 2016. |

### Returns

One `BitcoinHeaders` object.

### Responses

- `200` Consecutive headers starting at `from`
- `400` A path or query parameter is malformed (`VALIDATION_ERROR`): hashes must be exact-length hex, heights non-negative integers
- `401` This bind requires the instance token, and it was missing or wrong
- `404` The sidecar has no header at `from`
- `429` Rate limited; retry after `Retry-After` seconds
- `502` The node or proof sidecar could not be reached, or answered with an unexpected status (`PROOF_SOURCE_ERROR`)
- `503` `PROOFS_UNAVAILABLE`: this instance has no proof sidecar (`PROOF_SIDECAR_URL` unset). `PROOF_SOURCE_BUSY`: the sidecar is busy; retry after `Retry-After` seconds

### Example

```bash
curl https://api.secondlayer.tools/v1/proofs/bitcoin-headers \
  -H "Authorization: Bearer $SECONDLAYER_API_KEY"
```

```json
{
  "from": 0,
  "headers": [
    "0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c"
  ]
}
```
