- Notifications
You must be signed in to change notification settings - Fork 28
Websocket
martin-nginio edited this page May 27, 2019 · 3 revisions
Note: this version of the WebSocket is being deprecated. Please refer to V2 for the latest documentation.
BTC Markets provides real-time public market as well as account related trading events using websocket.
endpoint: https://socket.btcmarkets.net
varsocket=require('socket.io-client')('https://socket.btcmarkets.net',{secure: true,transports: ['websocket'],upgrade: false});varinstrument='BTC';varcurrency='AUD';vareventName='newTicker';varchannelName='Ticker-BTCMarkets-'+instrument+"-"+currency;socket.on('connect',function(){console.log('connected');socket.emit('join',channelName);});socket.on(eventName,function(data){console.log(data);});socket.on('disconnect',function(){console.log('disconnected');});{volume24h: 56524541285,bestBid: 287602000000,bestAsk: 288817000000,lastPrice: 287602000000,timestamp: 1500349863621,currency: 'AUD',instrument: 'BTC'}Use the following channel name and event name in order to receive orderbook events
varinstrument='BTC';varcurrency='AUD';vareventName='OrderBookChange';varchannelName='Orderbook_'+instrument+currency;Use the following channel name and event name in order to receive trade events
varinstrument='BTC';varcurrency='AUD';vareventName='MarketTrade';varchannelName='TRADE_'+instrument+currency;coming soon
Introductionupdated 9/28/18
WebSocket v1deprecated
Market Data APIupdated 7/24/19
Trading APIupdated 08/19/19
Account APIupdated 3/14/19
Fund Transfer APIupdated 08/06/19