pcko1
bscscan-python
Python

The most popular asynchronous Python API for BscScan (Binance Smart Chain Explorer), available via PyPI.

Last updated Jul 8, 2026
295
Stars
100
Forks
0
Issues
0
Stars/day
Attention Score
69
Language breakdown
Python 99.8%
Shell 0.2%
Files click to expand
README

bscscan-python

A complete Python API for BscScan.com

Powered by BscScan.com APIs

Available on PyPI

:book: Read the official documentation here :book:

👇

A fork of the etherscan-python package.

Endpoints

The following endpoints are provided:

Accounts (source)

  • getbnbbalance
  • getbnbbalance_multiple
  • getnormaltxsbyaddress
  • getnormaltxsbyaddress_paginated
  • getinternaltxsbyaddress
  • getinternaltxsbyaddress_paginated
  • getinternaltxsbytxhash
  • getinternaltxsbyblockrangepaginated
  • getbep20tokentransfereventsbyaddress
  • getbep20tokentransfereventsbycontractaddresspaginated
  • getbep20tokentransfereventsbyaddressandcontract_paginated
  • getbep721tokentransfereventsbyaddress
  • getbep721tokentransfereventsbycontractaddresspaginated
  • getbep721tokentransfereventsbyaddressandcontract_paginated
  • getvalidatedblocksbyaddress
  • getvalidatedblocksbyaddress_paginated

Contracts (source)

  • getcontractabi
  • getcontractsource_code

Transactions (source)

  • gettxreceipt_status

Blocks (source)

  • getblockrewardbyblock_number
  • getestblockcountdowntimebyblock_number
  • getblocknumberbytimestamp

GETH/Parity Proxy (source)

  • getproxyblock_number
  • getproxyblockbynumber
  • getproxyblocktransactioncountbynumber
  • getproxytransactionbyhash
  • getproxytransactionbyblocknumberand_index
  • getproxytransaction_count
  • getproxytransaction_receipt
  • getproxycall
  • getproxycode_at
  • getproxystoragepositionat
  • getproxygas_price
  • getproxyest_gas

Tokens (source)

  • gettotalsupplybycontract_address
  • getcirculatingsupplybycontract_address
  • getaccbalancebytokencontractaddress

Stats (source)

  • gettotalbnb_supply
  • getvalidatorslist

Logs (source)

  • get_logs

If you think that a newly-added method is missing, kindly open an issue as a feature request and I will do my best to add it.

Installation

Before proceeding, you should register an account on BscScan.com and generate a personal API key to use.

Install from source:

bash
pip install git+https://github.com/pcko1/bscscan-python.git@stable

Alternatively, install from PyPI:

pip install bscscan-python

Unit tests

In bash, test that everything looks OK on your end using your YOURAPIKEY (without quotation marks):

bash
bash runtests.sh YOURAPI_KEY

Note: This will install the coverage package in your activated python environment.

Usage

In
python`, create a client with your personal BscScan.com API key:
python
import asyncio
from bscscan import BscScan

YOURAPIKEY = "..."

async def main(): async with BscScan(YOURAPIKEY) as bsc: print(await bsc.getbnbbalance(address="0x0000000000000000000000000000000000001004"))

if name == "main": asyncio.run(main())

> '167195709084498025431541166'

Examples

Detailed examples (arguments and results) for all methods may be found in the official documentation. Documentation Status

Issues

For problems regarding installing or using the package please open an issue. Kindly avoid disclosing potentially sensitive information such as your API keys or your wallet addresses.

Cite

Kotsias, P. C., pcko1/bscscan-python: v1.0.0. https://github.com/pcko1/bscscan-python (2021). doi:10.5281/zenodo.4781726

or in

:

@misc{Kotsias2020,
  author = {Kotsias, P.C.},
  title = {pcko1/bscscan-python},
  year = {2021},
  publisher = {Zenodo},
  url = {https://github.com/pcko1/bscscan-python},
  doi = {10.5281/zenodo.4781726}
}

Feel free to leave a :star: if you found this package useful.


Powered by Bscscan.com APIs.

© 2026 GitRepoTrend · pcko1/bscscan-python · Updated daily from GitHub