Bitcoin Forum

Other => Beginners & Help => Topic started by: Pmalek on November 12, 2018, 10:05:49 PM



Title: Check the balance of your Bitcoin address at a specific date
Post by: Pmalek on November 12, 2018, 10:05:49 PM
I couldn't find if anybody wrote about this before, sorry if that is the case.
Someone asked if it is possible to check the balance of a BTC address at a specific date in the past, for example 2 years ago. It is possible with Blockchain.info

This is the way to do that.
https://blockchain.info/charts/balance?address=SOME_BTC_ADDRESS

Input your address you want to check the balance for above where it says SOME_BTC_ADDRESS
There's a button on the bottom where you can change to a different time frame, for example you want to see the balance 6 months ago, 1 year ago or for all time.

Source:
https://bitcoin.stackexchange.com/questions/50728/is-there-any-tool-available-that-can-tell-me-the-balance-of-bitcoin-address-on-s


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Kavelj22 on November 12, 2018, 10:49:42 PM
https://blockchain.info/charts/balance?address=SOME_BTC_ADDRESS
This Link is broken:
{"status":"not-found","error":null}


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Pmalek on November 12, 2018, 10:54:53 PM
@Kavelj22
You need to enter your BTC address at the end of the link like the post says.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: LTU_btc on November 12, 2018, 11:37:14 PM
Nice, thanks for sharing this link. It's interesting to check history of my Bitcoin address balance. It's also can be useful if you want to check is your Bitcoin address is eligible for one of Bitcoin forks and see how much coins you can get. It would be nice if they show history of value in $ of Bitcoins in that address.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Pmalek on November 13, 2018, 12:09:10 PM
...It's also can be useful if you want to check is your Bitcoin address is eligible for one of Bitcoin forks and see how much coins you can get.
Yes, that is right. BCH will have a fork on November 15th for example and this is a good way to check if your address is eligible for the new coins.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Coding Enthusiast on November 14, 2018, 04:36:04 AM
Can you think of a reason why you would want to know your balance on an "specific date" instead of an "specific block height"? Your BCH fork example above would require you to check your balance at a block height not a date.
I am trying to decide whether to implement this in my watch-only-wallet which currently has the height thing.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Pmalek on November 14, 2018, 12:39:12 PM
-
It could be useful for people accepting 100s of transactions per day like coffee shops, private businesses, donations etc. You might need to check the amount you received for a particular month to pay taxes for example.   


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: paxmao on November 14, 2018, 01:07:59 PM
Sure I donīt see why not, the chain has all the transactions since the genesis block, so just find the ones related to that address and see what happens.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: mocacinno on November 14, 2018, 02:45:15 PM
You can always use a small script to parse on of the many available api's... I wrote a startscript that *should* work for address with a history <= 50 tx's.

It could easily be expanded for > 50 tx's by putting everything in a loop and make requests to the api changing the to-parameter untill the response is not containing anymore data...

It's also quite easy to convert the unix timestamp to a readable date, and things might go sour if the amount of numbers in the timestamp differs between the transactions (in other words, all transactions have to be BEFORE 09/09/2001 or after 09/09/2001... Fixing this issue would also be pretty easy, but as i said: i'm feeling lazy today... And since bitcoin didn't exist in 2001, it shouldn't matter anyway)

This script is open source, free and NOT intended for production environments... I did not ask blockexplorer.com's permission to use their api, and i only tested the script on one of my own addresses... I was to lazy to build a proper testcase... I'm not responsible for any damages you might incur running this script  ;D

Code:
import requests 
import json
import collections
address = '1YourAddressHere'
URL = "https://blockexplorer.com/api/addrs/"+address+"/txs?from=0&to=50"
r = requests.get(url = URL)
database = json.loads(r.text)
outputdb = {}
for item in database['items']:
txid = item['txid']
timestamp = item['time']
vins = item['vin']
vouts = item['vout']
for vin in vins:
vinaddr = vin['addr']
valuein = vin['value']
if vinaddr == address:
value = valuein * -1
outputdb[str(timestamp) + '.' + str(txid)] = {"txid": str(txid), "timestamp": int(timestamp), "value" : float(value)}
for vout in vouts:
try:
voutaddresses = vout['scriptPubKey']['addresses']
voutvalue = vout['value']
for voutaddress in voutaddresses:
if voutaddress == address:
outputdb[str(timestamp) + '.' + str(txid)] = {"txid": str(txid), "timestamp": int(timestamp), "value" : float(voutvalue)}
except:
number = 1
od = collections.OrderedDict(sorted(outputdb.items()))
balance = 0
for k, v in od.iteritems():
balance = balance + float(v['value'])
print str(v['timestamp']) + ' ' + str(v['txid'] + "=> " + str(balance) + "<" + str(float(v['value'])) + ">")



Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Adriano2010 on November 14, 2018, 03:27:33 PM
Interesting. Thanks for finding this info and share here guys. Is usefull for who want to check a history of a specific bitcoin address. The script can also check how much transaction at same time? I'm a noob on programming, what steps i need to do to run your script mocacinno ?


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: mocacinno on November 14, 2018, 05:40:51 PM
Interesting. Thanks for finding this info and share here guys. Is usefull for who want to check a history of a specific bitcoin address. The script can also check how much transaction at same time? I'm a noob on programming, what steps i need to do to run your script mocacinno ?

