# Blockchain API? (fetch ada balance)

**URL:** <https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039>\
**Category:** Developers\
**Created:** [27 March 2018 01:39 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039 "2018-03-27T01:39:48Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![pulse](https://avatars.discourse-cdn.com/v4/letter/p/87869e/32.png) [@pulse](https://forum.cardano.org/u/pulse)\
**Post date:** [27 March 2018 01:39 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/1 "2018-03-27T01:39:48Z")

</div>

I’d like to make a little script to keep track of my ADA.  
Poke an API, with my address as an argument, and it would list my balance. Something like that.  
The only thing I’ve found was [https://cardanodocs.com/technical/wallet/api/v1/](https://cardanodocs.com/technical/wallet/api/v1/) and it seems I can only interact with a local running deadalus wallet, but my web linux box does not have access to my wallet box.  
I then tried to parse pages on [https://cardanoexplorer.com/](https://cardanoexplorer.com/) but they have a browser validator so I didn’t continue forcefully 🙂  
Anyone could point me in the right direction as to how to accomplish this?  
Thank you,

---

<div class="post-metadata">

**Author:** ![pulse](https://avatars.discourse-cdn.com/v4/letter/p/87869e/32.png) [@pulse](https://forum.cardano.org/u/pulse)\
**Post date:** [27 March 2018 01:53 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/2 "2018-03-27T01:53:04Z")

</div>

I think cardano-sl is what I need.

> <https://github.com/input-output-hk/cardano-sl/blob/master/docs/how-to/build-cardano-sl-and-daedalus-from-source-code.md>

---

<div class="post-metadata">

**Author:** ![RobJF](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/robjf/32/8069_2.png) [@RobJF](https://forum.cardano.org/u/RobJF)\
**Post date:** [27 March 2018 09:11 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/3 "2018-03-27T09:11:23Z")

</div>

Don’t know whether [https://adatracker.com/](https://adatracker.com/) will do what you want or not (browser validator?) but if so I guess it would be easier than the cardano-sl route! 😁

---

<div class="post-metadata">

**Author:** ![FairCopy](https://avatars.discourse-cdn.com/v4/letter/f/a587f6/32.png) [@FairCopy](https://forum.cardano.org/u/FairCopy)\
**Post date:** [27 March 2018 11:51 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/4 "2018-03-27T11:51:08Z")

</div>

Yep. You can use [https://cardanoexplorer.com/](https://cardanoexplorer.com/) if you don’t want to deploy your own instance of cardano-sl. There’s a JSON API for the Explorer. I don’t know if there’s documentation on it, but [here’s the source](https://github.com/input-output-hk/cardano-sl/blob/master/explorer/frontend/src/Explorer/Api/Http.purs).

To query balance of an address:

```auto
curl -s "https://cardanoexplorer.com/api/addresses/summary/$address" |
python3 -c "import sys, json; print(float(json.load(sys.stdin)['Right']['caBalance']['getCoin'])/1000000)"

```

---

<div class="post-metadata">

**Author:** ![pip010](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/pip010/32/1940_2.png) [@pip010](https://forum.cardano.org/u/pip010)\
**Post date:** [31 March 2018 11:43 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/5 "2018-03-31T11:43:59Z")

</div>

LOL literally this like the 4th different place of instruction … PLease can we have only 1 … this is crazy …

---

<div class="post-metadata">

**Author:** ![HazelMazel3](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/hazelmazel3/32/2910_2.png) [@HazelMazel3](https://forum.cardano.org/u/HazelMazel3)\
**Post date:** [31 March 2018 15:44 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/6 "2018-03-31T15:44:39Z")

</div>

Is this even possible? Every time you make a transaction, it sends the balance to a newly generated address - right?

So you could do it, but you would have to type your address in everytime, because the address changed.

I say this because I was going to make an app (I write apps) that could show me my ADA balance on my phone (I get payments from people so it does change every day), however as soon as I started thinking about it, I hit this issue.

---

<div class="post-metadata">

**Author:** ![vantuz-subhuman](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vantuz-subhuman/32/3976_2.png) [@vantuz-subhuman](https://forum.cardano.org/u/vantuz-subhuman)\
**Post date:** [31 March 2018 15:57 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/7 "2018-03-31T15:57:53Z")

</div>

> [@HazelMazel3](#):
>
> Is this even possible? Every time you make a transaction, it sends the balance to a newly generated address - right?

Yup, imo, you have to know the root of HD wallet in order to be able to find all the derivative addresses, at least that’s how Daedalus does it. So if you want to track all your addresses - your app has to deal with seeds =\

---

<div class="post-metadata">

**Author:** ![RobJF](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/robjf/32/8069_2.png) [@RobJF](https://forum.cardano.org/u/RobJF)\
**Post date:** [31 March 2018 15:58 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/8 "2018-03-31T15:58:52Z")

</div>

The receive address does not change unless you request a new one.

---

<div class="post-metadata">

**Author:** ![vantuz-subhuman](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vantuz-subhuman/32/3976_2.png) [@vantuz-subhuman](https://forum.cardano.org/u/vantuz-subhuman)\
**Post date:** [31 March 2018 16:01 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/9 "2018-03-31T16:01:35Z")

</div>

> [@RobJF](#):
>
> The receive address does not change unless you request a new one.

That’s right, but if you send ADA, then all the change goes to another address. So tracking a single address only shows you full balance if you have no outgoing transaction.

---

<div class="post-metadata">

**Author:** ![RobJF](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/robjf/32/8069_2.png) [@RobJF](https://forum.cardano.org/u/RobJF)\
**Post date:** [31 March 2018 16:04 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/10 "2018-03-31T16:04:16Z")

</div>

Thanks Vantuz, I did not know that. Never sent any ADA! 🙂

---

<div class="post-metadata">

**Author:** ![vantuz-subhuman](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vantuz-subhuman/32/3976_2.png) [@vantuz-subhuman](https://forum.cardano.org/u/vantuz-subhuman)\
**Post date:** [31 March 2018 16:09 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/11 "2018-03-31T16:09:06Z")

</div>

> [@HazelMazel3](#):
>
> I say this because I was going to make an app (I write apps) that could show me my ADA balance on my phone (I get payments from people so it does change every day), however as soon as I started thinking about it, I hit this issue.

UTxO is designed in such a way so separate addresses would not make much sense, and only a wallet allows owner to know that all the addresses are connected. I think the only way is to design a full-wallet app, which might be tricky as hell. So the best solution would be to wait for an official Daedalus for mobile platforms 🙂

---

<div class="post-metadata">

**Author:** ![vantuz-subhuman](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/vantuz-subhuman/32/3976_2.png) [@vantuz-subhuman](https://forum.cardano.org/u/vantuz-subhuman)\
**Post date:** [31 March 2018 16:15 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/12 "2018-03-31T16:15:09Z")

</div>

> [@RobJF](#):
>
> Thanks Vantuz, I did not know that. Never sent any ADA! 🙂

Yup, that kinda annoyed me at the beginning that I can’t chose where change is gonna go, cuz I also like to use explorers, and open wallet only when I need to make a transaction, but each outgoing transaction turned my wallet into a garland of addresses. But eh, whatcha gonna do `¯\_(ツ)_/¯`

---

<div class="post-metadata">

**Author:** ![HazelMazel3](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/hazelmazel3/32/2910_2.png) [@HazelMazel3](https://forum.cardano.org/u/HazelMazel3)\
**Post date:** [2 April 2018 20:23 UTC](https://forum.cardano.org/t/blockchain-api-fetch-ada-balance/10039/13 "2018-04-02T20:23:20Z")

</div>

> [@vantuz-subhuman](#):
>
> only a wallet allows owner to know that all the addresses are connected

Yea, that is the conclusion I came to… so too hard. lol.
