Sound On

Thai English

BSV tokens have been distributed to all BCH holders, BCH withdrawals are online and BSV trading is now available here

Today (16/11/2018) 14:00 We will have a live webinar(Thai) "What is Moving Average?" at : https://youtu.be/fO1XtXQ-4L4

Websocket API Documentation

Our websocket API allows you to connect and receive data pushed to your client in realtime as the trades occur.

We also offer a REST API for all exchange functionality; the websocket is designed for only receiving realtime trade and orderbook data.

Sample Libraries

Javascript / JQuery Demo

You can download the code used below here: https://github.com/bitcoincoltd/bxwebsocket_js

Latest Trades (Bitcoin / Thai Baht)
Date/Time Rate Volume (BTC)
Buy Orders (Bitcoin to Thai Baht)
Volume (THB) Rate Volume (BTC)
Sell Orders (Bitcoin to Thai Baht)
Volume (THB) Rate Volume (BTC)

Trade Data

Endpoint: wss://ws.bx.in.th/trades?pairing=1,21,22&start_data=100

Replace the pairing=1,21,22 with any pairing IDs that you wish to subscribe to separated by commas, you can obtain pairing IDs via the pairing REST API.

The trades websocket will return a json object of every trade as it goes through; upon initial connection it will provide the last start_data trades.

Note that allowed values for start_data are 0,10,30,50,100,500,1000

Json Object Format:

{"trades":[ { "trade_id":(int), "pairing_id":(int), "rate":(string: decimal 8), "amount":(string: decimal 8), "trade_date":(string: datetime), "order_id":(int), "trade_type":(string: buy|sell) } ]}

Orderbook Data

Endpoint: wss://ws.bx.in.th/order_book?pairing=1&start_data=30

Replace the pairing=1 with the pairing ID that you wish to subscribe to, you can obtain pairing IDs via the pairing REST API.

The orderbook websocket will return a json object for every time an order is inserted, updated or deleted from the order book; upon initial connection it will return the entire orderbook.

Note that when an order is "updated" it will return as the "insert" action, so when receiving the message you should check the if the order_id already exists in your dataset.

Note that allowed values for start_data are 0,10,30,50,100,500,1000

Json Object Format:

{"orders":[ { "action":"delete", "order":{ "order_id":(int), "order_type":(string: buy|sell), } }, { "action":"insert", "order":{ "order_id":(int), "rate":(string: decimal 8), "amount":(string: decimal 8), "order_type":(string: buy|sell), "volume":(string: decimal 8), } } ]}