NAV

Introduction

Welcome to the bitexbit API docs!

Service bitexbit.com provides open API for trading operations and broadcasting of all trading events.

HTTP API (v2)

HTTP API endpoint available on https://bitexbit.com/api/v2/.

Some methods requires authorization read below.

All HTTP methods accept JSON formats of requests and responses if it not specified by headers.

Authentication

There are few types of authentication

For FULL authentication you need:

HTTP API (v1)

Read more about API v1 here

HTTP API Gateway

Read more about API Gateway here

Api example

Example

Api Example

const axios = require("axios");
const sha256 = require("js-sha256");

class ApiClient {
  constructor(key, secret, baseUrl = "https://www.bitexbit.com") {
    this.key = key;
    this.secret = secret;
    this.client = axios.create({
      baseURL: baseUrl,
      timeout: 10000,
      headers: {
        "Content-Type": "application/json; charset=utf-8",
        Accept: "application/json",
      },
      responseType: "json",
    });
  }

  getCurrencies() {
    return this._get("/api/v2/public/currencies");
  }

  getCurrency(symbol) {
    return this._get(`/api/v2/public/currency/${symbol}`);
  }

  getPairs() {
    return this._get("/api/v2/public/pairs");
  }

  getPair(symbol) {
    return this._get(`/api/v2/public/pairs/${symbol}`);
  }

  getOHLCV(symbol, timeframe, filters = null) {
    let params = {
      symbol: symbol,
      timeframe: timeframe,
    };

    if (filters) {
      params = { ...params, ...filters };
    }

    return this._get("/api/v2/public/ohlcv", params);
  }

  getTickers(symbols = null) {
    let params = {};

    if (symbols) {
      if (Array.isArray(symbols)) {
        params.symbols = symbols.join(",");
      } else {
        params.symbols = symbols;
      }
    }

    return this._get("/api/v2/public/tickers", params);
  }

  getOrderbookDepth(symbol, limit = null) {
    let params = {
      symbol: symbol,
    };
    if (limit) params.limit = limit;
    return this._get(`/api/v2/public/depth`, params);
  }

  getTrades(symbol, filters = null) {
    let params = {
      symbol: symbol,
    };

    if (filters) {
      params = { ...params, ...filters };
    }

    return this._get(`/api/v2/public/trades`, params);
  }

  getMyOrders(filters = null) {
    return this._get("/api/v2/private/orders", filters, true);
  }

  getMyOrderTrades(orderId) {
    return this._get(`/api/v2/private/orders/${orderId}/trades`, {}, true);
  }

  createOrder(symbol, price, amount, type) {
    return this._post("/api/v2/private/order/create", {
      symbol: symbol,
      price: price.toString(),
      amount: amount.toString(),
      type: type,
    });
  }

  cancelOrder(orderId) {
    return this._post(`/api/v2/private/order/${orderId}/cancel`);
  }

  getMyTrades(filters = null) {
    return this._get("/api/v2/private/trades", filters, true);
  }

  getBalance(symbols) {
    let params = {};

    if (symbols) {
      if (Array.isArray(symbols)) {
        params.symbols = symbols.join(",");
      } else {
        params.symbols = symbols;
      }
    }

    return this._get("/api/v2/private/balance", params, true);
  }

  getTradingFees() {
    return this._get("/api/v2/private/trading-fees", {}, true);
  }

  createCoupon(amount, symbol, recipientEmail = null) {
    let data = {
      amount: amount.toString(),
      symbol: symbol,
    };

    if (recipientEmail) data.recipient_email = recipientEmail;

    return this._post("/api/v2/private/coupon/create", data);
  }

  redeemCoupon(code) {
    return this._post("/api/v2/private/coupon/redeem", { code: code });
  }

  getTransfers(filters = null) {
    return this._get("/api/v2/private/transfers/", filters, true);
  }

  createTransfer(body) {
    return this._post("/api/v2/private/transfers/create", body);
  }

  acceptTransfer(txid) {
    return this._post(`/api/v2/private/transfers/${txid}/accept`);
  }

  cancelTransfer(txid) {
    return this._post(`/api/v2/private/transfers/${txid}/cancel`);
  }

