For the full documentation of available parameters and descriptions, please visit the official BNB JSON-RPC docs.
For compatibility with Parity, please prefix all hex strings with " 0x ".
eth_blockNumber
Returns the number of most recent block
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_blockNumber
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Sample response
{
"jsonrpc":"2.0",
"id":83,
"result":"0x87a05a"
}
eth_getBlockByNumber
Returns information about a block by block number.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getBlockByNumber
&tag=0x10d4f
&boolean=true
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the block number, in hex eg. 0xC36B3C |
| the boolean value to show full transaction objects. when true , returns full transaction objects and their information, when false only returns a list of transactions. |
Sample response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"baseFeePerGas": "0x8",
"difficulty": "0x0",
"extraData": "0x",
"gasLimit": "0x5f5e100",
"gasUsed": "0xb741",
"hash": "0x5c21788289f1a6c7ed45fb39123cce2a0ada0bdd07a706f782cb7151c3bf9933",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"miner": "0x4200000000000000000000000000000000000011",
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"nonce": "0x0000000000000000",
"number": "0x10d4f",
"parentHash": "0x0350db613563d132a6e36833540e4c05443d0063b8be877cb7fe019f83f0564a",
"receiptsRoot": "0x3f71ebd8822765e8146170b0f930f55f753dbb867f55e4e605894016cd32f1e2",
"sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
"size": "0x365",
"stateRoot": "0x73bf95fdae388455940e2da9077fe7d6a1546d73dd9dfd1b5edaf48ec97e57b3",
"timestamp": "0x64d72a4a",
"totalDifficulty": "0x0",
"transactions": [
{
"blockHash": "0x5c21788289f1a6c7ed45fb39123cce2a0ada0bdd07a706f782cb7151c3bf9933",
"blockNumber": "0x10d4f",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas": "0xf4240",
"gasPrice": "0x0",
"hash": "0x8b614dd87d222d30cc90d268534243fad3144a68a944e7d4430e06bb3912d8dd",
"input": "0x015d8eb90000000000000000000000000000000000000000000000000000000001d5af4c0000000000000000000000000000000000000000000000000000000064d72a1600000000000000000000000000000000000000000000000000000000cabf2e61202b6e493993c9f26027b605debba3aa2b678fb6b4d1decdf0f34ddb984e08690000000000000000000000000000000000000000000000000000000000000004000000000000000000000000ef8783382ef80ec23b66c43575a6103deca909c3000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240",
"nonce": "0x10d4e",
"to": "0x4200000000000000000000000000000000000015",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0xc7c6af6707c768f3acf595872908401f325abede72768e96839c2d49f270b010",
"mint": "0x0"
}
],
"transactionsRoot": "0xa9d77cd4cd9b7561247d73d8871310deff06a2a952984307f7cf9640234f3cbf",
"uncles": []
}
}
eth_getBlockTransactionCountByNumber
Returns the number of transactions in a block.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getBlockTransactionCountByNumber
&tag=0x10FB78
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the block number, in hex eg. 0x10FB78 |
Sample response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x1"
}
eth_getTransactionByHash
Returns the information about a transaction requested by transaction hash.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getTransactionByHash
&txhash=0x83f2e96f85dda79bde184adb5fb16fee208c39c28d36b067b5492ce7417aa4ed
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the hash of the transaction |
Sample Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0x40037c75d3c28ab5e59f15db9f6112f29f82a25cf240c742634914ee2320a7d6",
"blockNumber": "0x8706e3",
"from": "0x461db62a9f6e2fd38421f70bcab178b7fa521191",
"gas": "0x346e9",
"gasPrice": "0x2718",
"maxFeePerGas": "0x2728",
"maxPriorityFeePerGas": "0x2710",
"hash": "0x83f2e96f85dda79bde184adb5fb16fee208c39c28d36b067b5492ce7417aa4ed",
"input": "0xf305d719000000000000000000000000196ad5a70279fc112db4f8baf6f5022c9b1cf0a500000000000000000000000000000000000000000000071be4b5eef606d8de5700000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000461db62a9f6e2fd38421f70bcab178b7fa52119100000000000000000000000000000000000000000000000000000000655d2880",
"nonce": "0xc",
"to": "0xc4f975d858056912131f89567a949c30495e2972",
"transactionIndex": "0x6",
"value": "0xd40b6b2c9494000",
"type": "0x2",
"accessList": [],
"chainId": "0xcc",
"v": "0x0",
"r": "0x6b417a55f41d662510723c2de687f5c003c591e107d77e29bcb71c5409f23f64",
"s": "0x5c5ec7d15c45183fd5dfc2ebfc72812cf80b1990a79c1b8a3f8f2d9b90e0650a"
}
}
eth_getTransactionByBlockNumberAndIndex
Returns information about a transaction by block number and transaction index position.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getTransactionByBlockNumberAndIndex
&tag=0x10FB78
&index=0x0
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the block number, in hex eg. 0x10FB78 |
| the position of the uncle's index in the block, in hex eg. 0x0 |
Sample Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xcbf6eb91d0b8c0315efd25e025f8ddad6396b0a47c002f245d5069e68f19d908",
"blockNumber": "0x10fb78",
"from": "0xdeaddeaddeaddeaddeaddeaddeaddeaddead0001",
"gas": "0xf4240",
"gasPrice": "0x0",
"hash": "0xa2da08d907f0d0d4496d51be5454c3a9e82fb76aadc17f537fbb97e0a381248c",
"input": "0x015d8eb90000000000000000000000000000000000000000000000000000000001daf9ec0000000000000000000000000000000000000000000000000000000064e71841000000000000000000000000000000000000000000000000000000008a7c50153900974efbb88191075dc916a005eef18deee721b2b14807957a178a7a4e5aff0000000000000000000000000000000000000000000000000000000000000002000000000000000000000000ef8783382ef80ec23b66c43575a6103deca909c3000000000000000000000000000000000000000000000000000000000000083400000000000000000000000000000000000000000000000000000000000f4240",
"nonce": "0x10fb77",
"to": "0x4200000000000000000000000000000000000015",
"transactionIndex": "0x0",
"value": "0x0",
"type": "0x7e",
"v": "0x0",
"r": "0x0",
"s": "0x0",
"sourceHash": "0xfb3b9b7a7924c6ffefec1a241b5d593d9305ae2638dddf88025b3f83b8323e4a",
"mint": "0x0"
}
}
eth_getTransactionCount
Returns the number of transactions performed by an address.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getTransactionCount
&address=0x966c8BB0f00A59f1150e39bdd1deb6B399fcECb1
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the address to get transaction count |
| the string pre-defined block parameter, either earliest , pending or latest |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x36"
}
eth_sendRawTransaction
Submits a pre-signed transaction for broadcast to the BNB network.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_sendRawTransaction
&hex=0xb6f9de950000000000000000000000000000000000000000000060e4a7c84b0a882100000000000000000000000000000000000000000000000000000000000000000080000000000000000000000000d5b12178161244cd1ac9ee4857b53f0b6e7c5a46000000000000000000000000000000000000000000000000000000277bd8ac6400000000000000000000000000000000000000000000000000000000000000020000000000000000000000004200000000000000000000000000000000000006000000000000000000000000196ad5a70279fc112db4f8baf6f5022c9b1cf0a5
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the signed raw transaction data to broadcast. |
💡 Tip: Send a POST request if your hex string is particularly long.
🖋️ For more information on creating a signed raw transaction, visit this page.
Sample Response
{
"id":1,
"jsonrpc": "2.0",
"result": "0xe670ec64341771606e55d6b4ca35a1a6b75ee3d5145a99d05921026d1527331"
}
⛏️ Note: The result
represents the transaction hash of the submitted raw transaction.
Use eth_getTransactionReceipt to retrieve full details.
eth_getTransactionReceipt
Returns the receipt of a transaction by transaction hash.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getTransactionReceipt
&txhash=0xd193fe81e3fac69b6e4a42c373782e6e0e2cc6da7524acfe3328d06d90c0d7b9
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the hash of the transaction |
Sample Response
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"blockHash": "0xc745cd1340be23e379f20f4cf8444e52f4571aa8a6c1b05e33d91b681a6434fa",
"blockNumber": "0x5ad400",
"contractAddress": null,
"cumulativeGasUsed": "0x6bc7d",
"effectiveGasPrice": "0x2718",
"from": "0x1f574b62c93497185d6ad90be4f1ee2c4a348ee7",
"gasUsed": "0x28ef0",
"l1Fee": "0x1478ad4f2ce0",
"l1FeeScalar": "1",
"l1GasPrice": "0xf787b6a8",
"l1GasUsed": "0x152c",
"logs": [
{
"address": "0x8be663ecd492b956fa0d7c054d77a97695b7ec48",
"topics": [
"0xc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62",
"0x000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace",
"0x0000000000000000000000001f574b62c93497185d6ad90be4f1ee2c4a348ee7",
"0x000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace"
],
"data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001",
"blockNumber": "0x5ad400",
"transactionHash": "0xd193fe81e3fac69b6e4a42c373782e6e0e2cc6da7524acfe3328d06d90c0d7b9",
"transactionIndex": "0x3",
"blockHash": "0xc745cd1340be23e379f20f4cf8444e52f4571aa8a6c1b05e33d91b681a6434fa",
"logIndex": "0x5",
"removed": false
},
{
"address": "0x07e57ce31045f284773cd1d20328d238c1f868bd",
"topics": [
"0x9027756f10fb7f0e1221e193e4d606f166e47b4c9805d4bccd23f113d7d3bafd"
],
"data": "0x619207f47fafdad529e1b5e7510c208c871756070eab64f11f383fba674d7ff6000000000000000000000000cf42ac2207e0daa36a3cd87d23f56cc1dc24bace",
"blockNumber": "0x5ad400",
"transactionHash": "0xd193fe81e3fac69b6e4a42c373782e6e0e2cc6da7524acfe3328d06d90c0d7b9",
"transactionIndex": "0x3",
"blockHash": "0xc745cd1340be23e379f20f4cf8444e52f4571aa8a6c1b05e33d91b681a6434fa",
"logIndex": "0x6",
"removed": false
},
{
"address": "0xcf42ac2207e0daa36a3cd87d23f56cc1dc24bace",
"topics": [
"0x2fa3299839422fce25eaba11e9ae23923abcbb02aae4abfca2ca4e61aa823d18",
"0x000000000000000000000000000000000000000000000000000000000001faf0"
],
"data": "0x0000000000000000000000001f574b62c93497185d6ad90be4f1ee2c4a348ee70000000000000000000000008be663ecd492b956fa0d7c054d77a97695b7ec480000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000000001619207f47fafdad529e1b5e7510c208c871756070eab64f11f383fba674d7ff6",
"blockNumber": "0x5ad400",
"transactionHash": "0xd193fe81e3fac69b6e4a42c373782e6e0e2cc6da7524acfe3328d06d90c0d7b9",
"transactionIndex": "0x3",
"blockHash": "0xc745cd1340be23e379f20f4cf8444e52f4571aa8a6c1b05e33d91b681a6434fa",
"logIndex": "0x7",
"removed": false
}
],
"logsBloom": "0x00002000000000000000000000000000004000000000000002000000000000000000000000000000000000000000000000000100000000000000004000002000000000000000000000040000000000400000000000010000000000000000000000000000000020000000004000000000001000000000000001000040000000000000800000002000000000000000200000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000000001000000000400000000000000000000000000000008000000000000000400000000000000000400000000000000000000800000000000000400080000004000",
"status": "0x1",
"to": "0xcf42ac2207e0daa36a3cd87d23f56cc1dc24bace",
"transactionHash": "0xd193fe81e3fac69b6e4a42c373782e6e0e2cc6da7524acfe3328d06d90c0d7b9",
"transactionIndex": "0x3",
"type": "0x2"
}
}
eth_call
Executes a new message call immediately without creating a transaction on the block chain.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_call
&to=0xc4f975d858056912131f89567a949c30495e2972
&data=0x
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the address to interact with |
| the hash of the method signature and encoded parameters |
| the string pre-defined block parameter, either earliest , pending or latest |
⛽ Note: The gas
parameter is capped at 2x the current block gas limit.
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x00000000000000000000000000000000000000000000000000601d8888141c00"
}
eth_getCode
Returns code at a given address.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getCode
&address=0xa02d433868c7ad58c8a2a820d6c3ff8a15536acc
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the string representing the address to get code |
| the string pre-defined block parameter, either earliest , pending or latest |
Sample Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106ca565b610118565b61005b6100933660046106e5565b61015f565b3480156100a457600080fd5b506100ad6101d0565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106ca565b61020b565b3480156100f557600080fd5b506100ad610235565b610106610292565b610116610111610331565b61033b565b565b61012061035f565b6001600160a01b0316336001600160a01b031614156101575761015481604051806020016040528060008152506000610392565b50565b6101546100fe565b61016761035f565b6001600160a01b0316336001600160a01b031614156101c8576101c38383838080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525060019250610392915050565b505050565b6101c36100fe565b60006101da61035f565b6001600160a01b0316336001600160a01b03161415610200576101fb610331565b905090565b6102086100fe565b90565b61021361035f565b6001600160a01b0316336001600160a01b0316141561015757610154816103f1565b600061023f61035f565b6001600160a01b0316336001600160a01b03161415610200576101fb61035f565b606061028583836040518060600160405280602781526020016107e460279139610445565b9392505050565b3b151590565b61029a61035f565b6001600160a01b0316336001600160a01b031614156101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101fb610519565b3660008037600080366000845af43d6000803e80801561035a573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b61039b83610541565b6040516001600160a01b038416907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a26000825111806103dc5750805b156101c3576103eb8383610260565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f61041a61035f565b604080516001600160a01b03928316815291841660208301520160405180910390a1610154816105e9565b6060833b6104a45760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b6064820152608401610328565b600080856001600160a01b0316856040516104bf9190610794565b600060405180830381855af49150503d80600081146104fa576040519150601f19603f3d011682016040523d82523d6000602084013e6104ff565b606091505b509150915061050f828286610675565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610383565b803b6105a55760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b6064820152608401610328565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5b80546001600160a01b0319166001600160a01b039290921691909117905550565b6001600160a01b03811661064e5760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b6064820152608401610328565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61036105c8565b60608315610684575081610285565b8251156106945782518084602001fd5b8160405162461bcd60e51b815260040161032891906107b0565b80356001600160a01b03811681146106c557600080fd5b919050565b6000602082840312156106dc57600080fd5b610285826106ae565b6000806000604084860312156106fa57600080fd5b610703846106ae565b9250602084013567ffffffffffffffff8082111561072057600080fd5b818601915086601f83011261073457600080fd5b81358181111561074357600080fd5b87602082850101111561075557600080fd5b6020830194508093505050509250925092565b60005b8381101561078357818101518382015260200161076b565b838111156103eb5750506000910152565b600082516107a6818460208701610768565b9190910192915050565b60208152600082518060208401526107cf816040850160208701610768565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212204675187caf3a43285d9a2c1844a981e977bd52a85ff073e7fc649f73847d70a464736f6c63430008090033"
}
eth_getStorageAt
Returns the value from a storage position at a given address.
This endpoint is still experimental and may have potential issues
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_getStorageAt
&address=0xa02d433868c7ad58c8a2a820d6c3ff8a15536acc
&position=0x0
&tag=latest
&apikey=YourApiKeyToken
Try this endpoint in your browser
Query Parameters
Parameter | Description |
---|
| the string representing the address to get code |
| the hex code of the position in storage, eg 0x0 |
| the string pre-defined block parameter, either earliest , pending or latest |
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x000000000000000000001d568fc08a1d3978985bc3e896a22abd1222abcf0001"
}
eth_gasPrice
Returns the current price per gas in wei.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_gasPrice
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Sample Response
{
"jsonrpc":"2.0",
"id":73,
"result":"0x430e23400"
}
📖 Tip: The result
is returned in wei.
Easily convert BNB units using our unit converter.
eth_estimateGas
Makes a call or transaction, which won't be added to the blockchain and returns the used gas.
https://api-opbnb.bscscan.com/api
?module=proxy
&action=eth_estimateGas
&data=0x4e71d92d
&to=0xf0160428a8552ac9bb7e050d90eeade4ddd52843
&value=0xff22
&gasPrice=0x51da038cc
&gas=0x5f5e0ff
&apikey=YourApiKeyToken
Try this endpoint in your browser 🔗
Query Parameters
Parameter | Description |
---|
| the hash of the method signature and encoded parameters |
| the string representing the address to interact with |
| the value sent in this transaction, in hex eg. 0xff22 |
| the amount of gas provided for the transaction, in hex eg. 0x5f5e0ff |
| the gas price paid for each unit of gas, in wei post EIP-1559, the gasPrice has to be higher than the block's baseFeePerGas |
⛽ Note: The gas
parameter is capped at 2x the current block gas limit.
Sample Response
{
"jsonrpc":"2.0",
"id":1,
"result":"0x5248"
}
Last updated