Binance Smart Chain Developer APIs
Access Blockchain Data
Building DAPPs
Verify Contracts
Community Driven
Introduction
The Binance Smart Chain Developer APIs are provided as a community service and without warranty, so please use what you need and no more. We support both GET/POST requests and there is a rate limit of 5 calls per sec/IP.
Note: Source attribution via a link back or mention that your app is "Powered by BscScan.com APIs" is required except for personal/private usage.
Account APIs
Get BNB Balance for a single Address
https://api-testnet.bscscan.com/api?module=account&action=balance&address=0x0000000000000000000000000000000000001004&tag=latest&apikey=YourApiKeyToken
Get BNB Balance for multiple Addresses in a single call
https://api-testnet.bscscan.com/api?module=account&action=balancemulti&address=0x0000000000000000000000000000000000001004,0x63a9975ba31b0b9626b34300f7f627147df1f526,0x198ef1ec325a96cc354c7266a038be8b5c558f67&tag=latest&apikey=YourApiKeyToken
Separate addresses by comma, up to a maxium of 20 accounts in a single batch
Get a list of 'Normal' Transactions By Address
[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results
https://api-testnet.bscscan.com/api?module=account&action=txlist&address=0x0000000000000000000000000000000000001004&startblock=0&endblock=99999999&sort=asc&apikey=YourApiKeyToken
(Returned 'isError' values: 0=No Error, 1=Got Error)
(Returns up to a maximum of the last 10000 transactions only)
or
https://api-testnet.bscscan.com/api?module=account&action=txlist&address=0x0000000000000000000000000000000000001004&startblock=0&endblock=99999999&page=1&offset=10&sort=asc&apikey=YourApiKeyToken
(To get paginated results use page=<page number> and offset=<max records to return>)
Get a list of 'Internal' Transactions by Address
[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results
https://api-testnet.bscscan.com/api?module=account&action=txlistinternal&address=0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3&startblock=0&endblock=2702578&sort=asc&apikey=YourApiKeyToken
(Returned 'isError' values: 0=No Error, 1=Got Error)
(Returns up to a maximum of the last 10000 transactions only)
or
https://api-testnet.bscscan.com/api?module=account&action=txlistinternal&address=0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3&startblock=0&endblock=2702578&page=1&offset=10&sort=asc&apikey=YourApiKeyToken
(To get paginated results use page=<page number> and offset=<max records to return>)
Get "Internal Transactions" by Transaction Hash
https://api-testnet.bscscan.com/api?module=account&action=txlistinternal&txhash=0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170&apikey=YourApiKeyToken
(Returned 'isError' values: 0=Ok, 1=Rejected/Cancelled)
(Returns up to a maximum of the last 10000 transactions only)
Get "Internal Transactions" by Block Range
https://api-testnet.bscscan.com/api?module=account&action=txlistinternal&startblock=0&endblock=2702578&page=1&offset=10&sort=asc&apikey=YourApiKeyToken
(Returns up to a maximum of the last 10000 transactions only)
Get a list of "BEP-20 - Token Transfer Events" by Address
[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results
https://api-testnet.bscscan.com/api?module=account&action=tokentx&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&startblock=0&endblock=999999999&sort=asc&apikey=YourApiKeyToken
(Returns up to a maximum of the last 10000 transactions only)
or
https://api-testnet.bscscan.com/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&page=1&offset=100&sort=asc&apikey=YourApiKeyToken
(To get paginated results use page=<page number> and offset=<max records to return>)
or
https://api-testnet.bscscan.com/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&page=1&offset=100&sort=asc&apikey=YourApiKeyToken
(To get transfer events for a specific token contract, include the contractaddress parameter)
Get list of Blocks Validated by Address
https://api-testnet.bscscan.com/api?module=account&action=getminedblocks&address=0x9dd134d14d1e65f84b706d6f205cd5b1cd03a46b&blocktype=blocks&apikey=YourApiKeyToken
or
https://api-testnet.bscscan.com/api?module=account&action=getminedblocks&address=0x9dd134d14d1e65f84b706d6f205cd5b1cd03a46b&blocktype=blocks&page=1&offset=10&apikey=YourApiKeyToken
(To get paginated results use page=<page number> and offset=<max records to return>)
** type = blocks (full blocks only)
Contract APIs
Get Contract ABI for Verified Contract Source Codes
https://api-testnet.bscscan.com/api?module=contract&action=getabi&address=0x0000000000000000000000000000000000001004&apikey=YourApiKeyToken
A simple sample for retrieving the contractABI using Web3.js and Jquery to interact with a contract
var Web3 = require('web3'); var web3 = new Web3(new Web3.providers.HttpProvider()); var version = web3.version.api; $.getJSON('https://api.bscscan.com/api?module=contract&action=getabi&address=0x0000000000000000000000000000000000001004&apikey=YourApiKeyToken', function (data) { var contractABI = ""; contractABI = JSON.parse(data.result); if (contractABI != ''){ var MyContract = web3.eth.contract(contractABI); var myContractInstance = MyContract.at("0x0000000000000000000000000000000000001004"); var result = myContractInstance.memberId("0xfe8ad7dd2f564a877cc23feea6c0a9cc2e783715"); console.log("result1 : " + result); var result = myContractInstance.members(1); console.log("result2 : " + result); } else { console.log("Error" ); } });
Get Contract Source Code for Verified Contract Source Codes
1. https://api-testnet.bscscan.com/api?module=contract&action=getsourcecode&address=0x0000000000000000000000000000000000001004&apikey=YourApiKeyToken (replace the address parameter with the actual contract address)
2. Terms of usage: Please see the usage terms policy
Token Info APIs
Get BEP20-Token TotalSupply (aka MaxSupply) by ContractAddress
https://api-testnet.bscscan.com/api?module=stats&action=tokensupply&contractaddress=0xe9e7cea3dedca5984780bafc599bd69add087d56&apikey=YourApiKeyToken
Get BEP20-Token Circulating Supply (Applicable for Binance Cross Chain token Types) by ContractAddress
https://api-testnet.bscscan.com/api?module=stats&action=tokenCsupply&contractaddress=0xe9e7cea3dedca5984780bafc599bd69add087d56&apikey=YourApiKeyToken
Get BEP20-Token Account Balance for TokenContractAddress
https://api-testnet.bscscan.com/api?module=account&action=tokenbalance&contractaddress=0xe9e7cea3dedca5984780bafc599bd69add087d56&address=0x89e73303049ee32919903c09e8de5629b84f59eb&tag=latest&apikey=YourApiKeyToken
General Stats APIs
Get Total Supply of BNB on the Binance Smart Chain
https://api-testnet.bscscan.com/api?module=stats&action=bnbsupply&apikey=YourApiKeyToken
(Result returned in Wei, to get value in BNB divide the ResultAbove/1000000000000000000)
Public BSC RPC Nodes
Mainnet BSC RPC Nodes
Mainnet BSC RPC Endpoints (ChainID 56):
https://bsc-dataseed1.binance.org/
https://bsc-dataseed2.binance.org/
https://bsc-dataseed3.binance.org/
https://bsc-dataseed4.binance.org/
https://bsc-dataseed1.defibit.io/
https://bsc-dataseed2.defibit.io/
https://bsc-dataseed3.defibit.io/
https://bsc-dataseed4.defibit.io/
https://bsc-dataseed1.ninicoin.io/
https://bsc-dataseed2.ninicoin.io/
https://bsc-dataseed3.ninicoin.io/
https://bsc-dataseed4.ninicoin.io/
Testnet BSC RPC Nodes
Testnet BSC RPC Endpoints (ChainID 97):
https://data-seed-prebsc-1-s1.binance.org:8545/
https://data-seed-prebsc-2-s1.binance.org:8545/
http://data-seed-prebsc-1-s2.binance.org:8545/
http://data-seed-prebsc-2-s2.binance.org:8545/
https://data-seed-prebsc-1-s3.binance.org:8545/
https://data-seed-prebsc-2-s3.binance.org:8545/
Usage Notes:
Start
You can start the HTTP JSON-RPC with the --rpc flag
## mainnet
geth attach https://bsc-dataseed1.binance.org
## testnet
geth attach https://data-seed-prebsc-1-s1.binance.org:8545/
JSON-RPC methods
Please refer to this wiki page or use Postman: https://documenter.getpostman.com/view/4117254/ethereum-json-rpc/RVu7CT5J?version=latest