# archive_getCoverage

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

POST https://zerointerop-mainnet.g.alchemy.com/v2/{apiKey}

Returns the published coverage of the Interop Zone historical archive. `earliest` is the first zone block the archive serves, and `head` is the latest published block. `head` is `null` before the archive has published any block.

Reference: https://www.alchemy.com/docs/chains/zero/zero-api-endpoints/archive-get-coverage

## Result

**Archive coverage** (object): The first and latest zone blocks served by the archive.

## Example

### Response

```json
{
  "jsonrpc": "2.0",
  "result": {
    "earliest": "0x4b6d",
    "head": {
      "hash": "0xe6b301f65cfaf7ab489ddee7f0039f749db81cb562c03962b409161267cef8cb",
      "number": "0x9fbf",
      "stateRoot": "0x005b057187d2ec393dce3be7685179c26b9d55cda11dc93c281e3f9123f574ad"
    }
  },
  "id": 1
}
```

## Code Examples

### cURL

```bash
curl --request POST \
  --url https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo \
  --header 'Content-Type: application/json' \
  --data '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "archive_getCoverage"
}'
```

### JavaScript

```javascript
const options = {
  method: 'POST',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({jsonrpc: '2.0', id: 1, method: 'archive_getCoverage'})
};

fetch('https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo', options)
  .then(res => res.json())
  .then(res => console.log(res))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo"

payload = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "archive_getCoverage"
}
headers = {"Content-Type": "application/json"}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
```

### Go

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo"

	payload := strings.NewReader("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"archive_getCoverage\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(string(body))

}
```

### Java

```java
HttpResponse<String> response = Unirest.post("https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo")
  .header("Content-Type", "application/json")
  .body("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"archive_getCoverage\"\n}")
  .asString();
```

### C#

```csharp
using RestSharp;


var options = new RestClientOptions("https://zerointerop-mainnet.g.alchemy.com/v2/docs-demo");
var client = new RestClient(options);
var request = new RestRequest("");
request.AddJsonBody("{\n  \"jsonrpc\": \"2.0\",\n  \"id\": 1,\n  \"method\": \"archive_getCoverage\"\n}", false);
var response = await client.PostAsync(request);

Console.WriteLine("{0}", response.Content);

```


## OpenRPC Method Specification

```yaml
name: archive_getCoverage
summary: Returns the range of zone blocks available from the historical archive.
description: Returns the published coverage of the Interop Zone historical archive. `earliest` is the first zone block the archive serves, and `head` is the latest published block. `head` is `null` before the archive has published any block.
x-compute-units: 20
params: []
result:
  name: Archive coverage
  description: The first and latest zone blocks served by the archive.
  schema:
    title: Archive coverage
    type: object
    required:
      - earliest
      - head
    properties:
      earliest:
        title: Earliest block
        description: The first zone block number the archive serves.
        type: string
        pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
      head:
        title: Head
        description: The latest published zone block, or `null` before the archive has published any block.
        oneOf:
          - title: Published head
            type: object
            required:
              - number
              - hash
              - stateRoot
            properties:
              number:
                title: Block number
                description: The number of the latest published zone block.
                type: string
                pattern: ^0x([1-9a-f]+[0-9a-f]*|0)$
              hash:
                title: Block hash
                description: The hash of the latest published zone block.
                type: string
                pattern: ^0x[0-9a-f]{64}$
              stateRoot:
                title: State root
                description: The state root of the latest published zone block.
                type: string
                pattern: ^0x[0-9a-f]{64}$
          - title: Not Found (null)
            type: 'null'
examples:
  - name: archive_getCoverage example
    params: []
    result:
      name: Archive coverage
      value:
        earliest: '0x4b6d'
        head:
          hash: '0xe6b301f65cfaf7ab489ddee7f0039f749db81cb562c03962b409161267cef8cb'
          number: '0x9fbf'
          stateRoot: '0x005b057187d2ec393dce3be7685179c26b9d55cda11dc93c281e3f9123f574ad'
errors:
  - code: -32000
    message: Archive store error
```