  _get(path, params = null, auth = false) {
    let config = {
      params: params,
    };

    if (auth) {
      const nonce = new Date().getTime();
      const signature = this._getSignature(path, nonce, "");

      config.headers = {
        "X-API-Key": this.key,
        "X-Nonce": nonce,
        "X-Signature": signature,
      };
    }

    return this.client.get(path, config);
  }

  _post(path, data = {}) {
    const nonce = new Date().getTime();
    const signature = this._getSignature(path, nonce, JSON.stringify(data));

    const config = {
      headers: {
        "X-API-Key": API_KEY,
        "X-Nonce": nonce,
        "X-Signature": signature,
      },
    };

    return this.client.post(path, data, config);
  }

  _getSignature(path, nonce, body = "") {
    const payload = path + nonce + body;
    const hash = sha256.hmac.create(this.secret);
    hash.update(payload);
    return hash.hex();
  }
}


Success responses

Code Meaning
200 Returns is response is success. Body of response usually contains object that affected.

Errors

We are using standard HTTP statuses in responses.

Error Code Meaning
400 If response has http status 400 that means that client should change some input parameters to make it success. What exactly wrong returned in response body.
401 In case when HTTP endpoint require authentication but provided authentication headers not valid - response with status 401 will be returned and the details in body.
403 You do not have access to do the operation. For example when you try to cancel orders that was created by other user.
429 We have different rate limits to call API methods. If you reached this - response with status 429 will be returned.
500 Nobody is safe to make mistakes. This is the case when error happened on serer side. No details but we are see it.
502 Looks like we under high load. Try your request later.

Public methods

Here all method you can use without any credentials:

Currencies

Returns list of currencies on the exchange. Each element contains info describing currency.

Request

GET /api/v2/public/currencies

Authentication

FREE

Response

Response Example

[
  {
    "code": "BTC",
    "name": "Bitcoin",
    "image_url": "https://bitexbit.com/media/currency/BTC/l.TpjkNtFB2Q9QQbBO.png",
    "precision": 8,
    "is_enabled": true
  },
  {
    "code": "ETH",
    "name": "Ethereum",
    "image_url": "https://bitexbit.com/media/currency/ETH/l.MN2H93w4xXpDIRhX.png",
    "precision": 5,
    "is_enabled": true
  }
]

Each object in array has next structure:

Key Type Description
code string short unique name of currency
name string full name of currency
image_url string relative url to image of currency
precision integer how many decimal places supported for currency
is_enabled boolean is currency enabled (can be temporary or permanent as well)

Currency details

Request

GET /api/v2/public/currency/<code>

Query Parameters

Code Type Description
code string short unique name of currency

Pairs

Returns list of trading pairs listed on exchange. Each element contains info describing pair.

Request

GET /api/v2/public/pairs

Authentication

FREE

Response

Response Example

[
  {
    "symbol": "BTC_USD",
    "label": "BTC/USD",
    "base": "BTC",
    "quote": "USD",
    "price_precision": 3,
    "amount_precision": 6,
    "min_amount": "0.00001000",
    "max_amount": "100000000",
    "min_value": "0.00001000",
    "can_create_order": true,
    "can_cancel_order": true,
    "is_enabled": true
  },
  {
    "symbol": "LTC_USD",
    "label": "LTC/USD",
    "base": "LTC",
    "quote": "USD",
    "price_precision": 4,
    "amount_precision": 8,
    "min_amount": "0.00001000",
    "max_amount": "100000000",
    "min_value": "0.00001000",
    "can_create_order": true,
    "can_cancel_order": true,
    "is_enabled": true
  }
]

Each object in array has next structure:

Key Type Description
symbol string unique pair name, that build from first and second currency symbols divided by underscore symbol
label string human readable pair name
base string symbol of first currency. all amount in orders and trades measured in this currency
quote string symbol of second currency
price_precision integer ow many decimal digits can be in price when placing order
amount_precision integer how many decimal digits can be in amount when placing order
min_amount decimal string only acceptable amount greater or equal this value when placing order
max_amount decimal string only acceptable amount lesser or equal this value when placing order
min_value decimal string minimal value of order in quote_currency (amount multiply by price)
can_create_order boolean can order be places or not by this pair
can_cancel_order boolean can order be cancelled or not by this pair
is_enabled boolean is pair enabled, orders can be places or canceled (can be temporary or permanent as well)

