BNB Smart Chain (BSC)

BNB Smart Chain (BSC) is a high-performance, EVM-compatible blockchain launched by Binance in September 2020. Designed to run alongside BNB Beacon Chain, BSC enables the creation and deployment of smart contracts and decentralized applications (DApps) with low transaction fees and fast block times. The network uses Proof of Staked Authority (PoSA) consensus, combining delegated Proof of Stake and Proof of Authority for high throughput and decentralization.

Key Features

  • EVM Compatibility: Full Ethereum Virtual Machine compatibility for seamless dApp migration
  • Fast Block Times: ~3 second block production with ~6 second finality
  • Low Transaction Fees: Average fees around $0.10, significantly lower than Ethereum
  • Proof of Staked Authority (PoSA): Hybrid consensus combining PoS and PoA
  • 55 Validators: Decentralized validator set with staking-based governance
  • BNB Token: Native token for gas fees, staking, and governance (18 decimals)
  • Rich Ecosystem: 1,500+ DApps including PancakeSwap, Venus, and BakerySwap
  • Cross-Chain Compatibility: Interoperability with BNB Beacon Chain
  • Developer-Friendly: Compatible with MetaMask, Truffle, Remix, and other Ethereum tools

TECHNICAL DISCLAIMER: AUTHORITATIVE JSON-RPC API SPECIFICATION.

GetBlock's RPC API reference documentation is provided exclusively for informational purposes and to optimize the developer experience. The canonical and normative specification for Ethereum Virtual Machine (EVM) JSON-RPC methods is solely maintained and published through the official Ethereum Foundation documentation portal at ethereum.org. This resource constitutes the sole authoritative reference implementation of the JSON-RPC 2.0 protocol interface across EVM-compatible execution clients.

Network Information

PropertyValue
Network NameBNB Smart Chain Mainnet
Chain ID56
Native CurrencyBNB
Decimals18
Block Time~3 seconds
ConsensusProof of Staked Authority (PoSA)
EVM CompatibleYes

Base URL

https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/
https://shared.us-east-1.getblock.io/<ACCESS-TOKEN>/
https://shared.ap-southeast-1.getblock.io/<ACCESS-TOKEN>/

Supported Networks

NetworkChain IDJSON-RPCWSSGraphQLMEV protected (WebSocket)MEV protected (JSON-RPC)Frankfurt, GermanyNew York, USASingapore, Singapore
Mainnet56✅✅✅✅✅✅✅✅
Testnet97✅✅✅❌❌✅❌❌

Quickstart

  1. Setup project

    Create and initialize a new project:

    bashmkdir bsc-api-quickstart
    cd bsc-api-quickstart
    npm init --yes
  2. Install Axios

    bashnpm install axios
  3. Create file

    Create a new file named index.js. This is where you will make your first call.

  4. Set ES module type

    Set the ES module "type": "module" in your package.json.

  5. Add code

    Add the following code to index.js:

    index.js

    javascriptconst axios = require('axios');
    
    const url = 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/';
    
    const payload = {
      jsonrpc: '2.0',
      method: 'eth_blockNumber',
      params: [],
      id: 'getblock.io'
    };
    
    axios.post(url, payload, {
      headers: { 'Content-Type': 'application/json' }
    })
    .then(response => {
      const blockNumber = parseInt(response.data.result, 16);
      console.log('Current Block Number:', blockNumber);
    })
    .catch(error => console.error(error));

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  6. Run the script

    bashnode index.js

    Expected output (example):

    json{
        "jsonrpc": "2.0",
        "id": "getblock.io",
        "result": "0x4a87a53"
    }
  1. Set up the project directory

    bashmkdir bsc-api-quickstart
    cd bsc-api-quickstart
  2. Create and activate a virtual environment

    bashpython -m venv venv
    source venv/bin/activate
    
    # On Windows, use venv\Scripts\activate
  3. Install requests

    bashpip install requests
  4. Create script

    Create a file called main.py with the following content:

    main.py

    pythonimport requests
    import json
    
    url = "https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/"
    
    payload = json.dumps({
        "jsonrpc": "2.0",
        "method": "eth_blockNumber",
        "params": [],
        "id": "getblock.io"
    })
    
    headers = {
        'Content-Type': 'application/json'
    }
    
    response = requests.post(url, headers=headers, data=payload)
    print(response.text)

    Replace <ACCESS-TOKEN> with your actual access token from GetBlock.

  5. Run the script

    bashpython main.py

Available API Methods

Transaction Methods

MethodDescription
eth_sendRawTransactionSubmits a signed transaction
eth_sendTransactionSends a transaction (requires unlocked account)
eth_getTransactionByHashReturns transaction by hash
eth_getTransactionByBlockHashAndIndexReturns transaction by block hash and index
eth_getTransactionByBlockNumberAndIndexReturns transaction by block number and index
eth_getTransactionCountReturns the transaction count (nonce)
eth_getTransactionReceiptReturns the receipt of a transaction

Block Methods

MethodDescription
eth_blockNumberReturns the current block number
eth_getBlockTransactionCountByHashReturns transaction count by block hash
eth_getBlockTransactionCountByNumberReturns transaction count by block number
eth_getUncleByBlockHashAndIndexReturns uncle by block hash and index
eth_getUncleByBlockNumberAndIndexReturns uncle by block number and index
eth_getUncleCountByBlockHashReturns uncle count by block hash
eth_getUncleCountByBlockNumberReturns uncle count by block number

Account/State Methods

MethodDescription
eth_accountsReturns addresses owned by client
eth_getBalanceReturns the BNB balance of an address
eth_getStorageAtReturns the value at a storage position
eth_getCodeReturns the code at an address
eth_getProofReturns account and storage proof
eth_callExecutes a call without creating a transaction
eth_signSigns data with account

Gas and Fee Methods

MethodDescription
eth_gasPriceReturns the current gas price
eth_estimateGasEstimates gas for a transaction
eth_feeHistoryReturns historical gas information
eth_maxPriorityFeePerGasReturns current max priority fee

Filter Methods

MethodDescription
eth_getLogsReturns logs matching filter criteria
eth_newFilterCreates a log filter
eth_newBlockFilterCreates a block filter
eth_newPendingTransactionFilterCreates a pending transaction filter
eth_getFilterChangesReturns filter changes since last poll
eth_getFilterLogsReturns all logs matching filter
eth_uninstallFilterRemoves a filter

Subscription Methods (WebSocket)

MethodDescription
eth_unsubscribeCancels an existing subscription

Network/Chain Methods

MethodDescription
eth_chainIdReturns the chain ID (56)
eth_syncingReturns sync status
eth_coinbaseReturns the coinbase address
eth_miningReturns mining status
net_versionReturns the network ID
net_listeningReturns listening status
net_peerCountReturns number of connected peers
web3_clientVersionReturns client version
web3_sha3Returns Keccak-256 hash of data

Transaction Pool Methods

MethodDescription
txpool_statusReturns transaction pool status

Debug Methods

MethodDescription
debug_traceTransactionTraces a specific transaction
debug_traceBlockByHashTraces block by hash
debug_traceBlockByNumberTraces block by number
debug_traceCallTraces a call
debug_traceBlockTraces a block
debug_accountRangeReturns accounts in range
debug_storageRangeAtReturns storage range
debug_standardTraceBadBlockToFileTraces bad block to file
debug_standardTraceBlockToFileTraces block to file

Support

For technical support and questions:

See Also