Logo
RPC Assistant

What is a Binance Smart Chain RPC and how do I use it?

Summary

A Binance Smart Chain (BSC) RPC endpoint is the gateway for dApps and wallets to interact with the BSC network. This guide explains what BSC RPCs are, how to connect, and how to choose a reliable provider for your project.

Binance Smart Chain RPC decision checklist

Before integrating a BSC RPC endpoint, consider these factors:

CriterionWhat to checkWhy it matters
Rate limitsRequests per second (RPS) or daily capPublic endpoints often throttle; high-traffic dApps need higher limits
ReliabilityUptime history and redundancyDowntime breaks your dApp; choose providers with multiple nodes
Data freshnessBlock propagation delayStale data can cause transaction failures or incorrect state
Archive dataSupport for historical state queriesRequired for analytics, explorers, and certain DeFi operations
WebSocket supportReal-time event streamingEssential for order books, notifications, and live updates
SecurityHTTPS/WSS encryption, API key managementProtects against man-in-the-middle attacks and unauthorized access
Pricing modelPay-as-you-go vs. subscriptionMatch your traffic patterns to avoid overpaying or hitting limits
Geographic latencyServer locationsLower latency improves user experience; consider multi-region providers

What is a Binance Smart Chain RPC?

An RPC (Remote Procedure Call) endpoint is the URL that your wallet, dApp, or backend service uses to communicate with the Binance Smart Chain (BSC) network. BSC is an EVM-compatible blockchain, meaning it supports the same JSON-RPC API as Ethereum. This allows developers to use familiar tools like ethers.js, web3.js, and Hardhat to interact with BSC.

Every interaction with BSC—sending transactions, querying balances, calling smart contracts—goes through an RPC endpoint. The choice of RPC provider directly affects the speed, reliability, and cost of your application.

BSC network details

  • Chain ID: 56 (mainnet), 97 (testnet)
  • Currency: BNB
  • Block time: ~3 seconds
  • Consensus: Proof of Staked Authority (PoSA)
  • EVM compatibility: Full

How to connect to BSC using an RPC endpoint

Adding BSC to MetaMask

  1. Open MetaMask and click the network dropdown.
  2. Click "Add Network" and fill in:
    • Network Name: BNB Smart Chain
    • RPC URL: (your chosen endpoint)
    • Chain ID: 56
    • Symbol: BNB
    • Block Explorer URL: https://bscscan.com
  3. Click "Save".

Connecting via ethers.js

const { ethers } = require("ethers");

const provider = new ethers.JsonRpcProvider("https://bsc-dataseed.bnbchain.org");

async function getBlockNumber() {
  const blockNumber = await provider.getBlockNumber();
  console.log("Current block:", blockNumber);
}

getBlockNumber();

Using curl to call the RPC

curl -X POST https://bsc-dataseed.bnbchain.org \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

Public vs. private RPC endpoints

Public endpoints

Public RPC endpoints are free and open to everyone. BSC provides official endpoints like:

  • https://bsc-dataseed.bnbchain.org
  • https://bsc-dataseed1.bnbchain.org
  • https://bsc-dataseed2.bnbchain.org

These are suitable for development, testing, and low-traffic applications. However, they have rate limits (e.g., 10,000 requests per 5 minutes) and may throttle under heavy load.

Private endpoints

Private endpoints require an API key and offer higher rate limits, dedicated resources, and better reliability. They are recommended for production dApps, especially those with high transaction volumes or real-time requirements.

OnFinality provides both shared and dedicated RPC endpoints for BSC, with flexible pricing to match your traffic needs. You can get started with a free tier and scale up as your project grows. See RPC pricing for details.

How to choose a BSC RPC provider

When evaluating providers, consider:

  • Latency: Lower latency means faster transaction confirmation and better user experience.
  • Uptime: Look for providers with redundant infrastructure and transparent status pages.
  • Rate limits: Ensure the plan supports your peak request volume.
  • Archive data: If you need historical state (e.g., for analytics), choose a provider that offers archive nodes.
  • WebSocket support: Required for real-time applications like DEX aggregators or NFT marketplaces.
  • Geographic distribution: Providers with multiple regions reduce latency for global users.

OnFinality offers BSC endpoints with low latency, high availability, and support for both HTTP and WebSocket. Check our supported networks for the latest list.

Common pitfalls and troubleshooting

Rate limiting

If you receive errors like 429 Too Many Requests, your application is exceeding the provider's rate limit. Solutions:

  • Upgrade to a paid plan with higher limits.
  • Implement request caching or batching.
  • Use multiple endpoints with fallback logic.

Stale data

Some public endpoints may lag behind the latest block. This can cause transaction failures or incorrect state reads. Mitigate by:

  • Using a provider with fast block propagation.
  • Checking the block number from multiple sources.
  • Subscribing to newHeads via WebSocket for real-time updates.

Connection timeouts

Network issues or overloaded servers can cause timeouts. Best practices:

  • Set reasonable timeout values in your client.
  • Implement retry logic with exponential backoff.
  • Use a provider with load balancing and failover.

BSC testnet RPC

For development and testing, use the BSC Testnet (Chain ID 97). Official testnet endpoints include:

  • https://data-seed-prebsc-1-s1.bnbchain.org:8545
  • https://data-seed-prebsc-2-s1.bnbchain.org:8545

You can get test BNB from the BSC Faucet.

OnFinality also supports BSC Testnet. See our BNB Testnet page for details.

Key Takeaways

  • BSC RPC endpoints are the bridge between your application and the blockchain.
  • Public endpoints are free but limited; private endpoints offer better performance for production.
  • Choose a provider based on latency, uptime, rate limits, and archive data support.
  • Always test with the testnet before deploying to mainnet.
  • Implement fallback and retry logic to handle failures gracefully.

Frequently Asked Questions

What is the BSC RPC URL?

The official BSC mainnet RPC URL is https://bsc-dataseed.bnbchain.org. Other providers offer alternative endpoints with different features.

Is BSC RPC free?

Yes, public endpoints are free but have rate limits. For higher limits, you need a paid plan from a provider like OnFinality.

How do I get a BSC RPC endpoint?

You can use a public endpoint directly or sign up with an RPC provider to get a private endpoint with an API key.

What is the difference between BSC and BNB Chain?

BNB Chain is the broader ecosystem that includes BNB Beacon Chain (staking/governance) and BNB Smart Chain (EVM-compatible). BSC is often used interchangeably with BNB Smart Chain.

Can I use Ethereum tools with BSC?

Yes, because BSC is EVM-compatible, you can use ethers.js, web3.js, Hardhat, and other Ethereum development tools.

What is the BSC testnet RPC?

The BSC testnet RPC URL is https://data-seed-prebsc-1-s1.bnbchain.org:8545. Use it for development and testing.

How do I find the best BSC RPC provider?

Evaluate providers based on latency, uptime, rate limits, archive support, and pricing. OnFinality offers competitive options for both shared and dedicated nodes. Check our RPC pricing and supported networks for more information.

RPC Knowledge Base

Related RPC details

Never Worry about Infrastructure Again

OnFinality takes away the heavy lifting of DevOps so you can build smarter and faster.

Get Started