Pair Details

GET /api/v2/public/pairs/<symbol>

Where symbol - string; identifier of pair

Open-High-Low-Close-Volume

Returns list of candles by specified candle type and pair

Request

GET /api/v2/public/ohlcv

Authentication

FREE

Parameters

Object with next items:

Response Example

[
  [
    1477958400,
    "715.00000000",
    "720.20000000",
    "715.00000000",
    "717.00000000",
    "0.01924864"
  ],
  [
    1478044800,
    "717.00000000",
    "717.50000000",
    "712.00000000",
    "716.50000000",
    "0.08771271"
  ]
]

Response

Array of arrays; Each array in response has next items:

Tickers

Returns list of tickers objects for all trading pairs

Request

GET /api/v2/public/tickers

Authentication

FREE

Parameters

Object with next items:

Response

Response Example

[
  {
    "date": 1547535929556,
    "symbol": "BTC_USD",
    "last": "3781.33900000",
    "buy": "3781.33900000",
    "sell": "3781.94500000",
    "change": "0.00000000",
    "vol1": "0.00000000",
    "vol2": "0.00000000",
    "high": "0.00000000",
    "low": "0.00000000"
  },
  {
    "date": 1547535923368,
    "symbol": "ETH_USD",
    "last": "132.33000000",
    "buy": "132.08000000",
    "sell": "132.33000000",
    "change": "0.00000000",
    "vol1": "0.00000000",
    "vol2": "0.00000000",
    "high": "0.00000000",
    "low": "0.00000000"
  }
]

Each object in array has next structure:

Orderbook Depth

Get the depth of orderbook.

Request

GET /api/v2/public/depth

Authentication

FREE

Parameters

Object with next items:

Response

Response Example

{
  "date": 1568905003.866091,
  "asks": [
    [1, 1],
    [2, 4]
  ],
  "bids": [
    [1, 1],
    [2, 4]
  ],
  "sum_bids": 5,
  "sum_asks": 5
}

Object with next items:

Public Orders

Returns public orders list

Request

GET /api/v2/public/orders

Authentication

FREE

Parameters

Response

Response Example

[
  {
    "id": 34,
    "date": 1478036172902,
    "type": "buy-limit",
    "symbol": "BTC_USD",
    "price": "433.00000000",
    "amount": "0.00692841",
    "amount_unfilled": "0.00692841",
    "amount_filled": null,
    "amount_cancelled": null,
    "value_filled": null,
    "price_avg": null,
    "done_at": null,
    "state": "submitted"
  },
  {
    "id": 28,
    "date": 1478033710751,
    "type": "buy-limit",
    "symbol": "BTC_USD",
    "price": "55.00000000",
    "amount": "0.00876952",
    "amount_unfilled": "0.00876952",
    "amount_filled": null,
    "amount_cancelled": null,
    "value_filled": null,
    "price_avg": null,
    "done_at": null,
    "state": "submitted"
  }
]

Each object in array has next structure:

Public Trades

Returns list of trades filtered by parameters

Request

GET /api/v2/public/trades

Authentication

FREE

Parameters

Object with next items:

Response

Response Example

[
  {
    "date": 1543252041327,
    "id": 17802900,
    "symbol": "BTC_USD",
    "price": "6609.00000000",
    "amount": "0.00075600",
    "type": "buy"
  },
  {
    "date": 1541591882904,
    "id": 17802242,
    "symbol": "BTC_USD",
    "price": "6610.00000000",
    "amount": "0.00100000",
    "type": "buy"
  },
  {
    "date": 1541591750140,
    "id": 17802190,
    "symbol": "BTC_USD",
    "price": "6636.71000000",
    "amount": "0.00002335",
    "type": "buy"
  }
]

Each object in array has next structure:

Private methods

Here all method that requires authentication:

Create Order

Create order on platform

Currently only limit order. If new order types will be added limit order will be by default

Request

POST /api/v2/private/order/create

Authentication

FULL, CAN_CREATE_ORDER

Parameters

Object with next items:

Response

Response Example

{
  "order": {
    "id": 33852806,
    "date": 1544617382079,
    "symbol": "BTC_USD",
    "type": "sell-limit",
    "price": "1000.00000000",
    "amount": "0.00150000",
    "amount_unfilled": "0.00150000",
    "amount_filled": "0.00000000",
    "amount_cancelled": null,
    "value_filled": "0.00000000",
    "fee_filled": "0.00000000",
    "price_avg": null,
    "done_at": null,
    "state": "submitted"
  },
  "trades": [],
  "funds": [
    {
      "symbol": "USD",
      "available": "5.15245011",
      "reserved": "1.49999876"
    }
  ]
}

Object with order data and funds

Cancel Order

Cancel order on platform

Request

POST /api/v2/private/order/<id>/cancel

Authentication

FULL, CAN_CANCEL_ORDER

Path parameters

Object with next items:

Response

Response Example

{
  "cancel": {
    "id": 458528,
    "date": 1544617682079
  },
  "order": {
    "id": 33852806,
    "date": 1544617382079,
    "symbol": "BTC_USD",
    "type": "sell-limit",
    "price": "1000.00000000",
    "amount": "0.00150000",
    "amount_unfilled": "0.00000000",
    "amount_filled": "0.00000000",
    "amount_cancelled": "0.00150000",
    "value_filled": "0.00000000",
    "fee_filled": "0.00000000",
    "price_avg": null,
    "done_at": 1544617682079,
    "state": "canceled"
  },
  "funds": [
    {
      "symbol": "USD",
      "available": "6.65244888",
      "reserved": "0.00000000"
    }
  ]
}

Object with next structure

Private Orders

Returns list of my orders filtered by parameters

Request

GET /api/v2/private/orders

Authentication

FULL

Parameters

Response

Response Example

[
  {
    "id": 34,
    "date": 1478036172902,
    "type": "buy-limit",
    "symbol": "BTC_USD",
    "price": "433.00000000",
    "amount": "0.00692841",
    "amount_unfilled": "0.00692841",
    "amount_filled": null,
    "amount_cancelled": null,
    "value_filled": null,
    "fee_filled": null,
    "price_avg": null,
    "done_at": null,
    "state": "submitted"
  },
  {
    "id": 28,
    "date": 1478033710751,
    "type": "buy-limit",
    "symbol": "BTC_USD",
    "price": "55.00000000",
    "amount": "0.00876952",
    "amount_unfilled": "0.00876952",
    "amount_filled": null,
    "amount_cancelled": null,
    "value_filled": null,
    "fee_filled": null,
    "price_avg": null,
    "done_at": null,
    "state": "submitted"
  }
]

Each object in array has next structure:

Private Trades

Returns list of my trades filtered by parameters

Request

GET /api/v2/private/trades

Authentication

FULL

Parameters

Object with next items:

Response

Response Example

[
  {
    "id": 17802902,
    "date": 1544617013258,
    "type": "buy",
    "symbol": "BTC_USD",
    "price": "6585.00000000",
    "amount": "1",
    "fee_amount": "0.01316842",
    "fee_rate": "0.00200000",
    "fee_symbol": "USD"
  }
]

Each object in array has next structure:

Balance

Returns fund for each symbol available on account

Request

GET /api/v2/private/balance

Authentication

FULL

Parameters

Object with next items:

Response

Response Example

[
  {
    "symbol": "BTC",
    "available": "0.00661226",
    "reserved": "0.00000000"
  },
  {
    "symbol": "USD",
    "available": "6.65245012",
    "reserved": "0.00000124"
  }
]

Each object in array has next structure:

Object; keys is currencies id of wallets that were changed by operation, values is available balance after operation

Trading Fees

Returns account trading fees

Request

GET /api/v2/private/trading-fees

Authentication

FULL

Response

Response Example

{
  "sell_fee_rate": "0.00200000",
  "buy_fee_rate": "0.00200000",
  "pair_fee_rates": [
    {
      "symbol": "BTC_USD",
      "sell_fee_rate": "0.00000000",
      "buy_fee_rate": "0.00000000"
    }
  ]
}

Object has next structure:

