<p>As others have said you can use <code>https://blockstream.info/api/address/bc1qgsmfaz22lzy08wqjspd8xtm43hal5tgz4hyac6</code> for the JSON - the doc is in reference to running a local instance - the exact endpoint is depending on deployment, the default deployment we use has nginx forward <code>/api/</code> requests to electrs without the <code>api</code> bit <a href="https://github.com/Blockstream/esplora/blob/master/contrib/nginx.conf.in#L32" rel="noreferrer">https://github.com/Blockstream/esplora/blob/master/contrib/nginx.conf.in#L32</a> but it depends on how people want to deploy it.</p>

<p>We should probably mention this in the API.md file to avoid confusion</p>

CC BY-SA 4.0
2019-11-18T18:07:25.377Z
2019-11-18T18:07:25.377Z
Lawrence Nahum
<p>I have a bitcoin address and I want to get the JSON format of the balance using blockstreams api service. </p>

<p>It's this one: <a href="https://github.com/Blockstream/esplora/blob/master/API.md#transaction-format" rel="nofollow noreferrer">https://github.com/Blockstream/esplora/blob/master/API.md#transaction-format</a></p>

<p>It's not clear on what I need to put in the URL. I tried: </p>

<blockquote>
  <p><a href="https://blockstream.info/address/:bc1xxxxxxx" rel="nofollow noreferrer">https://blockstream.info/address/:bc1xxxxxxx</a></p>
</blockquote>

<p>and it doesn't work. </p>

CC BY-SA 4.0
2019-11-18T17:33:43.780Z
I think you're confused about two things. The API needs a "/api" in the URL, and the colon indicates a value to be replaced, not a literal. For example https://blockstream.info/api/address/bc1qgsmfaz22lzy08wqjspd8xtm43hal5tgz4hyac6 works.
Pieter Wuille
CC BY-SA 4.0
2019-11-18T17:52:45.880Z
yes that works. it doesn't say anywhere on that docs that I had to add api after the domain name. thanks!
Patoshi パトシ
<api><blockstream><esplora>
How to use blockstream's REST api to retrieve JSON output on an address?
Patoshi パトシ
# How to use blockstream's REST api to retrieve JSON output on an address?

(Asked by: username_0 on 2019-11-18)

I have a bitcoin address and I want to get the JSON format of the balance using blockstreams api service.

It's this one: <https://github.com/Blockstream/esplora/blob/master/API.md#transaction-format>

It's not clear on what I need to put in the URL. I tried:

> <https://blockstream.info/address/:bc1xxxxxxx>

and it doesn't work.

**Tags:** api, blockstream, esplora

> **Comments:**
> **username_1**: I think you're confused about two things. The API needs a "/api" in the URL, and the colon indicates a value to be replaced, not a literal. For example https://blockstream.info/api/address/bc1qgsmfaz22lzy08wqjspd8xtm43hal5tgz4hyac6 works.  
> **username_0**: yes that works. it doesn't say anywhere on that docs that I had to add api after the domain name. thanks!  

---

## 1 answers

### Answer by username_2 on 2019-11-18. Score: 5 | Accepted answer

As others have said you can use `https://blockstream.info/api/address/bc1qgsmfaz22lzy08wqjspd8xtm43hal5tgz4hyac6` for the JSON - the doc is in reference to running a local instance - the exact endpoint is depending on deployment, the default deployment we use has nginx forward `/api/` requests to electrs without the `api` bit <https://github.com/Blockstream/esplora/blob/master/contrib/nginx.conf.in#L32> but it depends on how people want to deploy it.

We should probably mention this in the API.md file to avoid confusion


---

