Do we have any api mechanism to find the balance for an address/contract for a given blockheight or till a given date.
1 Answer
You can use the HTTP-RPC interface on your local node.
http://localhost:8732/chains/main/blocks/{BLOCK}/context/contracts/{ADDRESS}/balance
On a default node, this is only good for the previous 5 cycles. If you want balances older than that, you need to use an archive
node.
Other options are to use the API provided by most block explorers like tzstats.com and tzkt.io which have account history back to block 1.