Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: felixyz on October 23, 2016, 04:03:59 PM



Title: Bitcoin api
Post by: felixyz on October 23, 2016, 04:03:59 PM
Simple thing, but I cannot find a proper source - I want to get address but presented in btc not satoshi like eg blockchain gives with q/addressbalance/address


Title: Re: Bitcoin api
Post by: franky1 on October 23, 2016, 04:41:12 PM
Simple thing, but I cannot find a proper source - I want to get address but presented in btc not satoshi like eg blockchain gives with q/addressbalance/address

if you can see it in satoshi's just divide by 100,000,000


Title: Re: Bitcoin api
Post by: felixyz on October 23, 2016, 04:53:40 PM
Yes, but I'm forced to display it directly from given api, with no calculations.


Title: Re: Bitcoin api
Post by: OmegaStarScream on October 23, 2016, 05:09:03 PM
Blockr API should do the job for you , check the "Address balance" part : https://blockr.io/documentation/api
It's also possible to check different addresses balance at one time : http://btc.blockr.io/api/v1/address/balance/198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi,1L8meqhMTRpxasdGt8DHSJfscxgHHzvPgk .


Title: Re: Bitcoin api
Post by: felixyz on October 23, 2016, 05:17:58 PM
Blockr API should do the job for you , check the "Address balance" part : https://blockr.io/documentation/api
It's also possible to check different addresses balance at one time : http://btc.blockr.io/api/v1/address/balance/198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi,1L8meqhMTRpxasdGt8DHSJfscxgHHzvPgk .

Looks better, can I add any parameters to it to return only balance?


Title: Re: Bitcoin api
Post by: OmegaStarScream on October 23, 2016, 05:40:00 PM
Blockr API should do the job for you , check the "Address balance" part : https://blockr.io/documentation/api
It's also possible to check different addresses balance at one time : http://btc.blockr.io/api/v1/address/balance/198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi,1L8meqhMTRpxasdGt8DHSJfscxgHHzvPgk .

Looks better, can I add any parameters to it to return only balance?

I don't think so , the only optional parameter you could add or remove is "confirmations"  as far as I know. It shouldn't be that hard to do (programmatically) If you have some programming knowledge though.


Title: Re: Bitcoin api
Post by: felixyz on October 23, 2016, 07:05:03 PM
There should be another source - on one page I found api of many coins besides btc, but no other configurable api for such a coin?


Title: Re: Bitcoin api
Post by: felixyz on October 24, 2016, 10:42:47 AM
Any ideas?


Title: Re: Bitcoin api
Post by: OmegaStarScream on October 24, 2016, 10:58:05 AM
There should be another source - on one page I found api of many coins besides btc, but no other configurable api for such a coin?
e

I checked every (or almost every) service that have a Bitcoin API and Blockr (what I linked above) is probably the only one that gives the results in BTC and not in Satoshis so If you search a service where It only gives you the balance , you may find one .. but It will be probably in Satoshi so I guess you won't be anything that works for you 100% , instead you should do it programmatically


Title: Re: Bitcoin api
Post by: Coding Enthusiast on October 24, 2016, 11:58:36 AM
Maybe tell us about what exactly you are trying to do so we can help you better.

If it is only a matter of showing it in "bitcoin" instead of "satoshi" you can just change the format of your data right before showing it (in your interface).

There should be another source - on one page I found api of many coins besides btc, but no other configurable api for such a coin?

In the link OmegaStarScream gave, you should go to "Address balance" section (use Ctrl+F to find it) and here is the link to an example:
https://btc.blockr.io/api/v1/address/balance/198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi
response:
Code:
{"status":"success","data":{"address":"198aMn6ZYAczwrE5NvNTUMyJ5qkfy4g3Hi","balance":8000.00236957,"balance_multisig":0},"code":200,"message":""}
now deserialize this JSON and get the balance key which is in bitcoin not satoshi.


Title: Re: Bitcoin api
Post by: fiomcorka on October 25, 2016, 01:41:32 PM
Simple thing, but I cannot find a proper source - I want to get address but presented in btc not satoshi like eg blockchain gives with q/addressbalance/address

if you can see it in satoshi's just divide by 100,000,000
As simple as that. OP everything has been made clear to you, no point asking for more question or clarification. Take it or leave but if i am wrong the forum members who know better can correct me. Hope I am making sense.