跳到正文

Ethereum 免费 RPC 节点与 Chain ID

Ethereum 的 Chain ID 为 1;免 key 公共端点是 https://api.blockvectra.com/v1/eth_mainnet/public(每 IP 每秒 3 次请求),eth_getLogs 需要 API key。

开发者与 AI Agent 可通过 HTTP API 连接钱包、构建应用。

RPC 端点与网络参数

主网

https://api.blockvectra.com/v1/eth_mainnet/public

免 API key 试调用 RPC

curl -sS 'https://api.blockvectra.com/v1/eth_mainnet/public' \
  -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'

添加钱包网络

将这些参数复制到钱包的自定义网络表单。

{
  "networkName": "Ethereum",
  "rpcUrl": "https://api.blockvectra.com/v1/eth_mainnet/public",
  "chainId": 1,
  "currencySymbol": "ETH",
  "blockExplorerUrl": "https://etherscan.io"
}
etherscan.io

到账 Webhook 推送

通过 HTTPS 端点接收地址活动。按指南创建订阅、验证签名并对推送去重。

Ethereum

到账 Webhook 推送

接入教程

端点

无需 API key,仅开放钱包常用方法,按 IP 限速。 当前方法与限额以 GET /v1/chains 为准。

免费公共 RPC 端点
https://api.blockvectra.com/v1/eth_mainnet/public
curl -X POST 'https://api.blockvectra.com/v1/eth_mainnet/public' -H 'Content-Type: application/json' -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'
限额:每 IP 每秒 3 次、突发 20、批量 10
发交易限额:每 IP 每秒 1 次、突发 3
公共方法
  • eth_chainId
  • net_version
  • eth_blockNumber
  • eth_getBalance
  • eth_getTransactionCount
  • eth_getCode
  • eth_getStorageAt
  • eth_call
  • eth_estimateGas
  • eth_gasPrice
  • eth_maxPriorityFeePerGas
  • eth_feeHistory
  • eth_getBlockByNumber
  • eth_getBlockByHash
  • eth_getTransactionByHash
  • eth_getTransactionReceipt
  • eth_syncing
  • web3_clientVersion
  • eth_sendRawTransaction
全部免费公共 RPC 端点
公共历史窗口:最近 1,000 个区块。免费注册后可用免费 API 额度调用本链开放的方法。
JSON-RPC(路径 Key)
https://api.blockvectra.com/v1/eth_mainnet/{api_key}
JSON-RPC(请求头:x-api-key)
https://api.blockvectra.com/v1/eth_mainnet
x-api-key: {api_key}
数据 API
https://api.blockvectra.com/v1/data/eth_mainnet
x-api-key: {api_key}

WebSocket

WebSocket(路径 Key)
wss://api.blockvectra.com/v1/eth_mainnet/{api_key}
WebSocket(请求头:x-api-key 或 Authorization)
wss://api.blockvectra.com/v1/eth_mainnet
x-api-key: {api_key}
Authorization: Bearer {api_key}
支持的订阅类型
  • newHeads
  • logs (过滤条件必须带 address 或 topic0)

网络参数

Chain ID1
免费公共 RPC 端点https://api.blockvectra.com/v1/eth_mainnet/public
带 key 方法数38
数据 API支持
WebSocket 支持支持
Webhook 推送支持 · 确认数 1–82(默认 6)
Webhook 推送指南
发送交易支持
发送交易(免 key 公开端点)支持
历史状态窗口最近 250,000 个区块的历史状态
eth_getLogs 单次最大区块跨度1,000 个区块
Data API 数据集区块、交易、地址交易、转账、代币元数据、数据新鲜度
支持的订阅类型newHeads、logs
相关测试网未知
相关教程未知

快速示例

curl -X POST https://api.blockvectra.com/v1/eth_mainnet \
  -H "Content-Type: application/json" \
  -H "x-api-key: {api_key}" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

限制

历史状态窗口最近 250,000 个区块的历史状态
eth_getLogs 单次最大区块跨度1,000 个区块
方法策略
允许:debug_traceBlockByHash, debug_traceBlockByNumber, debug_traceCall, debug_traceTransaction, eth_blobBaseFee, eth_blockNumber, eth_call, eth_chainId, eth_createAccessList, eth_estimateGas, eth_feeHistory, eth_gasPrice, eth_getBalance, eth_getBlockByHash, eth_getBlockByNumber, eth_getBlockReceipts, eth_getBlockTransactionCountByHash, eth_getBlockTransactionCountByNumber, eth_getCode, eth_getLogs, eth_getProof, eth_getStorageAt, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, eth_getTransactionByHash, eth_getTransactionCount, eth_getTransactionReceipt, eth_maxPriorityFeePerGas, eth_sendRawTransaction, eth_syncing, net_version, trace_block, trace_call, trace_get, trace_replayTransaction, trace_transaction, web3_clientVersion, web3_sha3

数据 API

查询该链数据新鲜度

curl -s "https://api.blockvectra.com/v1/data/eth_mainnet/status/freshness" -H "x-api-key: {api_key}"

查看数据集说明文档 →

查看 Data API 文档 →

选择任务

按链上任务选择解决方案

拿到 key 之后

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" logs
eth_getLogs

数据 API

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

WebSocket

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

常见问题

Ethereum 的 RPC 端点与 Chain ID 是什么?

Ethereum 的 Chain ID 为 1;免 key 公共端点是 https://api.blockvectra.com/v1/eth_mainnet/public(每 IP 每秒 3 次请求),eth_getLogs 需要 API key。

可以免 API key 试用 Ethereum RPC 吗?

可以。无需 key 即可在上方公共端点调用 eth_chainId。当前方法与每 IP 限额见 GET /v1/chains。

Ethereum RPC 是否支持 WebSocket?

Ethereum RPC 支持 WebSocket 连接,支持的订阅类型包括:newHeads, logs。

Ethereum RPC 是否支持 trace 或 debug 方法?

Ethereum RPC 支持 trace 与 debug 方法,包括:debug_traceBlockByHash, debug_traceBlockByNumber, debug_traceCall, debug_traceTransaction, trace_block, trace_call, trace_get, trace_replayTransaction, trace_transaction。

可以通过 Ethereum RPC 广播交易吗?

Ethereum: 支持.

Ethereum 可以查询多长的历史状态?

Ethereum: 最近 250,000 个区块的历史状态.

Ethereum 的 eth_getLogs 区块范围上限是多少?

Ethereum: 1,000 个区块,eth_getLogs 需要 API key.

Ethereum 支持哪些 Data API 数据集?

Ethereum: 区块、交易、地址交易、转账、代币元数据、数据新鲜度.

计价说明

注册即享 30,000,000 CU 免费额度(每 30 天自动补足,余额与限流跨链合计,无需信用卡);按方法公开定价,每百万次调用:eth_blockNumber $0.10、eth_call $1.50、eth_getLogs $3.00。

查看定价计划 →