Connect Wallet

Connect with one of our available wallet providers or create a new one.

  • Metamask
  • Coinbase
  • WalletConnect

API Documentation

Examples

Javascript : https://api.bankcex.com/api/v1/ticker/24hr

# Public Rest API for EDAX

Last updated:

# General API Information

* The base endpoint is: **https://api.bankcex.com/api/v1** https://api.bankcex.com/api/v1/

* All endpoints return either a JSON object or array.

* Data is returned in **ascending** order. Oldest first, newest last.

* All time and timestamp related fields are in milliseconds.

EDAX side.

It is important to **NOT** treat this as a failure operation; the execution status is

**UNKNOWN** and could have been a success.

* Any endpoint can return an ERROR; the error payload is as follows:

```javascript

{
  "code": -1121,
  "msg": "Invalid symbol."
}

```

* Specific error codes and messages defined in another document.

* For `GET` endpoints, parameters must be sent as a `query string`.

* For `POST`, `PUT`, and `DELETE` endpoints, the parameters may be sent as a

`query string` or in the `request body` with content type

`application/x-www-form-urlencoded`. You may mix parameters between both the

`query string` and `request body` if you wish to do so.

* Parameters may be sent in any order.

* If a parameter sent in both the `query string` and `request body`, the

`query string` parameter will be used.

# LIMITS

* Every IP can send request to API 432.000 calls (5 times * 24h * 60m * 60s ) with a frequency at once a day.

* Please note that making more than 6 calls per second to the public API, or repeatedly and needlessly fetching excessive amounts of data, can result in your IP being banned.

* If your IP violates this limit, it will be banned.

* The banned IP will be removed from the banning list after about 2 minutes to 1 days

# There are six public methods, all of which take HTTP GET requests and return output in JSON format:

# Endpoint security type

* Each endpoint has a security type that determines the how you will interact with it.

* API-keys are passed into the Rest API via the `X-MBX-APIKEY` header.

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

* API-keys can be configured to only access certain types of secure endpoints. For example, one API-key could be used for TRADE only, while another API-key can access everything except for TRADE routes.

* By default, API-keys can access all secure routes.

Security Type | Description

------------ | ------------

NONE | Endpoint can be accessed freely.

TRADE | Endpoint requires sending a valid API-Key and signature.

USER_DATA | Endpoint requires sending a valid API-Key and signature.

USER_STREAM | Endpoint requires sending a valid API-Key.

MARKET_DATA | Endpoint requires sending a valid API-Key.

* `TRADE` and `USER_DATA` endpoints are `SIGNED` endpoints.

# SIGNED (TRADE and USER_DATA) Endpoint security

* `SIGNED` endpoints require an additional parameter, `signature`, to be sent in the `query string` or `request body`.

* Endpoints use `HMAC SHA256` signatures. The `HMAC SHA256 signature` is a keyed `HMAC SHA256` operation. Use your `secretKey` as the key and `totalParams` as the value for the HMAC operation.

* The `signature` is **not case sensitive**.

* `totalParams` is defined as the `query string` concatenated with the`request body`.

h3 class="standard">## Timing security

* A `SIGNED` endpoint also requires a parameter, `timestamp`, to be sent which should be the millisecond timestamp of when the request was created and sent.`

* An additional parameter, `recvWindow`, may be sent to specify the number of milliseconds after `timestamp` the request is valid for. If `recvWindow` is not sent, **it defaults to 5000**.`

* The logic is as follows:

```javascript

 if (timestamp < (serverTime + 1000) && (serverTime - timestamp) <= recvWindow) {
    // process request
  } else {
    // reject request
  }

```

**Serious trading is about timing.** Networks can be unstable and unreliable,

which can lead to requests taking varying amounts of time to reach the

servers. With `recvWindow`, you can specify that the request must be

processed within a certain number of milliseconds or be rejected by the

server.

**It recommended to use a small recvWindow of 5000 or less!**

# Public API Endpoints

## Terminology

* `base asset` refers to the asset that is the `quantity` of a symbol.

* `quote asset` refers to the asset that is the `price` of a symbol.

## ENUM definitions

**Order status:**

* NEW

* PARTIALLY_FILLED

* FILLED

* CANCELED

* CANCELLING

* REJECTED

* EXPIRED

**Order types:**

* LIMIT

* MARKET

**Order side:**

* BUY

* SELL

**Time in force:**

* GTC

* IOC

* FOK

**Kline/Candlestick chart intervals:**

m -> minutes; h -> hours; d -> days; w -> weeks

* 1m

* 5m

* 15m

* 30m

* 1h

* 2h

* 4h

* 6h

* 12h

* 1d

* 1w

**Rate limiters (rateLimitType)**

* REQUESTS_WEIGHT

