Pages:
Author

Topic: APIs to know the balance of a bitcoin address (Read 2721 times)

newbie
Activity: 1
Merit: 0
Good morning everyone.
Currently I have checked:
http://persiabourse.ir/
http://tgfb.ir/
hero member
Activity: 865
Merit: 1006
member
Activity: 88
Merit: 10
Founder/Blogger/Web Developer at BITVoxy
September 11, 2016, 11:54:28 PM
#25
Ok, i added these to my list https://github.com/BITVoxy/awesome-bitcoin
hero member
Activity: 865
Merit: 1006
September 10, 2016, 08:00:50 AM
#24
Quote
also you need to add a header with the ApiKey

Actually API key is not needed. This should work:

Code:
import json
import requests
addr = '1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp'

request = 'https://www.blockonomics.co/api/balance'
response = requests.post(request, data=json.dumps({"addr":addr}))
content = response.json()
balance = content['response'][0]['confirmed']

Works fine...
Thanks
hero member
Activity: 688
Merit: 565
September 10, 2016, 07:45:22 AM
#23
Quote
also you need to add a header with the ApiKey

Actually API key is not needed. This should work:

Code:
import json
import requests
addr = '1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp'

request = 'https://www.blockonomics.co/api/balance'
response = requests.post(request, data=json.dumps({"addr":addr}))
content = response.json()
balance = content['response'][0]['confirmed']
legendary
Activity: 1039
Merit: 2783
Bitcoin and C♯ Enthusiast
September 10, 2016, 07:14:10 AM
#22
##
i Call with python program, no errors in others APIs but, this not work:

Code:
addr = '1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp'

request = 'https://www.blockonomics.co/api/balance/' + addr
response = requests.get(request)
content = response.json()
content = int(content['response']['confirmed'])

####

your problem is in your first line of code `request` you should send the request to the URI without the appended `addr` instead you should put the `addr` inside of a HttpRequest (equivalent in python) and `post` it.

also you need to add a header with the ApiKey
Code:
POST https://www.blockonomics.co/api/balance
Request body: {"addr": }
p.s. everywhere i look i see people are using python these days, i am getting depressed for choosing to learn C# Cool
hero member
Activity: 865
Merit: 1006
hero member
Activity: 865
Merit: 1006
September 10, 2016, 05:54:45 AM
#20
Also Blockonomics api

I suggest you have a look a moneywagon project.
Using it you can use bitcoin api, without worrying about backend service.
It will do roundrobin/random selection of service, or also can do paranoid checking to make sure balance is correct
across several services. It also supports most of the existing API services

Thanks for this new API, but don't have JSON response...

what do you call this if not JSON response Smiley
Code:
{"response": [{"confirmed": 189412205, "addr": "1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp", "unconfirmed": 012211 }, {"confirmed": 746599881, "addr": "1dice97ECuByXAvqXpaYzSaQuPVvrtmz6", "unconfirmed": 0}]}

i Call with python program, no errors in others APIs but, this not work:

Code:
addr = '1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp'

request = 'https://www.blockonomics.co/api/balance/' + addr
response = requests.get(request)
content = response.json()
content = int(content['response']['confirmed'])


i receive this error:

    content = response.json()
  File "/usr/local/lib/python2.7/dist-packages/requests/models.py", line 812, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 382, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded

legendary
Activity: 1039
Merit: 2783
Bitcoin and C♯ Enthusiast
September 10, 2016, 03:56:41 AM
#19
Also Blockonomics api

I suggest you have a look a moneywagon project.
Using it you can use bitcoin api, without worrying about backend service.
It will do roundrobin/random selection of service, or also can do paranoid checking to make sure balance is correct
across several services. It also supports most of the existing API services

Thanks for this new API, but don't have JSON response...

what do you call this if not JSON response Smiley
Code:
{"response": [{"confirmed": 189412205, "addr": "1dice8EMZmqKvrGE4Qc9bUFf9PX3xaYDp", "unconfirmed": 012211 }, {"confirmed": 746599881, "addr": "1dice97ECuByXAvqXpaYzSaQuPVvrtmz6", "unconfirmed": 0}]}
hero member
Activity: 865
Merit: 1006
September 10, 2016, 03:51:58 AM
#18
Also Blockonomics api

I suggest you have a look a moneywagon project.
Using it you can use bitcoin api, without worrying about backend service.
It will do roundrobin/random selection of service, or also can do paranoid checking to make sure balance is correct
across several services. It also supports most of the existing API services

Thanks for this new API, but don't have JSON response...
hero member
Activity: 688
Merit: 565
September 10, 2016, 02:13:43 AM
#17
Also Blockonomics api

I suggest you have a look a moneywagon project.
Using it you can use bitcoin api, without worrying about backend service.
It will do roundrobin/random selection of service, or also can do paranoid checking to make sure balance is correct
across several services. It also supports most of the existing API services
hero member
Activity: 865
Merit: 1006
September 09, 2016, 01:37:45 AM
#16
thanks for this, i was looking for more APIs to use in my watch only bitcoin wallet. i am currently only using blockchain.info i guess i will only add blockr.io and maybe blockexplorer that should be enough.

p.s. please add all of them in the first post so we can see them all in one place.

Added!!!!
newbie
Activity: 7
Merit: 0
September 08, 2016, 02:26:32 AM
#15
thanks nice post
legendary
Activity: 1039
Merit: 2783
Bitcoin and C♯ Enthusiast
September 08, 2016, 02:12:11 AM
#14
thanks for this, i was looking for more APIs to use in my watch only bitcoin wallet. i am currently only using blockchain.info i guess i will only add blockr.io and maybe blockexplorer that should be enough.

p.s. please add all of them in the first post so we can see them all in one place.
hero member
Activity: 865
Merit: 1006
September 08, 2016, 01:44:33 AM
#13
Thanks for the information, are you planning on reviewing them all?  What are their strengths and weaknesses?  What do you use them all for?

The idea of this post is simply a compilation of APIs.
It took me long to find this information, validate, and I think it can be a good contribution to the people of the forum.
member
Activity: 119
Merit: 10
September 07, 2016, 06:13:58 PM
#12
Thanks for the information, are you planning on reviewing them all?  What are their strengths and weaknesses?  What do you use them all for?
hero member
Activity: 865
Merit: 1006
September 07, 2016, 06:06:16 PM
#11
wow, nice list i haven't searched apis this way. To lower the amount of request to some well known wallet/api services which limit request per second/hour, this could help by requesting balance check with these free api and just using those wallets api to make new address only.

Thanks!!!

It is very easy to create new address with code, for example in Python. Don't need a wallet.
legendary
Activity: 1218
Merit: 1006
September 07, 2016, 02:47:58 PM
#10
wow, nice list i haven't searched apis this way. To lower the amount of request to some well known wallet/api services which limit request per second/hour, this could help by requesting balance check with these free api and just using those wallets api to make new address only.
legendary
Activity: 3038
Merit: 1047
Your country may be your worst enemy
September 07, 2016, 02:01:41 PM
#9
Surprising! I hadn't imagine there could be so many, considering that it's so easy to create a new address, I thought few people would find it useful to watch a given one. Well, I was wrong...
Pages:
Jump to: