Lewati ke konten

Endpoint RPC gratis dan Chain ID Ethereum

Ethereum menggunakan Chain ID 1; endpoint RPC publik tanpa kuncinya adalah https://api.blockvectra.com/v1/eth_mainnet/public (3 permintaan per detik per IP), sedangkan eth_getLogs memerlukan kunci API.

Pengembang dan AI Agent dapat menghubungkan dompet dan membangun aplikasi dengan API HTTP.

Endpoint RPC dan parameter jaringan

Mainnet

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

Coba RPC tanpa kunci API

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":[]}'

Tambahkan jaringan ke dompet

Salin nilai ini ke formulir jaringan khusus di dompet Anda.

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

Webhook transfer masuk

Terima aktivitas alamat di endpoint HTTPS Anda. Ikuti panduan untuk membuat langganan, memverifikasi tanda tangan dan menghapus pengiriman duplikat.

Ethereum

Webhook transfer masuk

Tutorial integrasi

Endpoint

Tanpa API key. Hanya metode dompet, dengan batas laju per IP. Lihat metode dan batas terbaru di GET /v1/chains.

Endpoint RPC publik gratis
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":[]}'
Batas laju: 3 req/detik per IP, burst 20, batch maks 10
Batas pengiriman transaksi: 1 req/detik per IP, burst 3
Metode publik
  • 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
Semua endpoint RPC publik gratis
Riwayat publik: 1,000 blok terakhir. Daftar gratis untuk memakai kredit API gratis pada metode yang didukung rantai ini.
JSON-RPC (Kunci di jalur)
https://api.blockvectra.com/v1/eth_mainnet/{api_key}
JSON-RPC (header: x-api-key)
https://api.blockvectra.com/v1/eth_mainnet
x-api-key: {api_key}
Data API
https://api.blockvectra.com/v1/data/eth_mainnet
x-api-key: {api_key}

WebSocket

WebSocket (Kunci di jalur)
wss://api.blockvectra.com/v1/eth_mainnet/{api_key}
WebSocket (header: x-api-key atau Authorization)
wss://api.blockvectra.com/v1/eth_mainnet
x-api-key: {api_key}
Authorization: Bearer {api_key}
Tipe langganan yang didukung
  • newHeads
  • logs (filter harus menyertakan address atau topic0)

Parameter Jaringan

Chain ID1
Endpoint RPC publik gratishttps://api.blockvectra.com/v1/eth_mainnet/public
Jumlah metode dengan kunci API38
Data APIDidukung
Dukungan WebSocketDidukung
Push WebhookDidukung · Konfirmasi 1–82 (default 6)
Panduan push Webhook
Kirim TransaksiDidukung
Kirim Transaksi (Endpoint Publik Tanpa Key)Didukung
Jendela riwayat stateState historis untuk 250,000 blok terbaru
Rentang blok maksimum eth_getLogs1,000 blok
Dataset Data APIBlok, Transaksi, Transaksi alamat, Transfer, Metadata token, Kesegaran data
Tipe langganan yang didukungnewHeads, logs
Testnet terkaitTidak dikenal
Panduan terkaitTidak dikenal

Contoh cepat

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":[]}'

Batas

Jendela riwayat stateState historis untuk 250,000 blok terbaru
Rentang blok maksimum eth_getLogs1,000 blok
Kebijakan metode
Diizinkan: 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

Data API

Periksa kesegaran data rantai

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

Lihat panduan set data →

Lihat dokumentasi Data API →

Pilih tugas

Solusi untuk tugas onchain Anda

Langkah berikutnya dengan kunci API

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

Data API

curl -fsS 'https://api.blockvectra.com/v1/data/eth_mainnet/status/freshness' -H "x-api-key: $BLOCKVECTRA_API_KEY"
Data 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

Pertanyaan yang Sering Diajukan

Apa endpoint RPC dan Chain ID Ethereum?

Ethereum menggunakan Chain ID 1; endpoint RPC publik tanpa kuncinya adalah https://api.blockvectra.com/v1/eth_mainnet/public (3 permintaan per detik per IP), sedangkan eth_getLogs memerlukan kunci API.

Bisakah saya mencoba RPC Ethereum tanpa kunci API?

Ya. Panggil eth_chainId di endpoint publik di atas tanpa kunci. GET /v1/chains mencantumkan metode dan batas per IP saat ini.

Apakah Ethereum RPC mendukung WebSocket?

Ethereum RPC mendukung koneksi WebSocket. Tipe langganan yang didukung: newHeads, logs.

Apakah Ethereum RPC mendukung metode trace atau debug?

Ethereum RPC mendukung metode trace dan debug, termasuk: debug_traceBlockByHash, debug_traceBlockByNumber, debug_traceCall, debug_traceTransaction, trace_block, trace_call, trace_get, trace_replayTransaction, trace_transaction.

Bisakah saya menyiarkan transaksi melalui RPC Ethereum?

Ethereum: Didukung.

Seberapa jauh status historis dapat saya kueri di Ethereum?

Ethereum: State historis untuk 250,000 blok terbaru.

Berapa batas rentang blok eth_getLogs di Ethereum?

Ethereum: 1,000 blok, sedangkan eth_getLogs memerlukan kunci API.

Dataset Data API apa yang tersedia di Ethereum?

Ethereum: Blok, Transaksi, Transaksi alamat, Transfer, Metadata token, Kesegaran data.

Harga

Dapatkan 30,000,000 CU saat mendaftar, diisi ulang setiap 30 hari (saldo dan batas laju digabungkan di seluruh rantai; tidak memerlukan kartu kredit); harga per satu juta panggilan: eth_blockNumber $0.10, eth_call $1.50, eth_getLogs $3.00.

Lihat paket harga →