支援的鏈
按鏈查看支援的區塊鏈網路、Chain ID 與端點地址,一個 API key 即可跨鏈呼叫 JSON-RPC 與 Data API。每條鏈的可用方法與歷史狀態視窗以鏈上公布的清單為準,超出視窗的請求會被拒絕且不計費。
BlockVectra 是多鏈區塊鏈資料服務商:在我們支援的每一條鏈上提供 JSON-RPC,並在已開放的鏈上提供 Data API。
一個 key,暢通所有鏈
- 通用 key:同一個 API key 可用於 BlockVectra 支援的所有區塊鏈網路——無需為每條鏈單獨申請 key。
- URL 中指定鏈:每個請求透過路徑中的
{chain}參數明確指定目標鏈。 - 統一計量:帳戶餘額、Compute Unit (CU) 速率限制貯體以及免費方案的每秒請求數上限在所有鏈間共用。
- 計費:參見定價。
免 API key 體驗
選擇免費公開 RPC 端點,無需 API key 即可呼叫錢包常用方法。按網路檢視公開方法與依 IP 限額;呼叫範例見快速入門。
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 且回應主體為空。設定詳情見快速入門。
支援的鏈矩陣
目前在 BlockVectra 上可用的區塊鏈網路及其服務能力:
逐鏈檢視公開端點、帶 key 方法、訂閱類型、傳送交易能力、狀態視窗與日誌跨度、資料集、相關測試網和指南。未知資訊顯示為未知;展開矩陣下方的鏈可檢視該鏈支援的請求範例。
| 鏈 | {chain} | Chain ID | Tracing | 公開端點 | WebSocket | Data API | 帶 key 方法數 | Webhook 推送 | 傳送交易 | 傳送交易(免 key 公開端點) | 歷史狀態保留範圍 | eth_getLogs 單次最大區塊跨度 | Data API 資料集 | 相關測試網 | 相關教學 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| arb_mainnet RPC 與 Data API | arb_mainnet | 42161 | ✓ | https://api.blockvectra.com/v1/arb_mainnet/public | 支援 (newHeads, logs) | 已開放 | 43 | 支援 · 確認數 1–120(預設 120) Webhook 推送指南 | 支援 | 支援 | 最近 5,000 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | 未知 |
| arc_mainnet RPC | arc_mainnet | 5042 | — | https://api.blockvectra.com/v1/arc_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 未知 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| avax_mainnet RPC | avax_mainnet | 43114 | ✓ | https://api.blockvectra.com/v1/avax_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 41 | 不支援 | 支援 | 支援 | 最近 128 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| base_mainnet RPC 與 Data API | base_mainnet | 8453 | — | https://api.blockvectra.com/v1/base_mainnet/public | 支援 (newHeads, logs) | 已開放 | 39 | 支援 · 確認數 1–519(預設 1) Webhook 推送指南 | 支援 | 支援 | 最近 10,000 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | Base |
| berachain_mainnet RPC | berachain_mainnet | 80094 | — | https://api.blockvectra.com/v1/berachain_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 9,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| boba_mainnet RPC | boba_mainnet | 288 | — | https://api.blockvectra.com/v1/boba_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 80,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| bsc_mainnet RPC 與 Data API | bsc_mainnet | 56 | — | https://api.blockvectra.com/v1/bsc_mainnet/public | 支援 (newHeads, logs) | 已開放 | 25 | 支援 · 確認數 1–2(預設 1) Webhook 推送指南 | 支援 | 支援 | 最近 100 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | 未知 |
| celo_mainnet RPC | celo_mainnet | 42220 | — | https://api.blockvectra.com/v1/celo_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 864,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| 以太坊 RPC 與 Data API | eth_mainnet | 1 | ✓ | https://api.blockvectra.com/v1/eth_mainnet/public | 支援 (newHeads, logs) | 已開放 | 38 | 支援 · 確認數 1–82(預設 6) Webhook 推送指南 | 支援 | 支援 | 最近 250,000 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | 未知 |
| eth_sepolia RPC 與 Data API | eth_sepolia | 11155111 | — | https://api.blockvectra.com/v1/eth_sepolia/public | 支援 (newHeads, logs) | 已開放 | 29 | 支援 · 確認數 1–67(預設 6) Webhook 推送指南 | 支援 | 支援 | 未知 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | 未知 |
| fraxtal_mainnet RPC | fraxtal_mainnet | 252 | — | https://api.blockvectra.com/v1/fraxtal_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 10,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| gnosis_mainnet RPC 與 Data API | gnosis_mainnet | 100 | — | https://api.blockvectra.com/v1/gnosis_mainnet/public | 支援 (newHeads, logs) | 已開放 | 39 | 不支援 | 支援 | 支援 | 最近 262,000 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | 未知 |
| HyperEVM RPC 與 Data API | hyperevm_mainnet | 999 | — | https://api.blockvectra.com/v1/hyperevm_mainnet/public | 支援 (newHeads, logs) | 已開放 | 25 | 支援 · 確認數 1–1(預設 1) Webhook 推送指南 | 支援 | 不支援 | 未知 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | HyperEVM 回填與輪詢 |
| ink_mainnet RPC | ink_mainnet | 57073 | — | https://api.blockvectra.com/v1/ink_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 9,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | Ink 池发现 |
| katana_mainnet RPC | katana_mainnet | 747474 | — | https://api.blockvectra.com/v1/katana_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 86,400 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| linea_mainnet RPC | linea_mainnet | 59144 | — | https://api.blockvectra.com/v1/linea_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 128 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| metall2_mainnet RPC | metall2_mainnet | 1750 | — | https://api.blockvectra.com/v1/metall2_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 10,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| mode_mainnet RPC | mode_mainnet | 34443 | — | https://api.blockvectra.com/v1/mode_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 10,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| op_mainnet RPC 與 Data API | op_mainnet | 10 | — | https://api.blockvectra.com/v1/op_mainnet/public | 支援 (newHeads, logs) | 已開放 | 39 | 不支援 | 支援 | 支援 | 最近 1,296,000 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | 未知 |
| polygon_mainnet RPC 與 Data API | polygon_mainnet | 137 | ✓ | https://api.blockvectra.com/v1/polygon_mainnet/public | 支援 (newHeads, logs) | 已開放 | 43 | 支援 · 確認數 1–200(預設 200) Webhook 推送指南 | 支援 | 支援 | 最近 126 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、資料新鮮度 | 未知 | 未知 |
| Robinhood Chain RPC 與 Data API | robinhood_mainnet | 4663 | ✓ | https://api.blockvectra.com/v1/robinhood_mainnet/public | 支援 (newHeads, logs) | 已開放 | 43 | 支援 · 確認數 1–1(預設 1) Webhook 推送指南 | 支援 | 支援 | 最近 900 個區塊的歷史狀態 | 1,000 個區塊 | 區塊、交易、地址交易、轉帳、代幣中繼資料、DEX 成交、代幣化股票、Trace、資料新鮮度 | 未知 | HoodFi 名称记录 Robinhood Chain 股票代幣乘數 代幣化股票 |
| robinhood_testnet RPC | robinhood_testnet | 46630 | ✓ | https://api.blockvectra.com/v1/robinhood_testnet/public | 支援 (newHeads, logs) | 暫未開放 | 43 | 支援 · 確認數 1–1(預設 1) Webhook 推送指南 | 支援 | 支援 | 最近 1,023 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 測試網水龍頭 Robinhood Chain 測試網入門 |
| rootstock_mainnet RPC | rootstock_mainnet | 30 | — | https://api.blockvectra.com/v1/rootstock_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 27 | 不支援 | 支援 | 支援 | 最近 6,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| soneium_mainnet RPC | soneium_mainnet | 1868 | — | https://api.blockvectra.com/v1/soneium_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 9,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| sonic_mainnet RPC | sonic_mainnet | 146 | ✓ | https://api.blockvectra.com/v1/sonic_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 43 | 不支援 | 支援 | 支援 | 最近 11,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| unichain_mainnet RPC | unichain_mainnet | 130 | — | https://api.blockvectra.com/v1/unichain_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 85,500 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| world_mainnet RPC | world_mainnet | 480 | — | https://api.blockvectra.com/v1/world_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 30,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| xlayer_mainnet RPC | xlayer_mainnet | 196 | ✓ | https://api.blockvectra.com/v1/xlayer_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 43 | 不支援 | 支援 | 支援 | 最近 250,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
| zora_mainnet RPC | zora_mainnet | 7777777 | — | https://api.blockvectra.com/v1/zora_mainnet/public | 支援 (newHeads, logs) | 暫未開放 | 39 | 不支援 | 支援 | 支援 | 最近 10,000 個區塊的歷史狀態 | 1,000 個區塊 | 不支援 | 未知 | 未知 |
拿到 key 之後
arb_mainnet
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/arb_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
arc_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketavax_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketbase_mainnet
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/base_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
berachain_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketboba_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketbsc_mainnet
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/bsc_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
celo_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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以太坊
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/eth_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
eth_sepolia
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/eth_sepolia/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
fraxtal_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketgnosis_mainnet
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/gnosis_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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'WebSocketHyperEVM
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/hyperevm_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
ink_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketkatana_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketlinea_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketmetall2_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketmode_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketop_mainnet
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/op_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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'WebSocketpolygon_mainnet
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/polygon_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
Robinhood Chain
eth_getLogs
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" logseth_getLogsData API
curl -fsS 'https://api.blockvectra.com/v1/data/robinhood_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"Data APIWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
robinhood_testnet
eth_getLogs
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" logseth_getLogsWebSocket
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建立 Webhook 訂閱 · 建立 Webhook 訂閱 · 用量與 CU · 儲值
rootstock_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketsoneium_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketsonic_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketunichain_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketworld_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketxlayer_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketzora_mainnet
eth_getLogs
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" logseth_getLogsWebSocket
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'WebSocketHyperEVM
HyperEVM 的區塊包含 HyperCore 系統交易(傳送方地址為 0x2222…2222 或 0x20…,gasPrice 為 0)。
以太坊
- Chain ID:
1 - 鏈名(URL 中的
{chain}):eth_mainnet,例如POST /v1/eth_mainnet/{api_key}、GET /v1/data/eth_mainnet/…。
JSON-RPC
- 可用方法:每條鏈可用的方法以
GET /v1/chains的methods.allow/deny為準(參見方法策略),不在範圍內的方法傳回-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 *)。僅列出公開可用的鏈,並傳回其狀態和索引頂部區塊:
curl -s "https://api.blockvectra.com/v1/status"回應範例:
{
"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):
curl -s "https://api.blockvectra.com/v1/data/chains" \
-H "x-api-key: $BLOCKVECTRA_API_KEY"回應範例:
{
"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:將 null 視為未知——而非完整歷史,也不是 0——此時歷史請求會傳回 503 unavailable。在執行時期請始終從此端點動態讀取,切勿寫死。coverage.traces_from_block 為第一個包含 trace 資料的區塊;在此之前的 trace 請求或處於區塊間隙中的請求會傳回 422 no_coverage(不計費)。
使用未知或未公開的鏈呼叫 /v1/data/{chain}/… 會傳回 HTTP 404 與 error.code not_found(不計費;鏈名必須完全為小寫 slug)。
最後更新: