<p>In order to get the list unspent of a specific bitcoin address( not belongs to your wallet), you must first import the address to wallet using <strong><a href="https://bitcoin.org/en/developer-reference#importaddress" rel="nofollow noreferrer">importaddress</a></strong>
 This RPC does not require the private key of that address. Note that this will cause the program to rescan the entire blockchain, which will take several minutes.</p>

<p>now you can use the listunspent call to get the UTXO. </p>

<p>Edit: use rescan : true if you are importing already existing address</p>

CC BY-SA 4.0
2020-05-09T00:44:35.113Z
I tried this but didnt work. I get an empty result array when I run listunspent rpc call
Joseph Akayesi
CC BY-SA 4.0
2020-05-10T02:02:06.440Z
Do you imported the address?
Akshay Dev
CC BY-SA 4.0
2020-05-10T06:07:53.007Z
Yes I did. 
What happens is when I importeadress I get this response
```{
  result: null,
  error: null,
  id: 'd542c95d-ad8f-4a8e-b92f-6a69fa051e9d'
}
```

And then when I try to listunsent I get 
```{ result: [], error: null, id: '460bdaa4-5209-4dc8-ba76-582e3e0cc0e4' }```
Joseph Akayesi
CC BY-SA 4.0
2020-05-11T12:08:34.060Z
hi @JosephAkayesi, The response is totally fine. you should enable rescan option if the address already have some unspents.  eg:bitcoin-cli importaddress "myaddress" "testing" true. You can reffer here : https://bitcoin.org/en/developer-reference#importaddress
Akshay Dev
CC BY-SA 4.0
2020-05-12T13:10:39.033Z
Wow. I read that rescans can take forever. For my use case I need to be able to read unspent values in less than at least 10 secs
Joseph Akayesi
CC BY-SA 4.0
2020-05-13T09:15:40.150Z
Even after using rescan option I still get the same result. Do you have any idea where I can find the bitcoin.conf that is ideal for a bitcoin exchange applicatiom
Joseph Akayesi
CC BY-SA 4.0
2018-10-09T11:34:23.727Z
2020-05-13T14:09:32.970Z
2020-05-13T14:09:32.970Z
Akshay Dev
<p>As mentioned <a href="https://chainquery.com/bitcoin-api/listunspent" rel="nofollow noreferrer">here</a>, you can first get the addresses of an account using <code>getaddressesbyaccount</code> and then list all the unspent of those addresses using </p>

<pre><code>bitcoin-cli listunspent 6 9999999 "[\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\",\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\"]"  
</code></pre>

<p>where 6 and 9999999 are the <code>min</code> and <code>max</code> confirmations</p>

CC BY-SA 3.0
2017-10-31T06:40:03.957Z
OP is asking about arbitrary addresses, not just those in his wallet.
Pieter Wuille
CC BY-SA 3.0
2017-11-03T07:04:54.003Z
oh.. my mistake :)   
hope this might help people who are looking to get unspent from the wallet addresses.
RealSteel
CC BY-SA 3.0
2017-10-31T04:22:46.310Z
2017-10-31T04:22:46.310Z
RealSteel
<p>I have written a program that allows you to search for any address whether it belongs to your wallet or not, in Python3.</p>
<p>Here is the github link:</p>
<p><a href="https://github.com/ORP967/Bitcoin_Core_RPC_par_address" rel="nofollow noreferrer">https://github.com/ORP967/Bitcoin_Core_RPC_par_address</a></p>
<p>Let me know if you guys have any improvements that can be made to it.</p>

CC BY-SA 4.0
2022-01-23T22:40:17.140Z
2022-01-23T22:40:17.140Z
ORP967
<p>Assuming the addresses are in your wallet, you're looking for <code>listreceivedbyaddress</code>. That will give you back this:</p>
<blockquote>
<p>Returns an array of objects containing:</p>
<ul>
<li>&quot;address&quot; : receiving address</li>
<li>&quot;account&quot; : the account of the receiving address</li>
<li>&quot;amount&quot; : total amount received by the address</li>
<li>&quot;confirmations&quot; : number of confirmations of the most recent transaction included</li>
<li>&quot;txids&quot; : a list of transaction IDs that you can pass to <code>gettransaction</code> in order to see the full transaction.</li>
</ul>
</blockquote>
<p><a href="https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list" rel="nofollow noreferrer">(Source.)</a></p>

CC BY-SA 3.0
2015-04-27T17:54:26.193Z
Yup, But if i want to get unspents of an address which is not a part of my wallet ? than what function should i use ? @Nick
Hassan Mehmood
CC BY-SA 3.0
2015-04-27T18:22:13.257Z
@HassanMehmood Doesn't exist. Use bitcoin-abe or electrum server or blockchain.info instead.
Nick ODell
CC BY-SA 3.0
2015-04-29T15:31:03.967Z
Hey, from answers, I added one my multisig add using this command "addmultisigaddress". and sent some satoshis to this address. but I am still getting empty list after calling :listunspent" ???
Hassan Mehmood
CC BY-SA 3.0
2015-04-29T18:21:53.380Z
@HassanMehmood You need to rerun with rescan. http://bitcoin.stackexchange.com/questions/22199/what-exactly-did-bitcoin-qt-rescan-reindex-do/22224#22224
Nick ODell
CC BY-SA 3.0
2015-04-29T18:59:09.940Z
I did rerun with rescan, but still getting empty list.. @Nick
Hassan Mehmood
CC BY-SA 3.0
2015-04-29T19:04:07.413Z
@HassanMehmood Are there any unspents at that address? Has the rescan finished?
Nick ODell
CC BY-SA 3.0
2015-04-29T19:14:54.237Z
Yup, There are some unspents, This is the address "31zeoskE8zeyQARFEVzwJzsp7GQpLn5zhF"
and I started the server using
bitcoind.exe -daemon -rescan -debugnet -printtoconsole
Hassan Mehmood
CC BY-SA 3.0
2015-04-29T19:20:13.383Z
And Yes i think the rescan is finished!
Hassan Mehmood
CC BY-SA 3.0
2015-04-29T19:20:40.700Z
but still getting empty list. :/
Hassan Mehmood
CC BY-SA 3.0
2015-04-29T19:37:28.250Z
Now I sent some btc to one of other addresses that are showing me while running command "getaddressesbyaccount". and after that i run the cmd "listunspent 0" so it shows that transaction.

But after that I again send some btc to my mulisig address which I have added using addmultisigadress cmd. But listunspent not showing any unspent related to multisig ? Why ?
Hassan Mehmood
CC BY-SA 3.0
2017-10-31T06:39:18.130Z
addmultisigaddress is not enough to make the wallet treat the address as its own; you also need to have all of the private keys. If you want to treat an address as yours regardless of keys, use importaddress.
Pieter Wuille
CC BY-SA 3.0
2015-04-27T17:30:00.830Z
2015-04-27T17:30:00.830Z
2020-06-16T11:10:03.350Z
Nick ODell
<p>Other options, beyond what Nick mentioned, are to either use the toshi.io API:</p>

<p><a href="https://toshi.io/docs/#get-address-unspent-outputs" rel="nofollow">toshi.io - API - utxo's for address</a></p>

<p>Or run your own toshi node:</p>

<p><a href="https://toshi.io/" rel="nofollow">toshi.io</a></p>

CC BY-SA 3.0
2015-04-29T07:57:18.963Z
https://chain.com is also very good and easy to use! but i was trying not to use any 3rd party APIs.
Hassan Mehmood
CC BY-SA 3.0
2015-04-30T22:17:11.687Z
@HassanMehmood if running the toshi node locally isn't something you want either (it consumes well over 200GB of space) then you could run bitcoin core with txindex enabled. You'd then have to parse the blockchain and build and keep up a database of utxo yourself. As others have pointed out, if you just want a bitcoin-cli argument for this, it doesn't exist.
Robert McCone
CC BY-SA 3.0
2015-04-29T01:25:21.030Z
2015-04-29T01:25:21.030Z
Robert McCone
<p>Unspent data appears in <strong>Unspent List</strong> only after SIX confirmations. <br></p>

<p>Try this command,</p>

<pre><code>bitcoin-cli -regtest listunspent "some bitcoin address" 0
</code></pre>

<p>It will show all the unspent transactions.</p>

CC BY-SA 3.0
2015-04-29T17:40:09.903Z
I am running the same command but getting empty list in response. I first generated and added a multisig address using "addultisigaddress" command and call listunspent. But in result i always get an empty list though I sent some satoshis to this address 2 times
Hassan Mehmood
CC BY-SA 3.0
2015-04-28T18:04:54.543Z
2015-04-28T18:04:54.543Z
moshaholo
<p><code>listunspent</code> only displays information about addresses which are currently part of your wallet. Bitcoin Core does not maintain indexes of unspent outputs for addresses you do not own, and will simply return a blank set if you attempt to query for them. </p>

CC BY-SA 4.0
2022-06-16T19:46:25.673Z
Does `txindex=1` help in any way for `listunspent`?
Jus12
CC BY-SA 3.0
2015-04-27T15:57:34.943Z
2015-04-27T15:57:34.943Z
Claris
<p>I want to access unspent data of a specific bitcoin address.</p>

<p>I am trying this command</p>

<p>bitcoin-cli -regtest listunspent "some bitcoin address"</p>

<p>But I am always getting an empty list. I am using local bitcoind server on windows 7.</p>

<p>What should I do or use any function for getting desired output ? </p>

<bitcoind><bitcoin-core><client>
How to get unspents for a specified bitcoin address?
Hassan Mehmood
# How to get unspents for a specified bitcoin address?

(Asked by: username_0 on 2015-04-27)

I want to access unspent data of a specific bitcoin address.

I am trying this command

bitcoin-cli -regtest listunspent "some bitcoin address"

But I am always getting an empty list. I am using local bitcoind server on windows 7.

What should I do or use any function for getting desired output ?

**Tags:** bitcoind, bitcoin-core, client


---

## 7 answers

### Answer by username_9 on 2015-04-27. Score: 10 | Accepted answer

`listunspent` only displays information about addresses which are currently part of your wallet. Bitcoin Core does not maintain indexes of unspent outputs for addresses you do not own, and will simply return a blank set if you attempt to query for them.

> **Comments:**
> **username_10**: Does `txindex=1` help in any way for `listunspent`?  

---

### Answer by username_1 on 2018-10-09. Score: 3

In order to get the list unspent of a specific bitcoin address( not belongs to your wallet), you must first import the address to wallet using **[importaddress](https://bitcoin.org/en/developer-reference#importaddress)**
This RPC does not require the private key of that address. Note that this will cause the program to rescan the entire blockchain, which will take several minutes.

now you can use the listunspent call to get the UTXO.

Edit: use rescan : true if you are importing already existing address

> **Comments:**
> **username_2**: I tried this but didnt work. I get an empty result array when I run listunspent rpc call  
> **username_1**: Do you imported the address?  
> **username_2**: Yes I did.  What happens is when I importeadress I get this response ```{   result: null,   error: null,   id: 'd542c95d-ad8f-4a8e-b92f-6a69fa051e9d' } ```  And then when I try to listunsent I get  ```{ result: [], error: null, id: '460bdaa4-5209-4dc8-ba76-582e3e0cc0e4' }```  
> **username_1**: hi @JosephAkayesi, The response is totally fine. you should enable rescan option if the address already have some unspents.  eg:bitcoin-cli importaddress "myaddress" "testing" true. You can reffer here : https://bitcoin.org/en/developer-reference#importaddress  
> **username_2**: Wow. I read that rescans can take forever. For my use case I need to be able to read unspent values in less than at least 10 secs  
> **username_2**: Even after using rescan option I still get the same result. Do you have any idea where I can find the bitcoin.conf that is ideal for a bitcoin exchange applicatiom  

---

### Answer by username_3 on 2017-10-31. Score: 2

As mentioned here, you can first get the addresses of an account using getaddressesbyaccount and then list all the unspent of those addresses using 
bitcoin-cli listunspent 6 9999999 "[\"1PGFqEzfmQch1gKD3ra4k18PNj3tTUUSqg\",\"1LtvqCaApEdUGFkpKMM4MstjcaL4dKg8SP\"]"  

where 6 and 9999999 are the min and max confirmations

> **Comments:**
> **username_4**: OP is asking about arbitrary addresses, not just those in his wallet.  
> **username_3**: oh.. my mistake :)    hope this might help people who are looking to get unspent from the wallet addresses.  

