# How to make a simple query of what tokens I have in my wallet from cardano-cli?

**URL:** <https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682>\
**Category:** Misc Dev Talk\
**Created:** [31 March 2022 19:48 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682 "2022-03-31T19:48:45Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Ramiro](https://forum.cardano.org/u/Ramiro)\
**Post date:** [31 March 2022 19:48 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/1 "2022-03-31T19:48:45Z")

</div>

How to make a simple query of what tokens I have in my wallet from cardano-cli?

Thanks

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [31 March 2022 19:54 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/2 "2022-03-31T19:54:02Z")

</div>

`cardano-cli` itself has no concept of wallet.

You can ask what currently is at a single address with `cardano-cli query utxo --mainnet --address addr1…`.

But getting all addresses of your wallet would be a task for `cardano-wallet` and/or `cardano-address`.

---

<div class="post-metadata">

**Author:** ![Ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Ramiro](https://forum.cardano.org/u/Ramiro)\
**Post date:** [31 March 2022 19:56 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/3 "2022-03-31T19:56:07Z")

</div>

Thanks for your answer, at the moment I am just testing and I would like to be able to check the balance of adas of my wallet by terminal. Should I use cardano-wallet?

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [31 March 2022 20:01 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/4 "2022-03-31T20:01:56Z")

</div>

Haven’t used them myself, but my thoughts would be:

`cardano-wallet` is running as a server. I somehow don’t like that. If I’m using CLI, I want to have it small and simple. That’s why I’m using CLI.

So, I’d rather look at `cardano-address`. I’m not aware of a good tutorial for that, though.  
[https://github.com/input-output-hk/cardano-addresses](https://github.com/input-output-hk/cardano-addresses) might get you started.

---

<div class="post-metadata">

**Author:** ![Ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Ramiro](https://forum.cardano.org/u/Ramiro)\
**Post date:** [31 March 2022 20:05 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/5 "2022-03-31T20:05:46Z")

</div>

thanks for your help

---

<div class="post-metadata">

**Author:** ![HeptaSean](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/heptasean/32/82306_2.png) [@HeptaSean](https://forum.cardano.org/u/HeptaSean)\
**Post date:** [31 March 2022 20:13 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/6 "2022-03-31T20:13:28Z")

</div>

Feel free to ask more specific if you are stuck somewhere.

---

<div class="post-metadata">

**Author:** ![jf3110](https://sea1.discourse-cdn.com/flex023/user_avatar/forum.cardano.org/jf3110/32/32352_2.png) [@jf3110](https://forum.cardano.org/u/jf3110)\
**Post date:** [31 March 2022 21:41 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/7 "2022-03-31T21:41:15Z")

</div>

I suggest trying [stakepool\_python\_tools/balance.py at main · Josef3110/stakepool\_python\_tools · GitHub](https://github.com/Josef3110/stakepool_python_tools/blob/main/scripts/balance.py) which is a wrapper around cardano-cli in python.

It does not take digits definition into account but works pretty nice.

---

<div class="post-metadata">

**Author:** ![Ramiro](https://avatars.discourse-cdn.com/v4/letter/r/258eb7/32.png) [@Ramiro](https://forum.cardano.org/u/Ramiro)\
**Post date:** [31 March 2022 22:23 UTC](https://forum.cardano.org/t/how-to-make-a-simple-query-of-what-tokens-i-have-in-my-wallet-from-cardano-cli/98682/8 "2022-03-31T22:23:47Z")

</div>

Thanks for your answer, I finally found this shortcut in pool.pm and made the following script to query revenue [https://pool.pm/wallet/$Address](https://pool.pm/wallet/%24Address)

```auto
import os
import json
from time import sleep

while(True):
    wallet = os.popen("curl https://pool.pm/wallet/$Address").read()
    json_final = round(json.loads(wallet)["lovelaces"]/1000000,2)
    print(f"En la cuenta hay {json_final} adas")
    print("Dormiremos 60 segundos antes de volver a consultar")
    sleep(60)

```

Later I will look carefully at what you sent me that seems very interesting
