> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.galleon8.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.galleon8.com/_mcp/server.

# Query API Quickstart

> Make a first Advanced API request for indexed block data.

This quickstart shows how to make a first Query API request over HTTPS using JSON-RPC 2.0.

## Prerequisites

Before you start, make sure you have:

* A W3api project with Advanced API access.
* A project API key copied from the W3api platform.
* A terminal with `curl`.

Keep your API key private. Do not commit it to source control or expose it in frontend code.

---

## Set Your Endpoint

Query API requests use the Advanced API multichain endpoint:

```shell
https://rpc.ankr.com/multichain/<apiKey>
```

Replace `<apiKey>` with your project API key. In the examples below, store the full URL as `YOUR_ADVANCED_API_ENDPOINT`.

---

## Make a Request with curl

Use `ankr_getBlocks` to request indexed block data for a block range:

```bash
curl -X POST YOUR_ADVANCED_API_ENDPOINT \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "ankr_getBlocks",
    "params": {
      "blockchain": "eth",
      "fromBlock": 19000000,
      "toBlock": 19000010
    },
    "id": 1
  }'
```

A successful response returns a JSON-RPC `result` object with indexed block data for the requested range:

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "blocks": [
      {
        "blockchain": "eth",
        "number": "0x121eac0",
        "hash": "0x9f1b8b76b0f5d8f6e0a2b9c8f4a3b7d6e5c4a1f8b2d9c7e6f5a4b3c2d1e0f9a8",
        "parentHash": "0x4d5c6b7a8f9e0d1c2b3a4958675645342312f0e9d8c7b6a5f4e3d2c1b0a99887",
        "timestamp": "0x659bf2a8",
        "transactions": []
      }
    ]
  }
}
```