Skip to Content
Supported ChainBNB Chain

BNB Chain API

Access BNB Chain via the Spectrum unified API. BNB Chain (formerly Binance Smart Chain) is a high throughput EVM network widely used for DeFi and token trading.

Properties

PropertyValue
Slugbsc
TypeEVM
Native TokenBNB
Chain ID56

Available Methods

MethodDescription
getBlockHeightLatest BNB Chain block number
getBalanceBNB balance for a wallet
getTokenBalanceERC-20 token balance
getTokenMetadataERC-20 token info
getTokenAllowanceToken spending allowance
getPortfolioFull portfolio with USD values
getNftCollectionNFT holdings for a wallet
getBlockTransactionsTransactions in a block
estimateGasGas estimation for a transaction
traceTransactionInternal call trace
getHistoricalBalanceBalance at a historical block
getCodeContract bytecode check
simulateCallSimulate a contract call
rpcProxyRaw JSON-RPC passthrough
getChainHealthBNB Chain RPC health check

Quick Start

Get the latest BNB Chain block height:

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
{
  "jsonrpc": "2.0",
  "method": "getBlockHeight",
  "params": {
    "chain": "bsc"
  },
  "id": 1
}

Get Balance

Retrieve the BNB balance for a wallet address:

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
{
  "jsonrpc": "2.0",
  "method": "getBalance",
  "params": {
    "chain": "bsc",
    "address": "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
  },
  "id": 1
}

Get Gas

Compare current gas prices across chains:

curl -X POST https://your-endpoint.simplystaking.xyz/v1 \
  -H "Content-Type: application/json" \
  -H "X-API-Key: YOUR_KEY" \
{
  "jsonrpc": "2.0",
  "method": "compareGas",
  "params": {},
  "id": 1
}

SDK

import { Spectrum } from '@spectrum-nodes/sdk'; const spectrum = new Spectrum({ api: 'https://your-endpoint.simplystaking.xyz/YOUR_API_KEY/' }); // Get latest block height const block = await spectrum.core.getBlockHeight('bsc'); console.log(block.height); // Get BNB balance const balance = await spectrum.tokens.getBalance('bsc', '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'); console.log(balance.balance);

DeFi

BNB Chain is supported by the following DeFi protocols on Spectrum:

  • Beefy — yield optimizer vaults
  • PancakeSwap — decentralized exchange and yield farming
// Get Beefy vault yields on BNB Chain const vaults = await spectrum.yields.getLending({ chain: 'bsc', protocol: 'beefy' }); // Get PancakeSwap yields on BNB Chain const pancake = await spectrum.yields.getLending({ chain: 'bsc', protocol: 'pancakeswap' });