---

### Answer by username_5 on 2022-01-23. Score: 1

I have written a program that allows you to search for any address whether it belongs to your wallet or not, in Python3.

Here is the github link:

<https://github.com/username_5/Bitcoin_Core_RPC_par_address>

Let me know if you guys have any improvements that can be made to it.


---

### Answer by username_6 on 2015-04-27. Score: 0

Assuming the addresses are in your wallet, you're looking for `listreceivedbyaddress`. That will give you back this:

> Returns an array of objects containing:
>
> * "address" : receiving address
> * "account" : the account of the receiving address
> * "amount" : total amount received by the address
> * "confirmations" : number of confirmations of the most recent transaction included
> * "txids" : a list of transaction IDs that you can pass to `gettransaction` in order to see the full transaction.

[(Source.)](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list)

> **Comments:**
> **username_0**: Yup, But if i want to get unspents of an address which is not a part of my wallet ? than what function should i use ? @Nick  
> **username_6**: @HassanMehmood Doesn't exist. Use bitcoin-abe or electrum server or blockchain.info instead.  
> **username_0**: Hey, from answers, I added one my multisig add using this command "addmultisigaddress". and sent some satoshis to this address. but I am still getting empty list after calling :listunspent" ???  
> **username_6**: @HassanMehmood You need to rerun with rescan. http://bitcoin.stackexchange.com/questions/22199/what-exactly-did-bitcoin-qt-rescan-reindex-do/22224#22224  
> **username_0**: I did rerun with rescan, but still getting empty list.. @Nick  
> **username_6**: @HassanMehmood Are there any unspents at that address? Has the rescan finished?  
> **username_0**: Yup, There are some unspents, This is the address "31zeoskE8zeyQARFEVzwJzsp7GQpLn5zhF" and I started the server using bitcoind.exe -daemon -rescan -debugnet -printtoconsole  
> **username_0**: And Yes i think the rescan is finished!  
> **username_0**: but still getting empty list. :/  
> **username_0**: Now I sent some btc to one of other addresses that are showing me while running command "getaddressesbyaccount". and after that i run the cmd "listunspent 0" so it shows that transaction.  But after that I again send some btc to my mulisig address which I have added using addmultisigadress cmd. But listunspent not showing any unspent related to multisig ? Why ?  
> **username_4**: addmultisigaddress is not enough to make the wallet treat the address as its own; you also need to have all of the private keys. If you want to treat an address as yours regardless of keys, use importaddress.  

---

### Answer by username_7 on 2015-04-29. Score: 0

Other options, beyond what Nick mentioned, are to either use the toshi.io API:

[toshi.io - API - utxo's for address](https://toshi.io/docs/#get-address-unspent-outputs)

Or run your own toshi node:

[toshi.io](https://toshi.io/)

> **Comments:**
> **username_0**: https://chain.com is also very good and easy to use! but i was trying not to use any 3rd party APIs.  
> **username_7**: @HassanMehmood if running the toshi node locally isn't something you want either (it consumes well over 200GB of space) then you could run bitcoin core with txindex enabled. You'd then have to parse the blockchain and build and keep up a database of utxo yourself. As others have pointed out, if you just want a bitcoin-cli argument for this, it doesn't exist.  

---

### Answer by username_8 on 2015-04-28. Score: 0

Unspent data appears in Unspent List only after SIX confirmations. 
Try this command,
bitcoin-cli -regtest listunspent "some bitcoin address" 0

It will show all the unspent transactions.

> **Comments:**
> **username_0**: I am running the same command but getting empty list in response. I first generated and added a multisig address using "addultisigaddress" command and call listunspent. But in result i always get an empty list though I sent some satoshis to this address 2 times  

---

