<blockquote>
  <p>with bitcoin-cli --wallaet='foo' getbalance</p>
</blockquote>

<p>I think you're referring to the <code>-rpcwallet</code> flag.</p>

<h2>Usage</h2>

<p>The flag changes the endpoint. Try changing the url of the curl call to:</p>

<p><code>&lt;rpc-url&gt;/wallet/&lt;url-encoded-wallet-name&gt;</code></p>

<p>Example:</p>

<pre><code>curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["*", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/wallet/foo
</code></pre>

CC BY-SA 4.0
2018-10-09T19:34:38.677Z
2018-10-09T19:34:38.677Z
JBaczuk
<p>In core 0.17 they allow a user to dynamically specify wallets for things like getbalance. So with bitcoin-cli --wallaet='foo' getbalance</p>

<p>But I can't actually figure out how to do this with JSON RPC/ curl? It doesn't seem to work as a parameter or in the --data portion for curl. Can someone help point to how this gets included with an RPC or curl call? Thank you in advance.</p>

<wallet><json-rpc>
0.17 Specify Wallet with RPC/curl
noone392
# 0.17 Specify Wallet with RPC/curl

(Asked by: username_0 on 2018-10-09)

In core 0.17 they allow a user to dynamically specify wallets for things like getbalance. So with bitcoin-cli --wallaet='foo' getbalance

But I can't actually figure out how to do this with JSON RPC/ curl? It doesn't seem to work as a parameter or in the --data portion for curl. Can someone help point to how this gets included with an RPC or curl call? Thank you in advance.

**Tags:** wallet, json-rpc


---

## 1 answers

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

> with bitcoin-cli --wallaet='foo' getbalance

I think you're referring to the `-rpcwallet` flag.

## Usage

The flag changes the endpoint. Try changing the url of the curl call to:

`<rpc-url>/wallet/<url-encoded-wallet-name>`

Example:

```
curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "getbalance", "params": ["*", 6] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/wallet/foo

```


---

