# JSON from API address

**URL:** https://talk.observablehq.com/t/json-from-api-address/1780
**Category:** Uncategorized
**Created:** [March 18, 2019, 8:28pm UTC](https://talk.observablehq.com/t/json-from-api-address/1780 "2019-03-18T20:28:40Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![AskBid](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/askbid/32/1417_2.png) [@AskBid](https://talk.observablehq.com/u/AskBid)
#### Post date: [March 18, 2019, 8:28pm UTC](https://talk.observablehq.com/t/json-from-api-address/1780/1 "2019-03-18T20:28:40Z")

</div>

when I go to this [API address](https://www.bitmex.com/api/v1/trade/bucketed?binSize=1h&partial=false&count=750&symbol=XBT&reverse=true&endTime=2019-03-17T00:00:00.000Z) with my browser I can visualise the JSON file related to it.

I tried to access it by Observable using the [cors-anywhere.herokuapp.com](http://cors-anywhere.herokuapp.com) but I get a SyntaxError: Unexpected end of JSON input.

here is notebook:

> **[Json from API](https://observablehq.com/@askbid/untitled)**
>
> An Observable notebook by askbid.

Any chance to make it work?

Thanks

---

<div class="post-metadata">

### Author: ![bgchen](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/bgchen/32/784_2.png) [@bgchen](https://talk.observablehq.com/u/bgchen)
#### Post date: [March 18, 2019, 8:57pm UTC](https://talk.observablehq.com/t/json-from-api-address/1780/2 "2019-03-18T20:57:58Z")

</div>

I found [a comment on SO](https://stackoverflow.com/questions/54410300/access-to-fetch-blocked-has-been-blocked-by-cors-policy#comment95634050_54410300) which indicates that the bitmex API endpoint you’re targeting “seems to be purposefully blocking requests from frontend JavaScript code”.

The [comment afterwards](https://stackoverflow.com/questions/54410300/access-to-fetch-blocked-has-been-blocked-by-cors-policy#comment95634075_54410300) suggests some solutions, including setting up [this proxy](https://github.com/BitMEX/bitmex-local-proxy) on a server you control.

---

<div class="post-metadata">

### Author: ![mootari](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.observablehq.com/mootari/32/581_2.png) [@mootari](https://talk.observablehq.com/u/mootari)
#### Post date: [March 19, 2019, 7:27pm UTC](https://talk.observablehq.com/t/json-from-api-address/1780/3 "2019-03-19T19:27:35Z")

</div>

Perhaps you can hack together a proxy on [glitch.com](http://glitch.com): [https://glitch.com/search?q=proxy](https://glitch.com/search?q=proxy)
