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

Follow Us: