BNB Smart Chain RPC
JSON-RPC 2.0 for BNB Smart Chain over HTTPS and WebSocket. Same token, credits and plan limits as every other chain.
Contents
Endpoints
https://rpc.blockmetric.io/bsc/YOUR_TOKENAvailable when your plan opens.wss://rpc.blockmetric.io/bsc/YOUR_TOKENAvailable when your plan opens.https://rpc.blockmetric.io/bscwith Authorization: Bearer bmr_… Available when your plan opens.https://rpc.blockmetric.io/bsc/healthPublic, no token, once this chain opens. Available when your plan opens.- Chain id
- 56 (0x38)
- Native token
- BNB
- Network
- Mainnet
- eth_getLogs span
- 10,000 blocks
- WebSocket
- Yes, eth_subscribe
First request
Set BLOCKMETRIC_RPC_TOKEN to your token, then:
curl -s https://rpc.blockmetric.io/bsc/$BLOCKMETRIC_RPC_TOKEN \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'Batch and header authentication
curl -s https://rpc.blockmetric.io/bsc/$BLOCKMETRIC_RPC_TOKEN \
-H "Content-Type: application/json" \
-d '[
{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]},
{"jsonrpc":"2.0","id":2,"method":"eth_blockNumber","params":[]},
{"jsonrpc":"2.0","id":3,"method":"eth_getBalance","params":["0x0000000000000000000000000000000000000000","latest"]}
]'Wallets and developer tools
export ETH_RPC_URL="https://rpc.blockmetric.io/bsc/$BLOCKMETRIC_RPC_TOKEN"
cast chain-id
cast block-numberSubscriptions
New heads and logs over WebSocket. Reconnects and gaps: WebSockets guide.
import { createPublicClient, webSocket } from 'viem'
import { bsc } from 'viem/chains'
const url = `wss://rpc.blockmetric.io/bsc/${process.env.BLOCKMETRIC_RPC_TOKEN}`
const client = createPublicClient({ chain: bsc, transport: webSocket(url, { reconnect: true }) })
// One eth_subscribe("newHeads") under the hood; viem resubscribes after a reconnect.
const stop = client.watchBlocks({ onBlock: (block) => console.log(block.number, block.hash) })Methods and weights
1 credit = 1 request, the same on every chain. A method that is not listed answers method_not_found or method_not_allowed (errors).
Answered by the gateway Weight 0
eth_chainId and net_version come straight from the gateway: no node call, no credits.
eth_chainIdnet_version
Standard reads Weight 1
web3_clientVersionweb3_sha3net_listeningnet_peerCounteth_blockNumbereth_syncingeth_protocolVersioneth_gasPriceeth_maxPriorityFeePerGaseth_feeHistoryeth_blobBaseFeeeth_getBalanceeth_getCodeeth_getStorageAteth_getTransactionCounteth_getProofeth_calleth_estimateGaseth_createAccessListeth_simulateV1eth_getBlockByHasheth_getBlockByNumbereth_getBlockTransactionCountByHasheth_getBlockTransactionCountByNumbereth_getUncleByBlockHashAndIndexeth_getUncleByBlockNumberAndIndexeth_getUncleCountByBlockHasheth_getUncleCountByBlockNumbereth_getTransactionByHasheth_getTransactionByBlockHashAndIndexeth_getTransactionByBlockNumberAndIndexeth_getTransactionReceipt
Heavy reads Weight 2
Full-transaction blocks (eth_getBlockByNumber or eth_getBlockByHash with true) also count as heavy.
eth_getLogseth_getBlockReceiptstrace_transactiontrace_get
Trace and debug Weight 5
Paid plans only (Starter and up). On Free these calls answer plan_required.
trace_blocktrace_calltrace_callManytrace_filtertrace_rawTransactiontrace_replayBlockTransactionstrace_replayTransactiondebug_traceTransactiondebug_traceCalldebug_traceBlockByNumberdebug_traceBlockByHashdebug_getRawBlockdebug_getRawHeaderdebug_getRawReceiptsdebug_getRawTransaction
Transaction submission Weight 1
Not enabled yet: Blockmetric RPC is read-only during the beta (tx_submit_disabled).
eth_sendRawTransactioneth_sendRawTransactionConditionaleth_sendRawTransactionSync
Subscriptions (WebSocket only) Weight 1 per call, notifications 1 per started 4 KB
newHeads and logs. newPendingTransactions (mempool) is not offered.
eth_subscribeeth_unsubscribe
Independent infrastructure, not affiliated with BNB Smart Chain. Answers come from the chain’s nodes as they are, without guarantee.
Code snippets in these docs are licensed under MIT-0: copy them into your own code without attribution. Use of Blockmetric RPC is governed by the terms. Independent infrastructure, not affiliated with the chains or their foundations.