2

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.

  • 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 blockstream.info/api/address/… works. – Pieter Wuille Nov 18 '19 at 17:33
  • yes that works. it doesn't say anywhere on that docs that I had to add api after the domain name. thanks! – Patoshi パトシ Nov 18 '19 at 17:52
4

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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.