<p>This is the command I use - the http address is the address of the docker container that the Bitcoin daemon is running in</p>
<pre><code>curl --user johnsmith --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;:&quot;curltest&quot;, &quot;method&quot;: &quot;getbalance&quot;, &quot;params&quot;: [&quot;*&quot;, 6] }' -H 'content-type: text/plain;' http://10.0.0.1:18332/
</code></pre>

CC BY-SA 4.0
2021-03-08T11:21:16.667Z
2022-05-17T11:45:55.727Z
2022-05-17T11:45:55.727Z
leo_cape
<p>I have a headless Bitcoin core 0.17.1 running on Debian 10, and have created a second wallet &quot;johns-wallet&quot;.</p>
<p>I'd like to get the walletinfo (or any wallet request) of that specific wallet via curl, not the cli.</p>
<p><a href="https://bitcoin-rpc.github.io/en/doc/0.17.0/rpc/wallet/getwalletinfo/" rel="nofollow noreferrer">The Bitcoin core API reference</a> doesn't offer an example of how to target different wallets when not using the CLI (and neither did my Google search).</p>
<p>I've tried:</p>
<pre><code>curl --user johnsmith --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;:&quot;curltest&quot;, &quot;method&quot;: &quot;getwalletinfo&quot;, &quot;params&quot;: [] }' -H 'content-type: text/plain;' bitcoind:18332/wallets/johns-wallet/
</code></pre>
<p>and also</p>
<pre><code>curl --user johnsmith --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;:&quot;curltest&quot;, &quot;method&quot;: &quot;getwalletinfo&quot;, &quot;params&quot;: [&quot;/wallets/johns-wallet/&quot;] }' -H 'content-type: text/plain;' bitcoind:18332
</code></pre>
<p>And also variations on the path itself to the wallet - none of them return a result, let alone an error.</p>
<p>Running without trying to specify a wallet returns:</p>
<pre><code>{&quot;result&quot;:null,&quot;error&quot;:{&quot;code&quot;:-19,&quot;message&quot;:&quot;Wallet file not specified (must request wallet RPC through /wallet/&lt;filename&gt; uri-path).&quot;},&quot;id&quot;:&quot;curltest&quot;}
</code></pre>
<p>(In case it matters, the Bitcoind is running in a docker container, with a named volume)</p>

CC BY-SA 4.0
2020-07-07T17:25:55.713Z
Off the top of my head, the path needs to match the wallet path relative to your datadir - so `bitcoind:8332/wallets/john` only works if your wallets are actually in `$datadir/wallets/`. I might be wrong on this though
Raghav Sood
<bitcoin-core><wallet><json-rpc><wallet.dat>
How to reference different wallets with curl JSONRPC requests Bitcoin core
leo_cape
# How to reference different wallets with curl JSONRPC requests Bitcoin core

(Asked by: username_0 on 2020-07-07)

I have a headless Bitcoin core 0.17.1 running on Debian 10, and have created a second wallet "johns-wallet".

I'd like to get the walletinfo (or any wallet request) of that specific wallet via curl, not the cli.

[The Bitcoin core API reference](https://bitcoin-rpc.github.io/en/doc/0.17.0/rpc/wallet/getwalletinfo/) doesn't offer an example of how to target different wallets when not using the CLI (and neither did my Google search).

I've tried:

```
curl --user johnsmith --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": [] }' -H 'content-type: text/plain;' bitcoind:18332/wallets/johns-wallet/

```

and also

```
curl --user johnsmith --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getwalletinfo", "params": ["/wallets/johns-wallet/"] }' -H 'content-type: text/plain;' bitcoind:18332

```

And also variations on the path itself to the wallet - none of them return a result, let alone an error.

Running without trying to specify a wallet returns:

```
{"result":null,"error":{"code":-19,"message":"Wallet file not specified (must request wallet RPC through /wallet/<filename> uri-path)."},"id":"curltest"}

```

(In case it matters, the Bitcoind is running in a docker container, with a named volume)

**Tags:** bitcoin-core, wallet, json-rpc, wallet.dat

> **Comments:**
> **username_1**: Off the top of my head, the path needs to match the wallet path relative to your datadir - so `bitcoind:8332/wallets/john` only works if your wallets are actually in `$datadir/wallets/`. I might be wrong on this though  

---

## 1 answers

### Answer by username_0 on 2021-03-08. Score: 0 | Accepted answer

This is the command I use - the http address is the address of the docker container that the Bitcoin daemon is running in

```
curl --user johnsmith --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["*", 6] }' -H 'content-type: text/plain;' http://10.0.0.1:18332/

```


---

