Sharesbit

Sharesbit WebSocket API

v1.0.0

API Endpoint URL: wss://ws.sharesbit.net

Overview

Public channels do not require authentication. Private methods (login, orders, balances) are planned and will be announced once available.

  • Timestamps are UTC (Unix seconds unless noted).
  • Finance numbers are strings for arbitrary precision.
  • Symbols use BASE_QUOTE (e.g., BTC_USDT) or hyphen form on subscribe (BTC-USDT is accepted and normalized).

Authentication (planned)

Private channels will use a signed login flow (HMAC). Until released, all available methods are public.

Datetime & Number Formatting

Heartbeat

The server will ping/pong periodically to keep the connection alive. Clients should respond automatically if the library supports it.

Errors & Error Codes

Errors are sent as small JSON objects with type:"error" and a message:

{
  "type": "error",
  "code": 400,
  "message": "invalid subscribe request"
}
Error CodeMessageDetails
400Bad requestMalformed JSON or missing required fields
401UnauthorizedWhen private login is released and auth fails
404Channel not foundUnknown channel
429Too many requestsBack off and retry
500Internal server errorTemporary issue, retry

Channels

All messages use a compact native protocol:

{
  "op": "subscribe",
  "channel": "",        // "ticker" | "orderbook" | "trades"
  "symbols": ["BTC-USDT", ...]   // array of symbols; hyphen or underscore accepted
}

Unsubscribe uses the same shape with "op":"unsubscribe". Snapshots & updates are pushed as they occur.

Ticker

Subscribe to consolidated market stats.

{
  "op": "subscribe",
  "channel": "ticker",
  "symbols": ["BTC-USDT","ETH-USDT"]
}

Ticker push example:

{
  "type":"ticker",
  "data":[
    {
      "symbol":"EQT_USDT",
      "last":"250000.000000",
      "highestBid":"249750.000000",
      "lowestAsk":"250250.000000",
      "baseVolume":"22.92374853",
      "quoteVolume":"19536909.683376",
      "high24h":"252500.000000",
      "low24h":"247500.000000",
      "priceChangePercent24h":"0.07",
      "ts": 1757107476,
      "btcEquivalent":"2.25775405"
    }
  ]
}

Orderbook

Subscribe to L2 snapshots and incremental updates. Optional limit may be added later; current stream sends default depth.

{
  "op":"subscribe",
  "channel":"orderbook",
  "symbols":["BTC-USDT"]
}

Snapshot (example):

{
  "type":"orderbook",
  "symbol":"BTC_USDT",
  "bids":[["249750.000000","0.35"], ...],
  "asks":[["250250.000000","0.48"], ...],
  "ts": 1757107000,
  "sequence": 8073827
}

Update (example):

{
  "type":"orderbook_update",
  "symbol":"BTC_USDT",
  "bids":[["249760.000000","0.10"]],  // size "0" => remove level
  "asks":[],
  "ts": 1757107001,
  "sequence": 8073830
}

Trades

Subscribe to recent trades and live prints.

{
  "op":"subscribe",
  "channel":"trades",
  "symbols":["BTC-USDT"]
}

Snapshot (last N trades):

{
  "type":"trades",
  "symbol":"BTC_USDT",
  "data":[
    {"id":"1757093856009","price":"2.26449566","quantity":"0.00795976","side":"sell","ts":1757093847},
    {"id":"1757093856010","price":"2.26502758","quantity":"0.16915839","side":"sell","ts":1757093846}
  ],
  "sequence": 0
}

Update (live add):

{
  "type":"trades_update",
  "symbol":"BTC_USDT",
  "data":[{"id":"...","price":"...","quantity":"...","side":"buy","ts":1757093899}],
  "sequence": 0
}

Quick Examples (wscat)

Connect and subscribe to a couple of channels:

wscat -c wss://ws.sharesbit.net
> {"op":"subscribe","channel":"ticker","symbols":["EQT-USDT","EQT-BTC"]}
> {"op":"subscribe","channel":"orderbook","symbols":["EQT-USDT"]}
> {"op":"subscribe","channel":"trades","symbols":["EQT-BTC"]}

Questions or issues? Open a ticket with the payload you sent and the server_time from the welcome message.

HTML