With minor changes it sould be able to capture quite a bit of info, yes....

As for running it: it requires python 2.7, and the requests, json and collections libraries... Python 2.7 should be available for free on most operating systems


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: mirakal on January 15, 2019, 06:53:28 AM
Very useful thread, this is worth sharing.
Now I tried my address and able to see clearly that my transaction has significantly dropped :(.
My 1 year transaction is pretty low compared to the past years, I can't deny I'm very much affected by the bear.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Pmalek on December 22, 2019, 09:17:11 AM
Bump


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Herbert_kopf on December 22, 2019, 10:10:08 AM
Bump
thank you. Only way I knew it bitref


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Negotiation on December 22, 2019, 04:03:21 PM
Thank you very much I think your Bitcoin address balance should be checked at a certain date Often times we check our address is incorrect and can be read in the scam's cobble. If we check on a specific date, our Bitcoin will be secured and effective Also in the case of transactions I will know how many coins I get.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: bitmover on December 22, 2019, 04:39:59 PM
Isn't this too much trouble for something any blockchain explorer can do?
Just deduct all transactions past the specific date you want.
Unless you have to know the value of many addresses in an specific date


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Subbir on December 22, 2019, 04:59:58 PM
The first factor I wished to know was however do I determine the primary bitcoin transaction with the address that I did? And is it extremely attainable realize to seek out out if attainable then by praying somebody will tell Maine the way to find it out?


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: crairezx20 on December 22, 2019, 05:57:56 PM
~snip~
~snip~

Did you try the link above?
I'm getting this error when accessing it both firefox and chrome:
https://i.imgur.com/CFsrQk9.png
Are you using some tools to make this work?
How did you manage to make it work?


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: NeuroticFish on December 22, 2019, 06:57:49 PM
Are you using some tools to make this work?
How did you manage to make it work?

From what I know this works https://api.blockcypher.com/v1/btc/main/addrs/1BitcoinEaterAddressDontSendf59kuE?after=520000&before=550000
But you have to test/make sure it works for you (afaik it returns only a max number of tx) and you have to know the block numbers for the period.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: LTU_btc on December 22, 2019, 10:38:59 PM
Did you try the link above?
I'm getting this error when accessing it both firefox and chrome:
https://talkimg.com/images/2023/09/10/m02jc.png
Are you using some tools to make this work?
How did you manage to make it work?
It also doesn't works for me. I don't know, maybe this tool isn't available anymore or link to it has been changed.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: nc50lc on December 23, 2019, 02:35:47 AM
Are you using some tools to make this work?
How did you manage to make it work?
It must be because of their website upgrade/update after October 31 or November 1.
Most of the "workaround tricks" by adding something to the URL don't work anymore.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: PrimeNumber7 on December 23, 2019, 02:57:41 AM
Can you think of a reason why you would want to know your balance on an "specific date" instead of an "specific block height"?
An auditor may be trying to confirm that a business owed x bitcoins on y date as reflected in their business records. This verification may eventually be changed to '...as of block z..." but the auditor would need to know which blocks were found on y date.

A useful functionality might be for your program to allow a user to input a time zone and date, your program would output the starting and ending blocks found in that time, and the user can then make a query as of a specific block.


Title: Re: Check the balance of your Bitcoin address at a specific date
Post by: Pmalek on December 23, 2019, 09:36:58 AM
Yes it looks it is no longer working following one of their upgrades. Too bad, it was a useful tool I think. I tried searching on the site if there was another way to do it but I couldn't find anything. I will do some more research and see if I come up with anything.