API DOCUMENTATION


Introduction

The BitSeven APIs provides users with a set of simple and powerful development tools designed to help users quickly and efficiently integrate BitSeven trading functions into their applications. Every function used by the BitSeven website is exposed via the API, allowing developers full control to build any kind of application on top of BitSeven.

Table of Contents


Websockets

Introduction


Connect your websocket client to

wss://api.bitseven.com:2053
  • Example: var ws = new WebSocket('wss://api.bitseven.com:2053');

Each message received via the BitSeven's websocket channel is encoded in JSON format.


Requests and Responses


The Request has the following

                {command} {channel} {symbol}
            
  • {command} - subscribe and unsubscribe.
  • {channel} - there are two type of channel; trades and ticker.
  • {symbol} - it have 4 symbol supported; BTC, ETH, LTC, XRP.

The Response is expressed as a single JSON Object and server reply message every thirty seconds. If it detecting connection drop, server reply Heartbeat and you can send a ping at any time and the server will return with a pong.


Subscribing and Unsubscribing


Subscribing

Call

               subscribe {channel} {symbol}
            
  • Example: ws.send('subscribe trades BTC');

Return

               subscribed {channel} {symbol}
            

Unsubscribing

Call

               unsubscribe {channel} {symbol}
            
  • Example: ws.send('unsubscribe trades BTC');

Return

               unsubscribed {channel} {symbol}
            

Channel Descriptions


The following channel are supported:


Ticker Data


Call

               {command} ticker {symbol}
            
  • {command} - subscribe and unsubscribe.
  • {symbol} - it have 4 symbol supported; BTC, ETH, LTC, XRP.
  • Example: ws.send('subscribe ticker BTC');

Return

               [channel,symbol,price,hight,low,diff,diffrate,volume]
            
  • Description
  • channel : Channel name of subscribing.
  • symbol : Symbol name of subscribing.
  • price : Price of the last trade.
  • high : Highest trade price of the last 24 hours
  • low : Lowest trade price of the last 24 hours
  • diff : Price change the last 24 hours
  • diffrate : Price rate (%) change the last 24 hours
  • volume : Trading volume of the last 24 hours
  • timestamp : The timestamp at which this information was valid

Trades Data


Call

               {command} trades {symbol}
            
  • {command} - subscribe and unsubscribe.
  • {symbol} - it have 4 symbol supported; BTC, ETH, LTC, XRP.
  • Example: ws.send('subscribe trades BTC');

Return

               [channel,symbol,price,diffrate,timestamp]
            
  • Description
  • channel : Channel name of subscribing.
  • symbol : Symbol name of subscribing.
  • price : Trade price
  • diffrate : Price rate (%) change the last 24 hours
  • timestamp : The timestamp at which this information was valid

Heartbeat


In case, you connected WebSocket and then no new message have been sent out for 30 second, Websocket server will send you an heartbeat message in this format.

               hb
            

Absence of heartbeats indicates a protocol or networking issue and the client application is expected to close the socket and try again.


REST Endpoints

Introduction


All Public Endpoints use HTTP GET requests and return output in JSON.

The BitSeven offer 4 major currencies: Bitcoin(BTC), Ethereum(ETH), Litecoin(LTC), Ripple(XRP).

https://api.bitseven.com/q/{parameter}

Tickers


Return ticker information of the last 24 hours.

Call

                https://api.bitseven.com/q/ticker/{symbol}
            
  • {symbol} : The symbol you want information about.
  • Example: https://api.bitseven.com/q/ticker/BTC

Return

               [symbol,timestamp,price,hight,low,diff,diffrate,volume]
            
  • Description
  • symbol : The symbol you want information about.
  • timestamp : The timestamp at which this information was valid
  • price : Price of the last trade.
  • high : Highest trade price of the last 24 hours
  • low : Lowest trade price of the last 24 hours
  • diff : Price change the last 24 hours
  • diffrate : Price rate (%) change the last 24 hours
  • volume : Trading volume of the last 24 hours

Stats


Return volume statistics and updates are sent every 30 seconds.

Call

                https://api.bitseven.com/q/stats/{symbol}
            
  • {symbol} : The symbol you want information about
  • Example: https://api.bitseven.com/q/stats/BTC

Return

               [period,volume]
            
  • Description
  • period : Period covered in days
  • volume : Trading volume

Trades


Return a list of the most recent trades for the given symbol.

Limit of trades levels, default 100.

Call

                https://api.bitseven.com/q/trades/{symbol}
            
  • {symbol} : The symbol you want information about
  • Example: https://api.bitseven.com/q/trades/BTC

Return

                [price,quantity,timestamp]
            
  • Description
  • price : Trade price
  • quantity : Trade quantity
  • timestamp : Trade timestamp