BNB Smart Chain WebSocket RPC
Stream BNB Smart Chain data in real time over a WebSocket connection — new blocks, pending transactions, and contract events — instead of polling. Every SwiftNodes plan includes a BNB Smart Chain WebSocket endpoint alongside HTTP, with flat-rate pricing and no KYC.
Endpoint
wss://rpc.swiftnodes.io/ws/bsc?key=YOUR_API_KEYThe HTTP endpoint for BNB Smart Chain is https://rpc.swiftnodes.io/rpc/bsc?key=YOUR_API_KEY. One API key works for both, and across all 75+ supported chains.
Subscribe to BNB Smart Chain in real time
import { createPublicClient, webSocket } from "viem";
const client = createPublicClient({
transport: webSocket("wss://rpc.swiftnodes.io/ws/bsc?key=YOUR_API_KEY"),
});
// Stream new BNB Smart Chain blocks as they're produced (~~3 seconds apart)
const unwatch = client.watchBlocks({
onBlock: (block) => console.log("new block", block.number),
});What you can subscribe to
- New block headers (newHeads) — react the moment a block lands
- Pending transactions (newPendingTransactions) — watch the mempool
- Contract event logs (logs) — filter by address and topics
BNB Smart Chain is a Layer 1 (proof-of-staked-authority), with ~~3 seconds block times and ~7.5 seconds (after 2 blocks + 1 with fast-finality upgrade) finality. That cadence sets how frequently new-block subscriptions fire.
Frequently asked questions
Does SwiftNodes support BNB Smart Chain WebSocket?
Yes. Every BNB Smart Chain plan includes a WebSocket (wss://) endpoint alongside HTTP, with no separate add-on. Connect to wss://rpc.swiftnodes.io/ws/bsc?key=<key> and open subscriptions immediately.
What is the BNB Smart Chain WebSocket URL?
wss://rpc.swiftnodes.io/ws/bsc?key=YOUR_API_KEY — replace YOUR_API_KEY with the key from your dashboard. The matching HTTP endpoint is https://rpc.swiftnodes.io/rpc/bsc?key=YOUR_API_KEY.
Is there a message rate limit on the WebSocket?
Yes — WebSocket throughput scales with your plan (1 msg/s on Free up to 250 msg/s on Pro), with concurrent-connection limits per plan. Within those limits, subscriptions stream in real time.
See the full BNB Smart Chain RPC page for chain details, or the WebSocket docs for the complete method list.
Get a BNB Smart Chain endpoint free
HTTP + WebSocket, flat-rate, pay with crypto, no KYC. Live in 30 seconds.
Get your API key