BNB Smart Chain

BNB Smart Chain

eth_gasPrice

eth_gasPrice asks a BNB Smart Chain node what single per-gas price it currently recommends, returned as a hex wei value priced in BNB. BSC has historically favored low, fairly stable gas, so this one-number suggestion is often all a simple sender needs. Hit https://bsc.therpc.io/YOUR_API_KEY at chain ID 56 and you get the node's view of the going rate — the figure to drop into the gasPrice slot of a legacy, type-0 transaction.

Use cases

  • Take a quick read on what BSC gas costs right now before building a transaction.
  • Fill the gasPrice field of a legacy type-0 BNB transaction, the simplest send a wallet can construct.
  • Blend it into a fee oracle as one signal next to eth_feeHistory percentiles for a sturdier estimate.

Parameters

This method takes no parameters. Pass an empty array [].

Response

TypeDescription
string (hex)Hex-encoded gas price in wei (e.g. "0x4a817c800" = 20 gwei).

Example request

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"method": "eth_gasPrice",
"params": [],
"id": 1
}'

Try it live in the BNB Smart Chain playground.

Errors & troubleshooting

CodeMessageCause
-32603Internal errorNode could not estimate current gas price.

Common pitfalls

  • Where EIP-1559 is active this number is derived and tends to run high; for type-2 sends reach for eth_maxPriorityFeePerGas plus eth_feeHistory instead of this single figure.
  • The value is raw wei, so to show it as gwei divide by 1e9, or convert to BNB (divide by 1e18) before putting it in front of a user.

Supported networks

  • Mainnet — Chain ID: 56
  • Testnet — Chain ID: 97

See also

curl https://bsc.therpc.io/YOUR_API_KEY \
-X POST \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"eth_gasPrice","params":[]}'

Ready to call this in production?

Free tier covers personal projects. Pay-as-you-go scales without a card.