Post
Topic
Board Project Development
Merits 2 from 1 user
Re: [Question] Fast way to check bulk address bitcoin balance
by
Yamane_Keto
on 15/11/2023, 14:08:14 UTC
⭐ Merited by vapourminer (2)

Code:
import requests

def fetch_balances(addresses):
    address_list = '|'.join(addresses)

    api_endpoint = f'https://blockchain.info/balance?active={address_list}'


A simple python script that would help you to fetch the balances of multiple addresses. The output would be in satoshis due to API of Blockchain.com
The blockchain.info API has a long history of sudden shutdowns, in which you will not receive a notification or alert, and the support team responds slowly and may continue for several days without knowing the cause of the problem.
blockchair.com/API is better.


The correct way to do this faster is download an updated list of address with balance List of all Bitcoin addresses with a balance

It seems that addresses.loyce.club depends on the data that comes from blockchair_bitcoin_addresses_and_balance_DATE.tsv.gz. Therefore, even if you download this file and try to manage the database and then create the API, you are accessing the indirect blockchair/API, which I think would be slower, if If you have the resources, buy a paid service.