BNB Smart Chain RPC endpoint
BNB Smart Chain mainnet JSON-RPC over HTTPS, with a free daily tier. Chain ID is 56 (0x38).
Chain ID
56
0x38
Network
mainnet
Free tier
10,000
requests/day per account · 10 req/s
Endpoints
HTTPPOST JSON-RPC · key in the URL path
https://ethras.org/v1/bsc/<YOUR_API_KEY>
WebSocketnot available on this network
WebSocket is not available on BNB Smart Chain yet. Use HTTPS polling.
First call: eth_chainId
curl
curl -s https://ethras.org/v1/bsc/<YOUR_API_KEY> \-H 'Content-Type: application/json' \-d '{"jsonrpc":"2.0","id":1,"method":"eth_chainId","params":[]}'
ethers v6
// ethers v6import { JsonRpcProvider } from 'ethers'const provider = new JsonRpcProvider('https://ethras.org/v1/bsc/<YOUR_API_KEY>')console.log((await provider.getNetwork()).chainId) // 56n
viem
// viemimport { createPublicClient, http } from 'viem'const client = createPublicClient({ transport: http('https://ethras.org/v1/bsc/<YOUR_API_KEY>') })console.log(await client.getChainId()) // 56
Response
{"jsonrpc": "2.0","id": 1,"result": "0x38"}
Available methods
- eth_blockNumberReturns the latest execution block number reported by the serving upstream as a hex quantity. A head height alone does not establish synchronization or finality.
- eth_chainIdReturns the chain ID for BNB Smart Chain (always 0x38).
- eth_gasPriceReturns the current gas price in wei (legacy). Prefer eth_feeHistory / maxFeePerGas on EIP-1559 chains.
- eth_maxPriorityFeePerGasReturns the current suggested max priority fee per gas (EIP-1559 tip) in wei.
- eth_feeHistoryReturns historical base fees and optional priority-fee percentiles for EIP-1559 gas estimation.
- eth_getBalanceReturns the selected account's native-currency balance in its smallest unit. The six published networks use 18 decimals: divide by 10^18 for ETH, BNB or POL as appropriate.
- eth_getCodeReturns the code stored at an address in the selected state. Empty 0x means no stored code, not proof of a particular account type. On networks using EIP-6780, SELFDESTRUCT normally preserves existing code.
- eth_getStorageAtReads a storage slot at an address in the selected state. Use the contract's storage layout to compute the slot; this is not an ABI-level getter.
- eth_getTransactionCountReturns the account nonce at the selected state. Pending reflects the serving upstream's pending state, not a complete network-wide mempool. Coordinate nonces locally for concurrent sends.
- eth_getProofReturns an EIP-1186 account and storage proof where the selected upstream retains the required state. Verify against the stateRoot of an independently trusted block; receiving a proof does not establish trust in that root.
- eth_callSimulates a message call at a selected state without publishing a transaction or charging an on-chain fee. Execution can still consume node resources or revert; simulated state changes are discarded.
- eth_estimateGasEstimates the gas limit for a transaction simulation. It is not a guarantee of later success or a quote for the complete transaction fee; state, gas caps and network-specific charges can change.
- eth_createAccessListSimulates a transaction to produce an EIP-2930 access list. Compare estimates with and without the list: its upfront cost can outweigh access savings.
- eth_sendRawTransactionSubmits a locally signed serialized transaction. Use the selected network's chain ID and supported transaction type. The in-docs sender does not broadcast transactions.
- eth_getBlockByNumberReturns block details for a height or tag. Set fullTransactions to true for full tx objects; false returns hashes only (lighter). Returns null when the serving upstream cannot find the block. Fields vary with the network and fork. Pending is a provisional client view; a stable hash and some header fields may be unavailable.
- eth_getBlockByHashReturns block details for a 32-byte block hash. fullTransactions controls whether txs are objects or hashes. Returns null when the serving upstream cannot find the block. Fields vary with the network and fork.
- eth_getBlockTransactionCountByNumberReturns the number of transactions in a block.
- eth_getBlockTransactionCountByHashReturns the number of transactions in the block with the given hash.
- eth_getUncleCountByBlockNumberReturns the uncle count for a block selected by number or tag. On post-merge Ethereum and most non-PoW chains this is typically 0x0.
- eth_getUncleCountByBlockHashReturns the uncle count for a block selected by hash. On post-merge Ethereum and most non-PoW chains this is typically 0x0.
- eth_getUncleByBlockNumberAndIndexReturns an ommer (uncle) header from a block selected by number or tag and a zero-based ommer index, or null if unavailable. Historical Ethereum PoW blocks may have ommers; post-Merge Ethereum blocks do not. Other networks may return compatibility values or reject the method.
- eth_getUncleByBlockHashAndIndexReturns an ommer (uncle) header from a block selected by hash and a zero-based ommer index, or null if unavailable. Historical Ethereum PoW blocks may have ommers; post-Merge Ethereum blocks do not. Other networks may return compatibility values or reject the method.
- eth_getTransactionByHashReturns a transaction object by hash, or null if the node does not know it yet.
- eth_getTransactionByBlockNumberAndIndexReturns a transaction by block number and index position.
- eth_getTransactionByBlockHashAndIndexReturns the transaction at the given index inside the block with the given hash.
- eth_getTransactionReceiptReturns the receipt of a mined transaction (status, logs, gasUsed). null while pending or if the hash is unknown.
- eth_getLogsReturns event logs matching a filter. Keep block ranges small (often 1–a few thousand blocks) to avoid timeouts and huge payloads.
- eth_getBlockReceiptsReturns all transaction receipts for a block.
- net_versionReturns the network ID for BNB Smart Chain as decimal string 56; use eth_chainId for the transaction-signing chain ID.
- net_listeningReturns the serving upstream's network-listening flag. This is not a complete health, synchronization or finality check.
- net_peerCountReturns the number of peers connected to the serving node.
- web3_clientVersionReturns the client software version string reported by the upstream node.
- eth_syncingReturns false when the node is in sync, or an object with sync progress fields when catching up.
- eth_accountsLists accounts managed by the serving node. This service does not manage signing accounts; sign locally and broadcast with eth_sendRawTransaction.
Frequently asked questions
What is the BNB Smart Chain RPC endpoint format?
Send JSON-RPC POST requests to https://ethras.org/v1/bsc/<YOUR_API_KEY>. The API key is part of the URL path rather than a header, so keep it in a backend or an environment variable and never in client-side code.
How many requests can I make for free?
The Free plan allows 10,000 requests per day and 10 requests per second per account — all keys and all chains share the same pool. It resets at 00:00 UTC; when the pool is used up, keys pause until the reset.
Does BNB Smart Chain support WebSocket?
WebSocket is not available on BNB Smart Chain yet. Use HTTPS polling; the WebSocket topic covers the chains where subscriptions are enabled.
What do common errors mean?
HTTP 429 means the account exceeded its requests-per-second limit. When the daily pool is used up, keys stop working until 00:00 UTC and requests fail with the gateway's "api-key not found" error. The error reference lists each code with a real response sample.