Create coupon

Create Coupon

Read more about Coupons ...

Request

POST /api/v2/private/coupon/create

Authentication

FULL, CAN_CREATE_COUPON

Parameters

Object with next items:

Response

Response Example

{
  "code": "BTClYyR9gLNrZCN35KY4DFxc64roF1RJKsxxgEuMyRdnmkp7qmrw5XGVjQrk2UZhccFD",
  "coupon": {
    "date": 1544695102296,
    "opid": 48480429,
    "amount": "0.05000000",
    "symbol": "BTC",
    "recipient_email": null
  },
  "funds": [
    {
      "symbol": "BTC",
      "available": "0.12060000",
      "reserved": "0.00000000"
    }
  ]
}

Object has next structure:

Redeem coupon

Redeem Coupon

Request

POST /api/v2/private/coupon/redeem

Authentication

FULL, CAN_REDEEM_COUPON

Parameters

Object with next items:

Response

Response Example

{
  "redeem": {
    "date": 1544696109.65948,
    "amount": "0.05000000",
    "symbol": "BTC",
  }
  "funds": [
    {
      "symbol": "BTC",
      "available": "0.12560000",
      "reserved": "0.00000000"
    }
  ]
}

Object has next structure:

Transfers List

Transfers List

Request

GET /api/v2/private/transfers

Authentication

FULL

Statuses

Key Label Description
10 Pending When transfer has secure code.
20 Cancelled
30 Success

Parameters

Object with next items:

Response

Response Example

{
    "count": 7,
    "next": null,
    "previous": null,
    "results": [
        {
            "txid": "f346a4094fc8a56ba0ad",
            "date": "2021-08-30T10:21:26.771489Z",
            "amount": "10.00000000",
            "currency": {
                "code": "USDT",
                "name": "Tether USD",
                "precision": 2
            },
            "sender": "BL1314K55FL",
            "receiver": {
                "uid": "VB4DF1HQ4D7",
                "verified": false
            },
            "status": {
                "key": 30,
                "label": "Success"
            },
            "description": null,
            "valid_till": "2021-08-31T10:21:26.760408Z",
            "is_outgoing": true,
            "can_cancel": false,
            "can_accept": false
        },
    ],
}

Object has next structure:

Create Transfer

Create Transfer

Request

POST /api/v2/private/transfers/create/

Authentication

FULL

Parameters

Object with next items:

Response

Response Example

{
  "receiver": "user@email.com",
  "amount": "10.00000000",
  "currency": "USDT",
  "description": "Smile",
  "txid": "12345abc",  
  "status": {
      "key": 10,
      "label": "Pending"
  },
  "valid_till": "2021-08-31T13:07:38.871103Z",
  "is_protected": true
}

Object has next structure:

Accept Transfer

Accept Transfer

Request

POST /api/v2/private/transfers/{{ txid }}/accept/

Authentication

FULL

Parameters

Object with next items:

Response

Response Example

{
  "transfer": {
    "txid": "9699f3c5b4b1aa0d2528",
    "amount": "10.00000000",
    "currency": {
      "code": "USDT",
      "name": "Tether USD",
      "precision": 2
      },
    "sender": "BL1314K55FL",
    "receiver": {
      "uid": "VB4DF1HQ4D7",
      "verified": false
      },
    "status": {
      "key": 20,
      "label": "Cancelled"
      },
    "description": null,
    "valid_till": "2021-08-31T12:38:05.859390Z"
  }
}

Object has next structure:

Cancel Transfer

Cancel Transfer

Request

POST /api/v2/private/transfers/{{ txid }}/cancel/

Authentication

FULL

Response

Response Example

{
  "transfer": {
    "txid": "9699f3c5b4b1aa0d2528",
    "amount": "10.00000000",
    "currency": {
      "code": "USDT",
      "name": "Tether USD",
      "precision": 2
      },
    "sender": "BL1314K55FL",
    "receiver": {
      "uid": "VB4DF1HQ4D7",
      "verified": false
      },
    "status": {
      "key": 20,
      "label": "Cancelled"
      },
    "description": null,
    "valid_till": "2021-08-31T12:38:05.859390Z"
  }
}

Object has next structure: