Post
Topic
Board Bitcoin Technical Support
Merits 6 from 4 users
Re: Check BTC balance programmatically
by
LoyceV
on 01/02/2024, 06:51:00 UTC
⭐ Merited by bitmover (2) ,hosseinimr93 (2) ,apogio (1) ,ABCbits (1)
I was wondering if anyone knew a better way of doing this
Yes Tongue
Step 1: Download the latest list of all Bitcoin addresses with a balance.
Step 2: Do this:
How to use
The most likely use is to check a long list of Bitcoin addresses for a remaining balance.
On Linux, use this to find matching addresses (after extrating the compressed .gz file of course):
Code:
comm -12 Bitcoin_addresses_LATEST.txt <(cat mylist.txt | sort | uniq)
  • Bitcoin_addresses_LATEST.txt: the extracted latest version downloaded from addresses.loyce.club.
  • mylist.txt: your own list of addresses, one address per line.
This takes only seconds to check millions of addresses. If your text file has Microsoft formatting, you may need to use this instead:
Code:
comm -12 Bitcoin_addresses_LATEST.txt <(cat mylist.txt | fromdos | sort | uniq)

You can do the same for ethereum, but I only have an old list of addresses.