Command-line tool for listing Bitcoin network stats from Bitnodes. Documentation for the API used to get the details of nodes can be found at:

To keep the script responsive the data is downloaded automatically only if the file bnstats.json does not exist. To download the latest snapshot manually, run bnstats with the refresh command.

The Bitcoin nodes list can be summerized by countries, hostname, time zone, user-agent and service providers hosting the Bitcoin nodes.


You can download the script by cloning the GitHub repo:

git clone

bnstats was developed using Python 3 and uses requests and docopt packages. To install the requirements run the following command:

pip3 install -r requirements.txt

Usage [-rt &ls;num>] countries [-rt &ls;num>] networks [-rt &ls;num>] hostnames [-rt &ls;num>] timezones [-rt &ls;num>] useragents refresh -h, --help -v, --version

  countries                 List total nodes by country
  networks                  List total nodes by ISP
  hostnames                 List total nodes by hostname
  timezones                 List total nodes by timezone
  useragents                List total nodes by user-agent
  refresh                   Redownload the data from
  -t &ls;num>, --top &ls;num>     Number of rows returned [default: 10]
  -r, --raw                 Return raw output
  -h, --help                Show this help screen
  -v, --version             Print the version number


# Download the latest snapshot from Bitnodes: refresh

# Output list of top 10 countries countries

# Output list of top 50 countries countries -t 50

# Output the top 10 countries in raw format countries -r


  • If you've got any suggestions or questions, please create an issue here.
  • If you want to fix a bug or implement a feature, please feel free to do so. Just send me a pull request.


This project is licensed under a MIT license.