Tradifull
Search
⌃K

Websocket ⚡️

This endpoints allows you to get live ticker/trades from a given exchange.
Only Binance, Kraken and Bitfinex ATM for testing purposes

Websocket endpoint

wss://tradifull-ws.heroku.com/

Required params

  1. 1.
    Exchange (Binance, Kraken, Bitfinex)
  2. 2.
    Type (Trades, Ticker)
  3. 3.
    Base (Base currency)
  4. 4.
    Quote (Quote currency)
You can find all the Base/Quote pairs from the /v1/exchanges/:exchange returned object.tickers

Returned data

When type equal Trades

Properties
  • exchange: string - the name of the exchange
  • base: string - the normalized base symbol for the market
  • quote: string - the normalized quote symbol for the market
  • tradeId: string - the unique trade identifer from the exchanges feed
  • unix: int - the unix timestamp in milliseconds for when the trade executed
  • side: string - whether the buyer buy or seller sell was the maker for the match
  • price: string - the price at which the match executed
  • amount: string - the amount executed in the match
  • buyOrderId: string - the order id of the buy side
  • sellOrderId: string - the order id of the sell side

When type equal Ticker

Properties
  • exchange: string - the name of the exchange
  • base: string - the normalized base symbol for the market
  • quote: string - the normalized quote symbol for the market
  • timestamp: int - the unix timestamp in milliseconds
  • last: string - the last price of a match that caused a tick
  • open: string - the price 24 hours ago
  • low: string - the highest price in the last 24 hours
  • high: string - the lowest price in the last 24 hours
  • volume: string - the base volume traded in the last 24 hours
  • quoteVolume: string - the quote volume traded in the last 24 hours
  • change: string - the price change (last - open)
  • changePercent: string - the price change in percent (last - open) / open * 100
  • bid: string - the best bid price
  • bidVolume: string - the volume at the best bid price
  • ask: string - the best ask price
  • askVolume: string - the volume at the best ask price

Example using Nodejs

Install

# In an empty folder
npm init -y
npm install ws

Code

client.js
const WebSocket = require('ws');
const ws = new WebSocket('wss://tradifull-ws.herokuapp.com/?exchange=binance&base=BTC&quote=USDT&type=trades');
ws.on('message', function incoming(data) {
console.log(data);
});

Launch

# In the same folder from "Install"
node client.js