All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
listDeliveryContracts | GET /delivery/{settle}/contracts | List all futures contracts |
getDeliveryContract | GET /delivery/{settle}/contracts/{contract} | Get a single contract |
listDeliveryOrderBook | GET /delivery/{settle}/order_book | Futures order book |
listDeliveryTrades | GET /delivery/{settle}/trades | Futures trading history |
listDeliveryCandlesticks | GET /delivery/{settle}/candlesticks | Get futures candlesticks |
listDeliveryTickers | GET /delivery/{settle}/tickers | List futures tickers |
listDeliveryInsuranceLedger | GET /delivery/{settle}/insurance | Futures insurance balance history |
[DeliveryContract] listDeliveryContracts(settle)
List all futures contracts
var GateApi = require('gate-api');
var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listDeliveryContracts(settle, callback);
Name | Type | Description | Notes |
---|---|---|---|
settle | String | Settle currency |
No authorization required
- Content-Type: Not defined
- Accept: application/json
DeliveryContract getDeliveryContract(settle, contract)
Get a single contract
var GateApi = require('gate-api');
var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var contract = "BTC_USDT_20200814"; // String | Futures contract
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.getDeliveryContract(settle, contract, callback);
Name | Type | Description | Notes |
---|---|---|---|
settle | String | Settle currency | |
contract | String | Futures contract |
No authorization required
- Content-Type: Not defined
- Accept: application/json
FuturesOrderBook listDeliveryOrderBook(settle, contract, opts)
Futures order book
Bids will be sorted by price from high to low, while asks sorted reversely
var GateApi = require('gate-api');
var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var contract = "BTC_USDT_20200814"; // String | Futures contract
var opts = {
'interval': '0', // String | Order depth. 0 means no aggregation is applied. default to 0
'limit': 10, // Number | Maximum number of order depth data in asks or bids
'withId': false // Boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listDeliveryOrderBook(settle, contract, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
settle | String | Settle currency | |
contract | String | Futures contract | |
interval | String | Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] |
limit | Number | Maximum number of order depth data in asks or bids | [optional] [default to 10] |
withId | Boolean | Whether the order book update ID will be returned. This ID increases by 1 on every order book update | [optional] [default to false] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[FuturesTrade] listDeliveryTrades(settle, contract, opts)
Futures trading history
var GateApi = require('gate-api');
var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var contract = "BTC_USDT_20200814"; // String | Futures contract
var opts = {
'limit': 100, // Number | Maximum number of records to be returned in a single list
'lastId': "12345", // String | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range
'from': 1546905600, // Number | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned.
'to': 1546935600 // Number | Specify end time in Unix seconds, default to current time
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listDeliveryTrades(settle, contract, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
settle | String | Settle currency | |
contract | String | Futures contract | |
limit | Number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
lastId | String | Specify the starting point for this list based on a previously retrieved id This parameter is deprecated. Use `from` and `to` instead to limit time range | [optional] |
from | Number | Specify starting time in Unix seconds. If not specified, `to` and `limit` will be used to limit response items. If items between `from` and `to` are more than `limit`, only `limit` number will be returned. | [optional] |
to | Number | Specify end time in Unix seconds, default to current time | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[FuturesCandlestick] listDeliveryCandlesticks(settle, contract, opts)
Get futures candlesticks
Return specified contract candlesticks. If prefix `contract` with `mark_`, the contract's mark price candlesticks are returned; if prefix with `index_`, index price candlesticks will be returned. Maximum of 2000 points are returned in one query. Be sure not to exceed the limit when specifying `from`, `to` and `interval`
var GateApi = require('gate-api');
var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var contract = "BTC_USDT_20200814"; // String | Futures contract
var opts = {
'from': 1546905600, // Number | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified
'to': 1546935600, // Number | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time
'limit': 100, // Number | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected.
'interval': '5m' // String | Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listDeliveryCandlesticks(settle, contract, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
settle | String | Settle currency | |
contract | String | Futures contract | |
from | Number | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] |
to | Number | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] |
limit | Number | Maximum recent data points to return. `limit` is conflicted with `from` and `to`. If either `from` or `to` is specified, request will be rejected. | [optional] [default to 100] |
interval | String | Interval time between data points. Note that `1w` means natual week(Mon-Sun), while `7d` means every 7d since unix 0 | [optional] [default to '5m'] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[FuturesTicker] listDeliveryTickers(settle, opts)
List futures tickers
var GateApi = require('gate-api');
var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var opts = {
'contract': "BTC_USDT_20200814" // String | Futures contract
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listDeliveryTickers(settle, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
settle | String | Settle currency | |
contract | String | Futures contract | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
[InsuranceRecord] listDeliveryInsuranceLedger(settle, opts)
Futures insurance balance history
var GateApi = require('gate-api');
var apiInstance = new GateApi.DeliveryApi();
var settle = "usdt"; // String | Settle currency
var opts = {
'limit': 100 // Number | Maximum number of records to be returned in a single list
};
var callback = function(error, data, response) {
if (error) {
console.error(error);
} else {
console.log('API called successfully. Returned data: ' + data);
}
};
apiInstance.listDeliveryInsuranceLedger(settle, opts, callback);
Name | Type | Description | Notes |
---|---|---|---|
settle | String | Settle currency | |
limit | Number | Maximum number of records to be returned in a single list | [optional] [default to 100] |
No authorization required
- Content-Type: Not defined
- Accept: application/json