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
gasPricefield 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_feeHistorypercentiles for a sturdier estimate.
Parameters
This method takes no parameters. Pass an empty array [].
Response
| Type | Description |
|---|---|
| string (hex) | Hex-encoded gas price in wei (e.g. "0x4a817c800" = 20 gwei). |
Example request
Try it live in the BNB Smart Chain playground.
Errors & troubleshooting
| Code | Message | Cause |
|---|---|---|
-32603 | Internal error | Node 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_maxPriorityFeePerGaspluseth_feeHistoryinstead 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