Web Socket API documentation 1.0.0

Overview

Generating API Key

You will need to create an API key on the platform before you can use authenticated APIs. To create API keys, you can follow the steps below:

  • Login with your username / email and password into the website
  • Click on Account on the top right hand corner
  • Select the API tab
  • Click on New API button to create an API key and passphrase. (Note: the passphrase will only appear once)
  • Use your API key and passphrase to construct a signature.

Endpoints - wss://ws.btse.id

Authentication

The WS Auth requires to send a payload with the Auth data in the Args key after doing the connection and before sending any other data. see Spot Authentication and Futures Authentication for details.

Status Code = 400

You might get 400 status code due to abnormal usage and we will block you for 10 minutes.

Ping/Pong handling

For connectivity checking, we will send a ping frame message every 3 minutes and you will need to respond pong frame message to us for checking, if the pong frame message doesn't correctly respond to us in 10 minutes, we will force to disconnect the connection.

  • #Spot
  • #Spot Orderbook Streaming

Operations

  • SUB Spot-Subscription

    Endpoint: /ws/spot

    Subscribe to a topic

    • #Spot

    Accepts the following message:

    Spot-Subscription

    To subscribe to a websocket feed

    object oneOf
    uid: subscription

    Examples

  • SUB Spot-Public-Trade-Fills

    Public Trade Fills

    Endpoint: /ws/spot

    • #Spot

    Accepts the following message:

    Spot-Public-Trade-Fills

    Subscribe to recent trade feed for a market. The topic will be tradeHistoryApi:<market> where <market> is the market symbol.
    *** response content ***

    object oneOf
    uid: publicTradeFills

    Examples

  • SUB Spot-Authentication

    Spot Authentication

    Endpoint: /ws/spot

    • #Spot

    Accepts the following message:

    Spot-Authentication

    Authenticate the websocket session to subscribe to authenticated websocket topics. Assume we have values as follows:
    - request-nonce: 1624985375123
    - request-api:4e9536c79f0fdd72bf04f2430982d3f61d9d76c996f0175bbba470d69d59816x
    - secret:848db84ac252b6726e5f6e7a711d9c96d9fd77d020151b45839a5b59c37203bx

    Our subscription request will be:

    Request Parameters
    Below details the arguments needed to be sent in.

    Generating a signature
    echo -n "/ws/spot1624985375123" | openssl dgst -sha384 -hmac "848db84ac252b6726e5f6e7a711d9c96d9fd77d020151b45839a5b59c37203bx"
    (stdin)=c410d38c681579adb335885800cff24c66171b7cc8376cfe43da1408c581748156b89bcc5a115bb496413bda481139fb

    object oneOf
    uid: authentication

    Examples

  • SUB Spot-Notifications

    Spot Notifications

    Endpoint: /ws/spot

    • #Spot

    Accepts the following message:

    Spot-Notifications

    Receive trade notifications by subscribing to the topic notificationApiV3. The websocket feed will push trade level notifications to the subscriber. If topic is subscribed without being authenticated, no messages will be sent.
    *** response content ***

    object oneOf
    uid: notification

    Examples

  • SUB Spot-User-Trade-Fills

    Spot User Trade Fills

    Endpoint: /ws/spot

    • #Spot

    Accepts the following message:

    Spot-User-Trade-Fills

    When a trade has been transacted, this topic will send the trade information back to the subscriber.

    object oneOf
    uid: userTradeFills

    Examples

  • SUB Spot-OSS-L1-Snapshot

    OSS Level 1 Orderbook Snapshot

    Endpoint: /ws/oss/spot
    The format to subscribe to will be symbol. The L1 orderbook will be pushed immediately when orderbook changes.

    • symbol indicates the market symbol.
    • #Spot Orderbook Streaming

    Accepts the following message:

    Spot-OSS-L1-Snapshot


    *** response content ***

    object oneOf
    uid: OSSL1SnapshotByGrouping

    Examples

  • SUB Spot-Orderbook-Incremental-Updates

    Orderbook Incremental Updates

    Endpoint: /ws/oss/spot
    Subscribe to Orderbook incremental updates through the endpoint /ws/oss/spot. The topic to subscribe to will be update specifying the symbol (eg. update:BTC-USD). The first response received will be a snapshot of the current orderbook (this is indicated in the type field) and 50 levels will be returned. Incremental updates will be sent in subsequent packets with type delta.
    Bids and asks will be sent in price and size tuples. The size sent will be the new updated size for the price. If a value of 0 is sent, the price should be removed from the local copy of the orderbook.
    To ensure that the updates are received in sequence, seqNum indicates the current sequence and prevSeqNum refers to the packet before. seqNum will always be one after the prevSeqNum. If the sequence is out of order, you will need to unsubscribe and re-subscribe to the topic again.
    Also if crossed orderbook ever occurs when the best bid higher or equal to the best ask, please unsubscribe and re-subscribe to the topic again.
    *** response content ***

    • #Spot Orderbook Streaming

    Accepts the following message:

    Spot-Orderbook-Incremental-Updates


    *** response content ***

    object oneOf
    uid: orderbookIncrementalUpdates

    Examples