> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blockdb.io/llms.txt
> Use this file to discover all available pages before exploring further.

# JSON-RPC Overview

> Use BlockDB as an EVM JSON-RPC endpoint compatible with standard Ethereum execution-client methods.

## Overview

BlockDB exposes a **drop-in compatible Ethereum JSON-RPC** endpoint for EVM networks. Use it when you want to connect existing tooling (web3 libraries, indexers, bots) without rewriting to BlockDB's REST endpoint format.

This page documents the BlockDB entrypoint and the key conventions you need to call Ethereum JSON-RPC successfully.

## Endpoint

```text theme={null}
POST https://api.blockdb.io/v1/evm/rpc?chain_id=<chain_id>
```

### Authentication

Send your API key on every request:

```text theme={null}
Authorization: Bearer <YOUR_API_KEY>
```

## Pricing

JSON-RPC access is included in all BlockDB plans.

* **Basic Plan**: Shared infrastructure, standard rate limits.
* **Standard & Platinum Plans**: High-throughput access with dedicated support options.

For more details, see [Pricing](/pricing/home).

## Method Compatibility

We support the **classic Ethereum execution-client JSON-RPC method families**, including:

* `eth_*`
* `net_*`

For the canonical method list and parameter conventions, see the Ethereum JSON-RPC reference:

* [Ethereum JSON-RPC API (execution client)](https://ethereum.org/developers/docs/apis/json-rpc/)

## Conventions (important)

### Hex encoding

Ethereum JSON-RPC uses hex encoding with specific rules:

* **Quantities** (block numbers, integers): hex with `0x` prefix, most compact form (`0x0` for zero)
* **Byte arrays** (hashes, addresses, calldata): hex with `0x` prefix, two hex digits per byte

### Block parameter

Many methods accept a “block parameter”. Common values include:

* `"earliest"`, `"latest"`, `"safe"`, `"finalized"`, `"pending"`
* A specific block number encoded as a hex quantity (e.g., `"0x12A05F"`).

## Examples

### Example: `eth_getBlockByNumber`

```bash theme={null}
curl -X POST "https://api.blockdb.io/v1/evm/rpc?chain_id=1" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "eth_getBlockByNumber",
    "params": ["latest", false]
  }'
```

### Example: `eth_call`

```bash theme={null}
curl -X POST "https://api.blockdb.io/v1/evm/rpc?chain_id=1" \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 2,
    "method": "eth_call",
    "params": [
      {
        "to": "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
        "data": "0x313ce567"
      },
      "latest"
    ]
  }'
```

## See also

* [EVM Primitives Overview](/api-reference/evm/primitives/overview)
* [Authorization](/api-reference/overview/authorization)
* [Pricing Overview](/pricing/home)
