Niza Global - API Docs
  • Introduction
  • General
  • Authentication
  • PUBLIC ENDPOINTS
    • Markets
    • Tickers
    • OHLC Data
    • Order Book
    • Historical Trades
  • AUTHENTICATED ENDPOINTS
    • Balances
      • (Deprecated) Trade Wallet
      • Spot Wallet
    • Orders
      • Create Order
      • Cancel Order
      • Open Orders
      • Closed Orders
      • Get Order
    • Trades
      • Trades History
      • Get Trade
  • Websocket API 1.0
    • Overview
    • Connection Details
    • WebSocket Authentication
    • Public Channels
      • Ticker Information
      • OHLC
      • Recent Trades
      • Orderbook
    • Private Channels
      • Order Executed
      • Trade Executed
Powered by GitBook
On this page
  • Subscribe with Pusher
  • Subscribe Request Payload
  • Examples
  • Payload
  • Example of the Payload
  1. Websocket API 1.0
  2. Public Channels

OHLC

Open High Low Close (Candle) feed for a currency pair and interval period.

When subscribing, the pair should be set in alphanumeric format only. Do not use separators between the base and quote asset. The correct format for NIZA/USDT to be set in a channel name is NIZAUSDT.

The accepted values for interval are 1, 5, 15, 30, 60, 240, 1440, 10080, 21600.

Subscribe with Pusher

var channel = pusher.subscribe("ohlc.{pair}.{interval}");

Subscribe Request Payload

{
   "event": "pusher:subscribe",
   "data": {
       "channel": "ohlc.{pair}.{interval}"
   }
}

Examples

Subscribing to NIZAUSDT ohlc with 1 hour interval.

Pusher
var channel = pusher.subscribe("ohlc.NIZAUSDT.60");
WebSocket API in Javascript
const message = {
        event: "pusher:subscribe",
        data: {
            channel: "ohlc.NIZAUSDT.60"
        }
    };
socket.send(JSON.stringify(message));

Payload

Name
Type
Description

channel

string

The name of the channel

type

string

Type of event notification

timestamp

string

The timestamp of the start of the interval

data

array

The payload of OHLC data

data.symbol

string

The symbol of the of the currency pair

data.open

decimal

The opening trade price within the interval.

data.high

decimal

The highest trade price within the interval.

data.low

decimal

The lowest trade price within the interval.

data.close

decimal

The last trade price within the interval.

data.trades

integer

Number of trades within the interval.

data.volume

decimal

Total traded volume (in base currency terms) within the interval.

data.vwap

decimal

Volume weighted average trade price within the interval.

data.interval_begin

string

The timestamp of start of the interval. Format: RFC3339

data.interval

integer

The timeframe from the interval in minutes.

Example of the Payload

{
   "channel": "ohlc",
   "type": "update",
   "timestamp": "2024-09-18 18:09:32.533726",
   "data": {
       "symbol": "NIZA\/USDT",
       "open": "100.00000000",
       "high": "100.00000000",
       "low": "100.00000000",
       "close": "100.00000000",
       "trades": 1,
       "volume": "100.00000000",
       "vwap": "100.00000000",
       "interval_begin": "2024-09-18T16:09:00.000000Z",
       "interval": 1,
       "timestamp": "2024-09-18T16:10:00.000000Z"
   }
}
PreviousTicker InformationNextRecent Trades

Last updated 8 months ago