# RPC to query transactions?

**URL:** <https://forum.zcashcommunity.com/t/rpc-to-query-transactions/33566>\
**Category:** zcashd client\
**Created:** [May 20, 2019, 8:50pm UTC](https://forum.zcashcommunity.com/t/rpc-to-query-transactions/33566 "2019-05-20T20:50:59Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Godot](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/godot/32/13030_2.png) [@Godot](https://forum.zcashcommunity.com/u/Godot)\
**Post date:** [May 20, 2019, 8:50pm UTC](https://forum.zcashcommunity.com/t/rpc-to-query-transactions/33566/1 "2019-05-20T20:50:59Z")

</div>

Hello, i’d like to know if there’s a way to collect informations about transactions or balance of some address using the `zcash-cli` command.

For example if I try to know the balance of this address → t3gQDEavk5VzAAHK8TrQu2BWDLxEiF1unBm (a Founder’s Reward one)  
with `zcash-cli getbalance *address*`, it returns 0, but it isn’t the right value: [Accounts - Zchain](https://explorer.zcha.in/accounts/t3gQDEavk5VzAAHK8TrQu2BWDLxEiF1unBm).

As from I understood, I can only check MY address balance, generated within zcashd and not some random one.

So, is there a way to retrieve this kind of information? Are there some “hidden APIs” to query?

PS: Again, I hope I posted this in the right section 😚

---

<div class="post-metadata">

**Author:** ![garethtdavies](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/garethtdavies/32/210_2.png) [@garethtdavies](https://forum.zcashcommunity.com/u/garethtdavies)\
**Post date:** [May 20, 2019, 11:23pm UTC](https://forum.zcashcommunity.com/t/rpc-to-query-transactions/33566/2 "2019-05-20T23:23:20Z")

</div>

Check the list of RPC commands here [https://zcash-rpc.github.io/](https://zcash-rpc.github.io/) (or simply `zcash-cli --help`).

You can analyse non-wallet transactions (assuming you have `txindex=1` in your `zcash.conf` file) with `getrawtransaction` and then running `decoderawtransaction` on the result.

As for getting transactions per address use a block explorer and then analyse the individual transactions. All the information is available via the individual transactions/blocks but they are indexing the data and making it much easier to interpret.

---

<div class="post-metadata">

**Author:** ![garethtdavies](https://sea2.discourse-cdn.com/zcash/user_avatar/forum.zcashcommunity.com/garethtdavies/32/210_2.png) [@garethtdavies](https://forum.zcashcommunity.com/u/garethtdavies)\
**Post date:** [May 22, 2019, 8:04pm UTC](https://forum.zcashcommunity.com/t/rpc-to-query-transactions/33566/3 "2019-05-22T20:04:34Z")

</div>

See this WIP documentation that was just published: [source/rtd\_pages/insight\_explorer.rst · 954ac2cf4373cae408efd0838d8b468ea6018caa · zcash-docs / zcash-docs · GitLab](https://gitlab.com/zcash-docs/zcash-docs/blob/954ac2cf4373cae408efd0838d8b468ea6018caa/source/rtd_pages/insight_explorer.rst)

As noted on [other thread](https://forum.zcashcommunity.com/t/need-help-on-iquidus-based-zcash-explorer/33545/7) some Insight explorer changes are being incorporated into the main zcashd so once they are merged these RPC methods will be available if enabled. You can actually use these already though assuming you are running the Docker Insight container as that patched version of zcashd contains them.

Using your example above for the address balance. First SSH into the container:

```auto
docker exec -it zcash-explorer /bin/bash

```

Then use the `getaddressbalance` RPC method:

```auto
/home/zcashd/zcash-patched-for-explorer/src/zcash-cli getaddressbalance '{"addresses": ["t3gQDEavk5VzAAHK8TrQu2BWDLxEiF1unBm"]}'
{
  "balance": 1475000000000,
  "received": 1475000000000
}

```
