# 支持的链

> 原文地址: https://docs.blockvectra.com/zh/chains/

BlockVectra 是多链区块链数据服务商：所有支持链提供 JSON-RPC，Data API 在已开放的链上可用。

## 一个 key，所有链

* **全链通用**：同一个 API key 可用于 BlockVectra 支持的所有区块链网络，无需为每条链单独申请 key。
* **URL 标明链名**：每次请求都通过 `{chain}` 路径段显式指定链。
* **用量跨链合计**：账户余额、CU 限流桶与免费档每秒调用数不分链，按跨链合计。
* **价格**：详见[定价页](https://blockvectra.com/zh/pricing/)。

## 免 key 试用

选择[免费公共 RPC 节点](https://blockvectra.com/zh/free/#public-rpc)，无需 API key 即可调用钱包常用方法。按网络查看公共方法与按 IP 限额，调用示例见[快速上手](https://docs.blockvectra.com/zh/quickstart/)。

## URL 模板

调用 JSON-RPC 与 Data API 的标准 URL 结构：

| 服务       | 接入方式       | URL 模板                       | 说明                                  |
| -------- | ---------- | ---------------------------- | ----------------------------------- |
| JSON-RPC | key 放在路径中  | `POST /v1/{chain}/{api_key}` | 最简形式，适合 curl 与 HTTP 客户端             |
| JSON-RPC | key 放在请求头中 | `POST /v1/{chain}`           | 在 `x-api-key: {api_key}` 请求头中传入 key |
| Data API | REST 端点    | `GET /v1/data/{chain}/…`     | 在 `x-api-key` 请求头中传入 key            |
| 状态       | 公开状态       | `GET /v1/status`             | 无需 key，返回各已公开链的状态与链头                |

> **注意**：不带链段的请求（如 `POST /v1` 或 `POST /v1/`）返回 HTTP 404 且响应体为空。调用方式详见[快速上手](https://docs.blockvectra.com/zh/quickstart/)。

## 支持的链矩阵

下表列出 BlockVectra 当前已开放的区块链网络及其服务能力：

逐链查看公开端点、带 key 方法数、订阅类型、发交易能力、状态窗口与日志跨度、数据集、相关测试网和教程。未知字段显示为未知；展开矩阵下方的链可查看该链支持的请求示例。

本表中的状态与日志限制仅适用于使用 API key 的请求。公共端点有各自独立的方法、历史和日志限制，可通过 `GET /v1/chains` 查看。在公共端点上查询日志前，请先查看 `public.methods`、`public.history_blocks` 和 `public.logs`，并以 `public.logs.max_block_range` 和 `public.logs.max_results` 为准，而不是顶层的 `max_logs_block_range`。

| 链 | {chain} | Chain ID | Tracing | 公开端点 | WebSocket | Data API | 带 key 方法数 | Webhook 推送 | 发送交易 | 发送交易（免 key 公开端点） | 历史状态窗口 | eth_getLogs 单次最大区块跨度 | Data API 数据集 | 相关测试网 | 相关教程 |
| --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- | --- |
| [Arbitrum One RPC 与 Data API](https://blockvectra.com/zh/chains/arb_mainnet/) | arb_mainnet | 42161 | ✓ | `https://api.blockvectra.com/v1/arb_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 43 | [支持 · 确认数 1–120（默认 120）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 最近 5,000 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | 未知 |
| [Arc RPC](https://blockvectra.com/zh/chains/arc_mainnet/) | arc_mainnet | 5042 | — | `https://api.blockvectra.com/v1/arc_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 未知 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Avalanche C-Chain RPC](https://blockvectra.com/zh/chains/avax_mainnet/) | avax_mainnet | 43114 | ✓ | `https://api.blockvectra.com/v1/avax_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 41 | 不支持 | 支持 | 支持 | 最近 128 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Base RPC 与 Data API](https://blockvectra.com/zh/chains/base_mainnet/) | base_mainnet | 8453 | — | `https://api.blockvectra.com/v1/base_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 39 | [支持 · 确认数 1–519（默认 1）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 最近 10,000 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | [Base](https://docs.blockvectra.com/zh/guides/base/) |
| [Berachain RPC](https://blockvectra.com/zh/chains/berachain_mainnet/) | berachain_mainnet | 80094 | — | `https://api.blockvectra.com/v1/berachain_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 9,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Boba RPC](https://blockvectra.com/zh/chains/boba_mainnet/) | boba_mainnet | 288 | — | `https://api.blockvectra.com/v1/boba_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 80,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [BNB Smart Chain RPC 与 Data API](https://blockvectra.com/zh/chains/bsc_mainnet/) | bsc_mainnet | 56 | — | `https://api.blockvectra.com/v1/bsc_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 25 | [支持 · 确认数 1–2（默认 1）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 最近 100 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | 未知 |
| [Celo RPC](https://blockvectra.com/zh/chains/celo_mainnet/) | celo_mainnet | 42220 | — | `https://api.blockvectra.com/v1/celo_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 864,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [以太坊 RPC 与 Data API](https://blockvectra.com/zh/chains/eth_mainnet/) | eth_mainnet | 1 | ✓ | `https://api.blockvectra.com/v1/eth_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 38 | [支持 · 确认数 1–82（默认 6）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 最近 250,000 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | 未知 |
| [Ethereum Sepolia RPC 与 Data API](https://blockvectra.com/zh/chains/eth_sepolia/) | eth_sepolia | 11155111 | — | `https://api.blockvectra.com/v1/eth_sepolia/public` | 支持 (newHeads, logs) | 已开放 | 29 | [支持 · 确认数 1–67（默认 6）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 未知 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | 未知 |
| [Fraxtal RPC](https://blockvectra.com/zh/chains/fraxtal_mainnet/) | fraxtal_mainnet | 252 | — | `https://api.blockvectra.com/v1/fraxtal_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 10,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Gnosis RPC 与 Data API](https://blockvectra.com/zh/chains/gnosis_mainnet/) | gnosis_mainnet | 100 | — | `https://api.blockvectra.com/v1/gnosis_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 39 | 不支持 | 支持 | 支持 | 最近 262,000 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | 未知 |
| [HyperEVM RPC 与 Data API](https://blockvectra.com/zh/chains/hyperevm_mainnet/) | hyperevm_mainnet | 999 | — | `https://api.blockvectra.com/v1/hyperevm_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 25 | [支持 · 确认数 1–1（默认 1）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 不支持 | 未知 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | [HyperEVM 回填与轮询](https://docs.blockvectra.com/zh/guides/hyperevm-backfill/) |
| [Ink RPC](https://blockvectra.com/zh/chains/ink_mainnet/) | ink_mainnet | 57073 | — | `https://api.blockvectra.com/v1/ink_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 9,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | [Ink 池发现](https://docs.blockvectra.com/zh/guides/ink-pool-discovery/) |
| [Katana RPC](https://blockvectra.com/zh/chains/katana_mainnet/) | katana_mainnet | 747474 | — | `https://api.blockvectra.com/v1/katana_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 86,400 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Linea RPC](https://blockvectra.com/zh/chains/linea_mainnet/) | linea_mainnet | 59144 | — | `https://api.blockvectra.com/v1/linea_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 128 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Metal L2 RPC](https://blockvectra.com/zh/chains/metall2_mainnet/) | metall2_mainnet | 1750 | — | `https://api.blockvectra.com/v1/metall2_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 10,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Mode RPC](https://blockvectra.com/zh/chains/mode_mainnet/) | mode_mainnet | 34443 | — | `https://api.blockvectra.com/v1/mode_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 10,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [OP Mainnet RPC 与 Data API](https://blockvectra.com/zh/chains/op_mainnet/) | op_mainnet | 10 | — | `https://api.blockvectra.com/v1/op_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 39 | 不支持 | 支持 | 支持 | 最近 1,296,000 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | 未知 |
| [Polygon RPC 与 Data API](https://blockvectra.com/zh/chains/polygon_mainnet/) | polygon_mainnet | 137 | ✓ | `https://api.blockvectra.com/v1/polygon_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 43 | [支持 · 确认数 1–200（默认 200）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 最近 126 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、数据新鲜度 | 未知 | 未知 |
| [Robinhood Chain RPC 与 Data API](https://blockvectra.com/zh/chains/robinhood_mainnet/) | robinhood_mainnet | 4663 | ✓ | `https://api.blockvectra.com/v1/robinhood_mainnet/public` | 支持 (newHeads, logs) | 已开放 | 43 | [支持 · 确认数 1–1（默认 1）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 最近 900 个区块的历史状态 | 1,000 个区块 | 区块、交易、地址交易、转账、代币元数据、DEX 成交、代币化股票、Trace、数据新鲜度 | 未知 | [HoodFi 名称记录](https://docs.blockvectra.com/zh/guides/hoodfi-name-records/), [Robinhood Chain 主网](https://docs.blockvectra.com/zh/guides/robinhood-chain/), [股票代币乘数与指标](https://docs.blockvectra.com/zh/guides/stock-token-multiplier/), [代币化股票指标](https://docs.blockvectra.com/zh/guides/stocks/) |
| [Robinhood Chain Testnet RPC](https://blockvectra.com/zh/chains/robinhood_testnet/) | robinhood_testnet | 46630 | ✓ | `https://api.blockvectra.com/v1/robinhood_testnet/public` | 支持 (newHeads, logs) | 暂未开放 | 43 | [支持 · 确认数 1–1（默认 1）](https://blockvectra.com/zh/webhooks/), [Webhook 推送指南](https://docs.blockvectra.com/zh/guides/webhook-push/) | 支持 | 支持 | 最近 1,023 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | [测试网水龙头](https://docs.blockvectra.com/zh/guides/robinhood-testnet-faucet/), [Robinhood Chain 测试网入门](https://docs.blockvectra.com/zh/guides/robinhood-testnet-starter/) |
| [Rootstock RPC](https://blockvectra.com/zh/chains/rootstock_mainnet/) | rootstock_mainnet | 30 | — | `https://api.blockvectra.com/v1/rootstock_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 27 | 不支持 | 支持 | 支持 | 最近 6,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Soneium RPC](https://blockvectra.com/zh/chains/soneium_mainnet/) | soneium_mainnet | 1868 | — | `https://api.blockvectra.com/v1/soneium_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 9,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Sonic RPC](https://blockvectra.com/zh/chains/sonic_mainnet/) | sonic_mainnet | 146 | ✓ | `https://api.blockvectra.com/v1/sonic_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 43 | 不支持 | 支持 | 支持 | 最近 11,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Unichain RPC](https://blockvectra.com/zh/chains/unichain_mainnet/) | unichain_mainnet | 130 | — | `https://api.blockvectra.com/v1/unichain_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 85,500 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [World Chain RPC](https://blockvectra.com/zh/chains/world_mainnet/) | world_mainnet | 480 | — | `https://api.blockvectra.com/v1/world_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 30,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [X Layer RPC](https://blockvectra.com/zh/chains/xlayer_mainnet/) | xlayer_mainnet | 196 | ✓ | `https://api.blockvectra.com/v1/xlayer_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 43 | 不支持 | 支持 | 支持 | 最近 250,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |
| [Zora RPC](https://blockvectra.com/zh/chains/zora_mainnet/) | zora_mainnet | 7777777 | — | `https://api.blockvectra.com/v1/zora_mainnet/public` | 支持 (newHeads, logs) | 暂未开放 | 39 | 不支持 | 支持 | 支持 | 最近 10,000 个区块的历史状态 | 1,000 个区块 | 不支持 | 未知 | 未知 |

## 拿到 key 之后

### Arbitrum One

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/arb_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/arb_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/arb_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/arb_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Arc

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/arc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/arc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/arc_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Avalanche C-Chain

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/avax_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/avax_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/avax_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Base

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/base_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/base_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/base_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/base_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Berachain

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/berachain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/berachain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/berachain_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Boba

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/boba_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/boba_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/boba_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### BNB Smart Chain

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/bsc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/bsc_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/bsc_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/bsc_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Celo

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/celo_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/celo_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/celo_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### 以太坊

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/eth_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/eth_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Ethereum Sepolia

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_sepolia' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/eth_sepolia' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/eth_sepolia/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/eth_sepolia'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Fraxtal

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/fraxtal_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/fraxtal_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/fraxtal_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Gnosis

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/gnosis_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/gnosis_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/gnosis_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/gnosis_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### HyperEVM

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/hyperevm_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/hyperevm_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/hyperevm_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/hyperevm_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Ink

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/ink_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/ink_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/ink_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Katana

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/katana_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/katana_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/katana_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Linea

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/linea_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/linea_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/linea_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Metal L2

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/metall2_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/metall2_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/metall2_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Mode

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/mode_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/mode_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/mode_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### OP Mainnet

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/op_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/op_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/op_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/op_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Polygon

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/polygon_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/polygon_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/polygon_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/polygon_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Robinhood Chain

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### 数据 API

```bash
curl -fsS 'https://api.blockvectra.com/v1/data/robinhood_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

[数据 API](https://docs.blockvectra.com/zh/api/data/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/robinhood_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Robinhood Chain Testnet

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_testnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/robinhood_testnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/robinhood_testnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[创建 Webhook 订阅](https://blockvectra.com/zh/webhooks/) · [创建 Webhook 订阅](https://docs.blockvectra.com/zh/guides/webhook-push/) · [用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Rootstock

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/rootstock_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/rootstock_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/rootstock_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Soneium

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/soneium_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/soneium_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/soneium_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Sonic

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/sonic_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/sonic_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/sonic_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Unichain

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/unichain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/unichain_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/unichain_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### World Chain

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/world_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/world_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/world_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### X Layer

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/xlayer_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/xlayer_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/xlayer_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

### Zora

#### eth_getLogs

```bash
set -eu
: "${BLOCKVECTRA_API_KEY:?BLOCKVECTRA_API_KEY is required}"
validate_response='import json,re,sys
response=json.load(sys.stdin)
if not (type(response) is dict and response.get("jsonrpc")=="2.0" and type(response.get("id")) is int and response["id"]==1 and "error" not in response and "result" in response):
    sys.exit("Invalid JSON-RPC response")
result=response["result"]
if sys.argv[1]=="head":
    if not (type(result) is str and re.fullmatch(r"0x(?:0|[1-9a-fA-F][0-9a-fA-F]*)",result)):
        sys.exit("Invalid block quantity")
    print(result)
else:
    if not (type(result) is list and all(type(log) is dict for log in result)):
        sys.exit("Invalid logs result")
    print(json.dumps(response,indent=2))'
head_response=$(curl -fsS 'https://api.blockvectra.com/v1/zora_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}')
head=$(printf '%s' "$head_response" | python3 -c "$validate_response" head)
logs_response=$(curl -fsS 'https://api.blockvectra.com/v1/zora_mainnet' -H "x-api-key: $BLOCKVECTRA_API_KEY" -H 'Content-Type: application/json' \
  -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"eth_getLogs\",\"params\":[{\"fromBlock\":\"$head\",\"toBlock\":\"$head\"}]}")
printf '%s' "$logs_response" | python3 -c "$validate_response" logs
```

[eth_getLogs](https://docs.blockvectra.com/zh/guides/getlogs-block-range/)

#### WebSocket

```bash
echo '{"jsonrpc":"2.0","id":1,"method":"eth_subscribe","params":["newHeads"]}' | websocat --no-close -H="x-api-key: $BLOCKVECTRA_API_KEY" 'wss://api.blockvectra.com/v1/zora_mainnet'
```

[WebSocket](https://docs.blockvectra.com/zh/guides/websocket-subscriptions/)

[用量与 CU](https://console.blockvectra.com/usage/) · [充值](https://console.blockvectra.com/billing/)

**HyperEVM**
HyperEVM 的区块包含 HyperCore 系统交易（发送方地址为 0x2222…2222 或 0x20…，gasPrice 为 0）。

[查看实时状态 →](https://blockvectra.com/zh/status/)

## 以太坊

* **Chain ID**：`1`
* <strong>链名（URL 中的 `{chain}`）</strong>：`eth_mainnet`，例如 `POST /v1/eth_mainnet/{api_key}`、`GET /v1/data/eth_mainnet/…`。

### JSON-RPC

* **可用方法**：每条链可用的方法以 `GET /v1/chains` 的 `methods.allow` / `deny` 为准（参见[方法策略](https://docs.blockvectra.com/zh/api/json-rpc/#方法策略)），不在范围内的方法返回 `-32601`。
* **只保留近期数据**：历史状态窗口以 `GET /v1/chains` 的 `state_window_blocks`（区块数）为准。超出窗口的历史状态查询返回 `-32011`（不计费）；超出窗口的区块、收据与日志查询返回 `-32000 old data not available due to pruning`（不计费）；按 hash 查询窗口外的交易返回 `result: null`。
* **`eth_getLogs`**：单次请求的最大区块跨度以 `GET /v1/chains` 的 `max_logs_block_range` 为准。

### Data API

* **只保留近期数据**：以太坊数据窗口以 `GET /v1/data/chains` 的 `coverage.from_block` 为准。低于起点的区块号或窗口返回 `422 no_coverage`；已移出窗口的交易哈希返回 `404`。
* **`from_block` 为 `null` 时**：起点暂时未知。不要把它当作 `0` 或完整历史，在它恢复为整数之前不要对以太坊发送历史请求（按区块号、窗口或哈希），这类请求会返回 `503 unavailable`。
* **`503 gateway_overloaded`**：请退避后重试（`Retry-After: 1`）。
* **数据集**：以太坊提供的数据集见 `GET /v1/data/chains` 的 `features`，其余返回 `422 no_coverage`（不计费）。地址交易和转账只覆盖这段时间，跨过起点的响应标记为 `meta.coverage: "partial"`。

## 用程序发现链

可通过以下公开端点查询已支持的链及其状态：

### 1. 服务状态（`GET /v1/status`）

公开端点，无需 API key（CORS `*`），只列出已公开的链，返回各链的状态与索引链头：

```bash
curl -s "https://api.blockvectra.com/v1/status"
```

响应示例：

```json
{
  "checked_at": "2026-09-28T07:40:00Z",
  "gateway": { "status": "ok" },
  "chains": [
    {
      "chain": "robinhood_mainnet",
      "name": "Robinhood Chain",
      "chain_id": 4663,
      "jsonrpc": true,
      "data": true,
      "status": "ok",
      "data_status": "ok",
      "sync": { "stage": "synced", "node_block": 74600000, "target_block": null },
      "head": {
        "block": 74600000,
        "time": "2026-09-28T07:39:58Z",
        "lag_seconds": 3
      }
    },
    {
      "chain": "eth_mainnet",
      "name": "Ethereum",
      "chain_id": 1,
      "jsonrpc": true,
      "data": true,
      "status": "ok",
      "data_status": "ok",
      "sync": { "stage": "synced", "node_block": 26010000, "target_block": null },
      "head": {
        "block": 26010000,
        "time": "2026-09-28T07:39:59Z",
        "lag_seconds": 1
      }
    }
  ]
}
```

每个元素的 `name` 始终是该链的英文显示名。`jsonrpc` 与 `data` 分别表示该链的 JSON-RPC 与 Data API 是否已开放；`status` 为 `"ok"` 或 `"unavailable"`。若某条链正在同步，该链的调用会返回 `-32010`。`/v1/status` 的 `status` 表示 JSON-RPC 是否正常，`data_status` 表示 Data API 是否正常（`"ok"` / `"syncing"` / `"unavailable"`）；`/v1/data/chains` 中 `coverage.has_data` 为 `false` 表示该链尚无数据。

### 2. 查询 Data API 链列表（`GET /v1/data/chains`）

需在 `x-api-key` 请求头中传入 API key（计费），仅返回 Data API 公开的链，以及每条链支持的能力（`features`）、数据覆盖的区块范围（`coverage`）、节点的共识 `safe`/`finalized` 标记与其状态（`finality`）与单请求上限（`limits`）：

```bash
curl -s "https://api.blockvectra.com/v1/data/chains" \
  -H "x-api-key: $BLOCKVECTRA_API_KEY"
```

响应示例：

```json
{
  "data": [
    {
      "chain": "robinhood_mainnet",
      "chain_slug": "ROBINHOOD_MAINNET",
      "name": "Robinhood Chain",
      "chain_id": 4663,
      "chain_external_id": "eip155:4663",
      "features": [
        "blocks", "transactions", "address_transactions", "transfers", "token_metadata",
        "balances", "holders", "nfts", "dex_swaps", "dex_prices", "stocks", "traces", "freshness"
      ],
      "coverage": { "from_block": 0, "traces_from_block": 1000000, "has_data": true },
      "finality": { "model": "node_tags", "status": "ok", "safe_block": 74599400, "finalized_block": 74598900 },
      "limits": { "max_page_size": 500, "max_window_blocks": 100000, "max_pools_for_token": 200, "max_batch_addresses": 100 }
    },
    {
      "chain": "eth_mainnet",
      "chain_slug": "ETH_MAINNET",
      "name": "Ethereum",
      "chain_id": 1,
      "chain_external_id": "eip155:1",
      "features": ["blocks", "transactions", "address_transactions", "transfers", "token_metadata", "freshness"],
      "coverage": { "from_block": 1000000, "traces_from_block": null, "has_data": true },
      "finality": { "model": "node_tags", "status": "stale", "safe_block": 26009950, "finalized_block": 26009900 },
      "limits": { "max_page_size": 500, "max_window_blocks": 100000, "max_pools_for_token": 200, "max_batch_addresses": 100 }
    }
  ]
}
```

`finality` 包含节点的共识标记（`model` 为 `"node_tags"`）、标记状态（`status` 为 `"ok"`、`"stale"` 或 `"unavailable"`），以及当前的 `safe_block` 与 `finalized_block`（`safe_block >= finalized_block`，且仅在状态为 `"unavailable"` 时两者为 `null`）。

`coverage.from_block` 是当前已索引的最低区块，为实时读取。当历史追溯至创世区块时为 `0`。仅当该链尚无任何已索引区块（`has_data = false`）或暂时无法确定起始高度时为 `null`：此时代表未知（不可视为 `0` 或全量历史），针对该链的历史数据请求将返回 `503 unavailable`。请在运行时从该端点动态读取，不要硬编码。`coverage.traces_from_block` 是 trace 数据的起始区块；早于它或落在缺口内的 trace 请求返回 `422 no_coverage`（不计费）。

调用 `/v1/data/{chain}/…` 时，若链未知或暂未公开，返回 HTTP `404`，`error.code` 为 `not_found`（不计费；链名必须为全小写 slug）。
