Binance Smart Chain Developer APIs

SVG

Access Blockchain Data

SVG

Building DAPPs

SVG

Verify Contracts

SVG

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 a list of 'Normal' Transactions By Address

[Optional Parameters] startblock: starting blockNo to retrieve results, endblock: ending blockNo to retrieve results

                                    https://api.bscscan.com/api?module=account&action=txlist&address=0x0000000000000000000000000000000000001004&startblock=0&endblock=99999999&sort=asc
                                

(Returned 'isError' values: 0=No Error, 1=Got Error)

(Returns up to a maximum of the last 10000 transactions only)

or

                                    https://api.bscscan.com/api?module=account&action=txlist&address=0x0000000000000000000000000000000000001004&startblock=0&endblock=99999999&page=1&offset=10&sort=asc
                                

(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.bscscan.com/api?module=account&action=txlistinternal&address=0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3&startblock=0&endblock=2702578&sort=asc
                                

(Returned 'isError' values: 0=No Error, 1=Got Error)

(Returns up to a maximum of the last 10000 transactions only)

or

                                    https://api.bscscan.com/api?module=account&action=txlistinternal&address=0x2c1ba59d6f58433fb1eaee7d20b26ed83bda51a3&startblock=0&endblock=2702578&page=1&offset=10&sort=asc
                                

(To get paginated results use page=<page number> and offset=<max records to return>)


Get "Internal Transactions" by Transaction Hash

                                    https://api.bscscan.com/api?module=account&action=txlistinternal&txhash=0x40eb908387324f2b575b4879cd9d7188f69c8fc9d87c901b9e2daaea4b442170
                                

(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.bscscan.com/api?module=account&action=txlistinternal&startblock=0&endblock=2702578&page=1&offset=10&sort=asc
                                

(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.bscscan.com/api?module=account&action=tokentx&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&startblock=0&endblock=999999999&sort=asc
                                

(Returns up to a maximum of the last 10000 transactions only)

or

                                    https://api.bscscan.com/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&page=1&offset=100&sort=asc
                                

(To get paginated results use page=<page number> and offset=<max records to return>)

or

                                    https://api.bscscan.com/api?module=account&action=tokentx&contractaddress=0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2&address=0x4e83362442b8d1bec281594cea3050c8eb01311c&page=1&offset=100&sort=asc
                                

(To get transfer events for a specific token contract, include the contractaddress parameter)

Contract APIs

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', 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.bscscan.com/api?module=contract&action=getsourcecode&address=0x0000000000000000000000000000000000001004 (replace the address parameter with the actual contract address)

2. Terms of usage: Please see the usage terms policy

General Stats APIs


Get Total Supply of BNB on the Binance Smart Chain

                                    https://api.bscscan.com/api?module=stats&action=bnbsupply
                                

(Result returned in Wei, to get value in BNB divide the ResultAbove/1000000000000000000)


Get Validators list on the Binance Smart Chain

                                    https://api.bscscan.com/api?module=stats&action=validators
                                

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