* ORDERS

**Rate limit intervals**

* SECOND

* MINUTE

* DAY

### 1. 24hr ticker price change statistics

GET /api/v1/ticker/24hr

24 hour price change statistics. **Careful** when accessing this with no symbol.

**Weight:**

1 for a single symbol; **40** when the symbol parameter is omitted

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING | NO |

* If the symbol is not sent, tickers for all symbols will be returned in an array.

**Response:**

```javascript

{
	  "symbol": "RESTBTC",
	  "priceChange": "0",
	  "priceChangePercent": "+0",
	  "weightedAvgPrice": "0.0000025",
	  "prevClosePrice": "0.0000025",
	  "lastPrice": "0.0000025",
	  "lastQty": "0.00000000",
	  "bidPrice": "0",

	  "askPrice": "0.000623",
	  "openPrice": "0.00006973",
	  "highPrice": "0.00006973",
	  "lowPrice": "0.0000716",
	  "volume": "5000.00000000",
	  "quoteVolume": "0.00000250",
	  "openTime": 1688217800470,
	  "closeTime": 1688304200470,
	  "firstId": null,   // First tradeId
	  "lastId": null,    // Last tradeId
	  "count": 9         // Trade count
}

```

OR

```javascript

[{
	  "symbol": "RESTBTC",
	  "priceChange": "0",
	  "priceChangePercent": "+0",
	  "weightedAvgPrice": "0.0000025",
	  "prevClosePrice": "0.0000025",
	  "lastPrice": "0.0000025",
	  "lastQty": "0.00000000",
	  "bidPrice": "0",
	  
	   "askPrice": "0.000623",
	  "openPrice": "0.00006973",
	  "highPrice": "0.00006973",
	  "lowPrice": "0.0000716",
	  "volume": "5000.00000000",
	  "quoteVolume": "0.00000250",
	  "openTime": 1688217800470,
	  "closeTime": 1688304200470,
	  "firstId": null,   // First tradeId
	  "lastId": null,    // Last tradeId
	  "count": 9         // Trade count
}]

### 2. returnTicker

GET /api/v1/returnTicker

Returns the ticker for all markets. Sample output. **Careful** when accessing this with no symbol.

**Weight:**

1 for a single symbol; **40** when the symbol parameter is omitted

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING | NO |

* The functional always return JSON format.

**Response:**

```javascript

{
	"BANK_BTC":
		{"symbol":"BANK_BTC",
		"quoteVolume":972.068144,
		"openTime":"1535009005920",
		"closeTime":"1535095405920",
		"percentChange":-99.8025641025641,
		"last":0.00077,
		"highestBid":0.0007,
		"lowestAsk":0.00077,
		"baseVolume":201137.5,
		"high24hr":	0.0009,
		"low24hr":	0.00001,
		"isFrozen":	"0"}
}

```

OR

```javascript




  {
    "REST_BTC":
     {"symbol":"REST_BTC",
       "percentChange":0,
       "last":0.0000025,
       "highestBid":0,
       "lowsetAsk":0.000623,
       "baseVolume":0,
       "quoteVolume":0,
       "openTime":"1688192895411",
       "closeTime":"1688279295411",
       "high24hr":0,
       "low24hr":0,
       "isFrozen":"0"
		},
	{
       "REST_ETH":
       {"symbol":"REST_ETH",
       "percentChange":0,
       "last":0.005,
       "highestBid":0.000005,
       "lowsetAsk":0.00233,
       "baseVolume":0,
       "quoteVolume":0,
       "openTime":"1688192895445",
       "closeTime":"1688279295445",
       "high24hr":0,
       "low24hr":0,
       "isFrozen":"0"
		},


{      "REST_USDT":
       {"symbol":"REST_USDT",
       "percentChange":0,
       "last":0.64,
       "highestBid":0,
       "lowsetAsk":0.639,
       "baseVolume":0,
       "quoteVolume":0,
       "openTime":"1688192593365",
       "closeTime":"1688278993365",
       "high24hr":0,
       "low24hr":0,
       "isFrozen":"0"
		},


{
	"BANK_BTC":
		{"symbol":"BANK_BTC",
		"quoteVolume":972.068144,
		"openTime":"1535009005920",
		"closeTime":"1535095405920",
		"percentChange":-99.8025641025641,
		"last":0.00077,
		"highestBid":0.0007,
		"lowestAsk":0.00077,
		"baseVolume":201137.5,
		"high24hr":	0.0009,
		"low24hr":	0.00001,
        "isFrozen":	"0"},
	....
						
}

```

* call: https://api.bankcex.com/api/v1/returnTicker or https://api.bankcex.com/api/v1/returnTicker?symbol=RESTUSDT

### 3. General endpoints

### Test connectivitys

GET /api/v1/ping

Test connectivity to the Rest API..

**Weight:**

1

**Parameters:**

NONE

**Response:**

```javascript

{}

```

### 4. Check server time

GET /api/v1/time

Test connectivity to the Rest API and get the current server time.

**Weight:**

1

**Parameters:**

NONE

**Response:**

```javascript

{
	  "serverTime": 1499827319559
}

```

### 5. Exchange information

GET /api/v1/exchangeInfo

Current exchange trading rules and symbol information.

**Weight:**

1

**Parameters:**

NONE

**Response:**

```javascript

{
  "timezone": "UTC",
  "serverTime": 1536138750099,
  "rateLimits": [{
      "rateLimitType": "REQUESTS_WEIGHT",
      "interval": "MINUTE",
      "limit": 1200
    },
    {
      "rateLimitType": "ORDERS",
      "interval": "SECOND",
      "limit": 10
    },
    {
      "rateLimitType": "ORDERS",
      "interval": "DAY",
      "limit": 100000
    }
  ],
  "exchangeFilters": [],
  "symbols": [{
    "symbol": "ETHBTC",
    "status": "TRADING",
    "baseAsset": "ETH",
    "baseAssetPrecision": 8,
    "quoteAsset": "BTC",
    "quotePrecision": 8,
    "orderTypes": ["LIMIT", "MARKET"],
    "icebergAllowed": false,
    "filters": [{
      "filterType": "PRICE_FILTER",
      "minPrice": "0.00000100",
      "maxPrice": "100000.00000000",
      "tickSize": "0.00000100"
    }, {
      "filterType": "LOT_SIZE",
      "minQty": "0.00100000",
      "maxQty": "100000.00000000",
      "stepSize": "0.00100000"
    }]
  }]
}

```

### 6. Market Data endpoints

### Order book
GET /api/v1/depth

Test connectivity to the Rest API and get the current server time.

**Weight:**

Adjusted based on the limit:

Limit | Weight

------------ | ------------

5, 10, 20, 50, 100 | 1

500 | 5

1000 | 10

**Parameters:**

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING | YES |

limit | INT | NO | Default 100; max 1000. Valid limits:[5, 10, 20, 50, 100, 500, 1000]

**Caution:** setting limit=0 can return a lot of data.

**Response:**

```javascript

{
  "lastUpdateId": "5b8f2795e14c7613c08e7e5e",
  "bids": [
    [
      "0.0004",     // PRICE
      "2000",   // QTY
      []                // Ignore.
    ]
  ],
  "asks": [
    [
      "0.00045",
      "12.00000000",
      []
    ]
  ]
}

```

### 7. Recent trades list

GET /api/v1/trades

Get recent trades (up to last 500).

**Weight:**

Adjusted based on the limit:

Limit | Weight

1

**Parameters:**

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING| YES |

limit | INT | NO | Default 500; max 1000.

**Response:**

```javascript

[
  {
    "id": "5b80ca26b6eeaf0c424120fa",
    "price": "0.0001",
    "qty": "12.00000000",
    "time": 1535167014898,
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]

```

### 8. Old trade lookup (MARKET_DATA)

GET /api/v1/historicalTrades

Get older trades.

**Weight:**

5

**Parameters:**

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING| YES |

limit | INT | NO | Default 500; max 1000.

fromId | hexString | NO | TradeId to fetch from. Default gets most recent trades.

**Response:**

```javascript

[
  {
    "id": "5b80ca26b6eeaf0c424120fa",
    "price": "0.0001",
    "qty": "12.00000000",
    "time": 1535167014898,
    "isBuyerMaker": true,
    "isBestMatch": true
  }
]

```

### 9. Compressed/Aggregate trades list

GET /api/v1/aggTrades

Get compressed, aggregate trades. Trades that fill at the time, from the same order, with the same price will have the quantity aggregated.

**Weight:**

1

**Parameters:**

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING| YES |

limit | INT | NO | Default 500; max 1000.

fromId | hexString | NO | ID to get aggregate trades from INCLUSIVE.

startTime | LONG | NO | Timestamp in ms to get aggregate trades from INCLUSIVE.

endTime | LONG | NO | Timestamp in ms to get aggregate trades until INCLUSIVE.

* If both startTime and endTime are sent, time between startTime and endTime must be less than 1 hour.

* If fromId, startTime, and endTime are not sent, the most recent aggregate trades will be returned.

**Response:**

```javascript

[{
	"a":"5b8d959bebe6c97938d07971",// Aggregate tradeId
	"f":"5b8d959bebe6c97938d07971",// First tradeId
	"l":"5b8d959bebe6c97938d07971",// Last tradeId
	"p":0.0000054,// Price  
	"q":61,// Quantity 
	"T":1536005531820,// Timestamp
	"m":false,// Was the buyer the maker?
	"M":true // Was the trade the best price match?
},  
{
	"a":"5b8d959bebe6c97938d07973",
	"f":"5b8d959bebe6c97938d07973",
	"l":"5b8d959bebe6c97938d07973",
	"p":0.0000054,"q":29,
	"T":1536005531884,
	"m":false,"M":true
}]

```

### 10. Kline/Candlestick data

GET /api/v1/klines

Kline/candlestick bars for a symbol.

Klines are uniquely identified by their open time.

**Weight:**

1

**Parameters:**

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING| YES |

limit | INT | NO | Default 500; max 1000.

interval | ENUM | YES |

startTime | LONG | NO | Timestamp in ms to get aggregate trades from INCLUSIVE.

endTime | LONG | NO | Timestamp in ms to get aggregate trades until INCLUSIVE.

** If startTime and endTime are not sent, the most recent klines are returned.

**Response:**

```javascript

[
  [
    1535168400000,    // Open time
    "0.041755",       // Open
    "0.041755",       // High
    "0.041755",       // Low
    "0.041755",       // Close
    "0.01",  // Volume
    1535168459000,    // Close time
    "1000000",        // Quote asset volume
    "2"               // Number of trades    
  ]
]

```

### 11. Kline/Candlestick data

GET /api/v1/ticker/price

Latest price for a symbol or symbols.

**Weight:**

1

**Parameters:**

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING | NO |

If the symbol is not sent, prices for all symbols will be returned in an array.

**Response:**

```javascript

{
  "symbol": "ETHBTC",
  "price":0.038911			
}

```

OR

```javascript

[
  {
   "symbol": "BTCUSDT",
   "price":6780			
  },
  {
   "symbol": "ETHBTC",
   "price":0.038911			
  }
]

```

### 12. Symbol order book ticker

GET /api/v1/ticker/bookTicker

Best price/qty on the order book for a symbol.

**Weight:**

1

**Parameters:**

**Parameters:**

Name | Type | Mandatory | Description

------------ | ------------ | ------------ | ------------

symbol | STRING | YES |

**Response:**

```javascript

{
  "symbol": "RESTUSDT",
  "bidPrice": "0.64",
  "bidQty": "423",
  "askPrice": "0.64",
  "askQty": "571.8"
}

```

### 13. SIGNED Endpoint Examples for POST /api/v1/order - UNDER DEVELOPMENT

### New order (TRADE)
POST /api/v1/order  (HMAC SHA256)

Send in a new order.

### Endpoint security type

Here is a step-by-step example of how to send a vaild signed payload from the

Linux command line using `echo`, `openssl`, and `curl`.

Key | Value

------------ | ------------

apiKey | vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A

secretKey | NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j

Parameter | Value

------------ | ------------

symbol | LTCBTC

side | BUY

type | LIMIT

timeInForce | GTC

quantity | 1

price | 0.1

recvWindow | 5000

timestamp | 1499827319559

### Example 1: As a query string

* **queryString:** symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559

* **HMAC SHA256 signature:**

```

[linux]$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
(stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71

```

* **curl command:**

```

(HMAC SHA256)

  [linux]$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.bankcex.com/api/v1/order?symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'

```

### Example 2: As a request body

* **requestBody:** symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559

* **HMAC SHA256 signature:**

```

  [linux]$ echo -n "symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559" | openssl dgst -sha256 -hmac "NhqPtmdSJYdKjVHjA7PZj4Mge3R5YNiP1e3UZjInClVN65XAbvqqM6A7H5fATj0j"
  (stdin)= c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71

```

* **curl command:**

```

(HMAC SHA256)

   [linux]$ curl -H "X-MBX-APIKEY: vmPUZE6mv9SD5VNHk4HlWFsOr6aKE2zvsw0MuIgwCIPy6utIco14y7Ju91duEh8A" -X POST 'https://api.bankcex.com/api/v1/order' -d 'symbol=LTCBTC&side=BUY&type=LIMIT&timeInForce=GTC&quantity=1&price=0.1&recvWindow=5000×tamp=1499827319559&signature=c8db56825ae71d6d79447849e617115f4a920fa2acdcab2b053c4b2838bd6b71'

```

Contact Us

  • Energy innovations ready to serve every connection to community development.

    Connecting organizations to organizations through innovation Connecting organizations around the world Giving everyone access to funding sources safely. Do not take advantage of consumers and encourage every community to access technology.

  • Office

    63/260 Bang Yai City Soi 10/5, Sao Thong Hin Subdistrict, Bang Yai District, Nonthaburi

! Please Fill Required Fields !
Scroll To Top