Get Order Book

This method will return the Order Book of exchange.

URL: https://exchange.bartertrade.io/api/v1/getorderbook

Method: POST

Attributes:

chartType – (string) – Month, Daily, or Intraday

side – (string) - buy side or sell side of the order book

pair – (string) – Token Pair

api_key – (string) - Key to access the user’s data

lastreqtime – Time of last request

Header :

  • API-keys are passed into the Rest API via the 'Authorization' header.

  • API-keys and secret-keys are case sensitive.

  • SIGNED secret key, iat and exp with JWT signature.

How to create token?

Example :

let payload =

{ iat: seconds, //10 digit exp: seconds_exp, //10 digit secretkey: secretkey };

let token = jwt.sign( payload, secretkey );

headers: { 'Authorization': token, 'Content-Type': 'application/json', },

Body:

{ 
   "chartType":"month", 
   "pair":"ETH_BTC", 
   "side":"Sell", Sell or Buy 
   "api_key": apikey,
   "lastreqtime":"1604491200000" 
}

Response:

{
  "status": true,
  "data": [
    {
      "price": "1.3",
      "amount": "1.00000000000000000000",
      "totalprice": "1.300000000000000000000"
    },
    {
      "price": "1.21",
      "amount": "23.00000000000000000000",
      "totalprice": "27.8300000000000000000000"
    },
    {
      "price": "1.2",
      "amount": "125.00000000000000000000",
      "totalprice": "150.000000000000000000000"
    }
  ]
}

Last updated

Was this helpful?