Post
Topic
Board Marketplace
Re: [BETA] MTGox websocket API, testers wanted
by
1455
on 22/08/2012, 09:15:34 UTC
I tried for a few hours and crawled the forum for a solution but I'm still not able to fetch websocket depth for EUR.

Does anyone know if it is possible to receive market depth updates for other currencies (EUR) in the socket.io/websocket API?
I found this list of channels: https://en.bitcoin.it/wiki/Talk:MtGox/API but couldn't subscribe using the API.
The API only takes a "type" argument (Possible values: "trades, ticker, depth") e.g. {"op":"mtgox.subscribe","type":"trades"}
but there is no documented value for "depth.EUR".

You can subscribe with ?Channel=EUR added to the subscribe URL. I have a working EUR order book, chart, and time & sales on my website. Simply choose EUR from the drop down menu at the top: bitcoin.clarkmoody.com

It works fine for USD with (Ruby-code):

Code:
s = SocketIO.connect("https://socketio.mtgox.com/mtgox", {:sync => true, :reconnect => :true}) do
  before_start do
    puts "here we are"
    on_json_message do |m|
      m = JSON.parse m
      q << m["depth"] if m["op"] == "private" and m["private"] == "depth"
    end
    on_connect do
      send_message({"op" => "mtgox.subscribe", "type" => "depth"}.to_json)
    end
  end
end

but I wasn't able to get EUR depth with the mentioned solutions.

These are not working:
Code:
s = SocketIO.connect("https://socketio.mtgox.com/mtgox?Currency=EUR", {:sync => true, :reconnect => :true})
Code:
s = SocketIO.connect("https://socketio.mtgox.com/socket.io/1?Currency=EUR", {:sync => true, :reconnect => :true})

Could someone please help me with that? Thanks alot!