Query API Quickstart
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:
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:
A successful response returns a JSON-RPC result object with indexed block data for the requested range: