1

On their wiki MtGox have pages for Pubnub API and Websocket API. So when I connect to Websocket API - it just goes through Pubnub, or it's a different way to connect?

1 Answer 1

3

MtGox PubNub API and Websockets API

The two endpoints you are describing are indeed two separate endpoints which you will use under certain conditions depending on what you are seeking. The Public stream feeds and more can be accessed by issuing a .subscribe() PubNub SDK instance method call from the PubNub Class. For now the MtGox WS API is in deprecation and recommended that you upgrade using a standard MIT open source PubNub SDK which you can find your language here: http://www.pubnub.com/developers/

For receiving data via PubNub Real-Time Network you can use an SDK like JavaScript to receive real-time trade events.

Mt.Gox Data Feed Stream:

<script src="https://cdn.pubnub.com/pubnub.min.js"></script>
<script>(function(){

// INITIALIZE PUBNUB
var pubnub = PUBNUB.init({
    subscribe_key : 'sub-c-50d56e1e-2fd9-11e3-a041-02ee2ddab7fe'
});

// MULTIPLEX SUBSCRIBE TO TICKER FEED AND ALSO TRADES FEED
pubnub.subscribe({
    backfill : true,
    channel  : [
        'd5f06780-30a8-4a48-a2f8-7ed181b4a13f', // TICKER
        'dbf1dee9-4f2e-4a08-8cb7-748919a71b21'  // TRADE (BUY/SELL)
    ],
    message  : function(message) {
        // FIRE EVENT WHEN DATA ARRIVES
        console.log( message.channel_name, message );
    }
});

})();</script>
2
  • So MtGox WS api connection is going to be deprecated soon and normally new software should use pubnub connection only? Are the api features the same?
    – Anri
    Dec 26, 2013 at 20:25
  • For public streams and otherwise, you'll read the data flow from PubNub. However for purchasing and selling (actually trading) you'll issue those commands via Mt.Gox purchasing API directly. Jan 3, 2014 at 22:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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