<p>Basically Mtgox's api sucks. It's not your fault, its theirs. It's almost impossible to programmatically get a good reading of their order book. <code>socket.io</code> only works about 20% of the time and the <code>http</code> api often gives just wrong information. </p>

<p>To get around this I have several server instances constantly reconnecting an disconnecting until a successful steam is established and then it reports back to me until it fails. The idea is to always have at least one working stream. </p>

<p>I realize this can be incredibly impractical so you may want to use a service like <a href="http://bitcoincharts.com/" rel="nofollow">bitcoin charts</a> which has their own api, but if you need data more then every 15 min you will either have to pay or come up with some round about solution. </p>

<p><a href="https://bitcointalk.org/index.php?topic=285578.0;topicseen" rel="nofollow">Here's</a> some other people complaining about the same thing. One suggests using <code>websockets</code> and claims that he's had more success.</p>

CC BY-SA 3.0
2013-09-19T15:21:14.120Z
2013-09-19T17:22:49.017Z
2013-09-19T17:22:49.017Z
Loourr
<p>MtGox Streaming API is down or is something wrong with the code.</p>

<p>I used this example https:// bitbucket.org/nitrous/mtgox-api/src/004c254993963baeb239ac7ac7f676b5024fc93f/socket/ws.client.html?at=master</p>

<p>You can see the example here <a href="http://atc.leadsoft.eu/test.html" rel="nofollow">http://atc.leadsoft.eu/test.html</a></p>

<p>I entered the server url (<a href="https://socketio.mtgox.com/mtgox" rel="nofollow">https://socketio.mtgox.com/mtgox</a>) and click connect, but most of the time it writes only Connected or Connection timeout and freezes.</p>

CC BY-SA 3.0
2013-09-19T13:32:57.440Z
Please paste the code itself here.
Emre K.
CC BY-SA 3.0
2013-09-19T14:08:36.633Z
You have the code in the first link .... https://bitbucket.org/nitrous/mtgox-api/src/004c254993963baeb239ac7ac7f676b5024fc93f/socket/ws.client.html?at=master
leadsoft
CC BY-SA 3.0
2013-09-19T15:45:43.493Z
You need the code here mate. Not a link. And you need to give us the actual few lines that is not working. Not 327 lines of code. This is if you want your question answered
Emre K.
CC BY-SA 3.0
2013-09-19T20:32:24.557Z
I think this would be better posted on StackExchange. Mt. Gox is loosing lot's of customers right now, by the way.
DrAwesome
<mtgox><api><websockets>
MtGox socket.io streaming problem
leadsoft
# MtGox socket.io streaming problem

(Asked by: username_0 on 2013-09-19)

MtGox Streaming API is down or is something wrong with the code.

I used this example https:// bitbucket.org/nitrous/mtgox-api/src/004c254993963baeb239ac7ac7f676b5024fc93f/socket/ws.client.html?at=master

You can see the example here <http://atc.username_0.eu/test.html>

I entered the server url (<https://socketio.mtgox.com/mtgox>) and click connect, but most of the time it writes only Connected or Connection timeout and freezes.

**Tags:** mtgox, api, websockets

> **Comments:**
> **username_1**: Please paste the code itself here.  
> **username_0**: You have the code in the first link .... https://bitbucket.org/nitrous/mtgox-api/src/004c254993963baeb239ac7ac7f676b5024fc93f/socket/ws.client.html?at=master  
> **username_1**: You need the code here mate. Not a link. And you need to give us the actual few lines that is not working. Not 327 lines of code. This is if you want your question answered  
> **username_2**: I think this would be better posted on StackExchange. Mt. Gox is loosing lot's of customers right now, by the way.  

---

## 1 answers

### Answer by username_3 on 2013-09-19. Score: 1 | Accepted answer

Basically Mtgox's api sucks. It's not your fault, its theirs. It's almost impossible to programmatically get a good reading of their order book. `socket.io` only works about 20% of the time and the `http` api often gives just wrong information.

To get around this I have several server instances constantly reconnecting an disconnecting until a successful steam is established and then it reports back to me until it fails. The idea is to always have at least one working stream.

I realize this can be incredibly impractical so you may want to use a service like [bitcoin charts](http://bitcoincharts.com/) which has their own api, but if you need data more then every 15 min you will either have to pay or come up with some round about solution.

[Here's](https://bitcointalk.org/index.php?topic=285578.0;topicseen) some other people complaining about the same thing. One suggests using `websockets` and claims that he's had more success.


---

