All URIs are relative to https://api.gateio.ws/api/v4
Method | HTTP request | Description |
---|---|---|
list_delivery_contracts | GET /delivery/{settle}/contracts | List all futures contracts |
get_delivery_contract | GET /delivery/{settle}/contracts/{contract} | Get a single contract |
list_delivery_order_book | GET /delivery/{settle}/order_book | Futures order book |
list_delivery_trades | GET /delivery/{settle}/trades | Futures trading history |
list_delivery_candlesticks | GET /delivery/{settle}/candlesticks | Get futures candlesticks |
list_delivery_tickers | GET /delivery/{settle}/tickers | List futures tickers |
list_delivery_insurance_ledger | GET /delivery/{settle}/insurance | Futures insurance balance history |
list_delivery_accounts | GET /delivery/{settle}/accounts | Query futures account |
list_delivery_account_book | GET /delivery/{settle}/account_book | Query account book |
list_delivery_positions | GET /delivery/{settle}/positions | List all positions of a user |
get_delivery_position | GET /delivery/{settle}/positions/{contract} | Get single position |
update_delivery_position_margin | POST /delivery/{settle}/positions/{contract}/margin | Update position margin |
update_delivery_position_leverage | POST /delivery/{settle}/positions/{contract}/leverage | Update position leverage |
update_delivery_position_risk_limit | POST /delivery/{settle}/positions/{contract}/risk_limit | Update position risk limit |
list_delivery_orders | GET /delivery/{settle}/orders | List futures orders |
create_delivery_order | POST /delivery/{settle}/orders | Create a futures order |
cancel_delivery_orders | DELETE /delivery/{settle}/orders | Cancel all `open` orders matched |
get_delivery_order | GET /delivery/{settle}/orders/{order_id} | Get a single order |
cancel_delivery_order | DELETE /delivery/{settle}/orders/{order_id} | Cancel a single order |
get_my_delivery_trades | GET /delivery/{settle}/my_trades | List personal trading history |
list_delivery_position_close | GET /delivery/{settle}/position_close | List position close history |
list_delivery_liquidates | GET /delivery/{settle}/liquidates | List liquidation history |
list_delivery_settlements | GET /delivery/{settle}/settlements | List settlement history |
list_delivery_risk_limit_tiers | GET /delivery/{settle}/risk_limit_tiers | List risk limit tiers |
list_price_triggered_delivery_orders | GET /delivery/{settle}/price_orders | List all auto orders |
create_price_triggered_delivery_order | POST /delivery/{settle}/price_orders | Create a price-triggered order |
cancel_price_triggered_delivery_order_list | DELETE /delivery/{settle}/price_orders | Cancel all open orders |
get_price_triggered_delivery_order | GET /delivery/{settle}/price_orders/{order_id} | Get a price-triggered order |
cancel_price_triggered_delivery_order | DELETE /delivery/{settle}/price_orders/{order_id} | cancel a price-triggered order |
list[DeliveryContract] list_delivery_contracts(settle)
List all futures contracts
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
try:
# List all futures contracts
api_response = api_instance.list_delivery_contracts(settle)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_contracts: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
DeliveryContract get_delivery_contract(settle, contract)
Get a single contract
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
try:
# Get a single contract
api_response = api_instance.get_delivery_contract(settle, contract)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->get_delivery_contract: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Contract information | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrderBook list_delivery_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id)
Futures order book
Bids will be sorted by price from high to low, while asks sorted reversely
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
interval = '0' # str | Order depth. 0 means no aggregation is applied. default to 0 (optional) (default to '0')
limit = 10 # int | Maximum number of order depth data in asks or bids (optional) (default to 10)
with_id = False # bool | Whether the order book update ID will be returned. This ID increases by 1 on every order book update (optional) (default to False)
try:
# Futures order book
api_response = api_instance.list_delivery_order_book(settle, contract, interval=interval, limit=limit, with_id=with_id)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_order_book: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | |
interval | str | Order depth. 0 means no aggregation is applied. default to 0 | [optional] [default to '0'] |
limit | int | Maximum number of order depth data in asks or bids | [optional] [default to 10] |
with_id | bool | 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
Status code | Description | Response headers |
---|---|---|
200 | Order book retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesTrade] list_delivery_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to)
Futures trading history
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
last_id = '12345' # str | 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 = 1546905600 # int | 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 = 1546935600 # int | Specify end time in Unix seconds, default to current time (optional)
try:
# Futures trading history
api_response = api_instance.list_delivery_trades(settle, contract, limit=limit, last_id=last_id, _from=_from, to=to)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_trades: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
last_id | str | 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 | int | 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 | int | Specify end time in Unix seconds, default to current time | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[DeliveryCandlestick] list_delivery_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval)
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
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
_from = 1546905600 # int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified (optional)
to = 1546935600 # int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time (optional)
limit = 100 # int | 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 = '5m' # str | 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')
try:
# Get futures candlesticks
api_response = api_instance.list_delivery_candlesticks(settle, contract, _from=_from, to=to, limit=limit, interval=interval)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_candlesticks: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | |
_from | int | Start time of candlesticks, formatted in Unix timestamp in seconds. Default to`to - 100 * interval` if not specified | [optional] |
to | int | End time of candlesticks, formatted in Unix timestamp in seconds. Default to current time | [optional] |
limit | int | 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 | str | 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
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesTicker] list_delivery_tickers(settle, contract=contract)
List futures tickers
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract (optional)
try:
# List futures tickers
api_response = api_instance.list_delivery_tickers(settle, contract=contract)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_tickers: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[InsuranceRecord] list_delivery_insurance_ledger(settle, limit=limit)
Futures insurance balance history
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
try:
# Futures insurance balance history
api_response = api_instance.list_delivery_insurance_ledger(settle, limit=limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_insurance_ledger: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
limit | int | 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
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesAccount list_delivery_accounts(settle)
Query futures account
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
try:
# Query futures account
api_response = api_instance.list_delivery_accounts(settle)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_accounts: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesAccountBook] list_delivery_account_book(settle, limit=limit, _from=_from, to=to, type=type)
Query account book
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
_from = 1547706332 # int | Start timestamp (optional)
to = 1547706332 # int | End timestamp (optional)
type = 'dnw' # str | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate (optional)
try:
# Query account book
api_response = api_instance.list_delivery_account_book(settle, limit=limit, _from=_from, to=to, type=type)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_account_book: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
_from | int | Start timestamp | [optional] |
to | int | End timestamp | [optional] |
type | str | Changing Type: - dnw: Deposit & Withdraw - pnl: Profit & Loss by reducing position - fee: Trading fee - refr: Referrer rebate - fund: Funding - point_dnw: POINT Deposit & Withdraw - point_fee: POINT Trading fee - point_refr: POINT Referrer rebate | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[Position] list_delivery_positions(settle)
List all positions of a user
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
try:
# List all positions of a user
api_response = api_instance.list_delivery_positions(settle)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_positions: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position get_delivery_position(settle, contract)
Get single position
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
try:
# Get single position
api_response = api_instance.get_delivery_position(settle, contract)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->get_delivery_position: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Position information | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position update_delivery_position_margin(settle, contract, change)
Update position margin
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
change = '0.01' # str | Margin change. Use positive number to increase margin, negative number otherwise.
try:
# Update position margin
api_response = api_instance.update_delivery_position_margin(settle, contract, change)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->update_delivery_position_margin: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | |
change | str | Margin change. Use positive number to increase margin, negative number otherwise. |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Position information | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position update_delivery_position_leverage(settle, contract, leverage)
Update position leverage
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
leverage = '10' # str | New position leverage
try:
# Update position leverage
api_response = api_instance.update_delivery_position_leverage(settle, contract, leverage)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->update_delivery_position_leverage: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | |
leverage | str | New position leverage |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Position information | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
Position update_delivery_position_risk_limit(settle, contract, risk_limit)
Update position risk limit
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
risk_limit = '10' # str | New position risk limit
try:
# Update position risk limit
api_response = api_instance.update_delivery_position_risk_limit(settle, contract, risk_limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->update_delivery_position_risk_limit: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | |
risk_limit | str | New position risk limit |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Position information | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesOrder] list_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
List futures orders
Zero-filled order cannot be retrieved 10 minutes after order cancellation
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
status = 'open' # str | Only list the orders with this status
contract = 'BTC_USDT_20200814' # str | Futures contract (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional)
count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (optional) (default to 0)
try:
# List futures orders
api_response = api_instance.list_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_orders: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
status | str | Only list the orders with this status | |
contract | str | Futures contract | [optional] |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | int | List offset, starting from 0 | [optional] [default to 0] |
last_id | str | Specify list staring point using the `id` of last record in previous list-query results | [optional] |
count_total | int | Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | * X-Pagination-Limit - Request limit specified * X-Pagination-Offset - Request offset specified * X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1 |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrder create_delivery_order(settle, futures_order)
Create a futures order
Zero-filled order cannot be retrieved 10 minutes after order cancellation
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
futures_order = gate_api.FuturesOrder() # FuturesOrder |
try:
# Create a futures order
api_response = api_instance.create_delivery_order(settle, futures_order)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->create_delivery_order: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
futures_order | FuturesOrder |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Order details | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesOrder] cancel_delivery_orders(settle, contract, side=side)
Cancel all open
orders matched
Zero-filled order cannot be retrieved 10 minutes after order cancellation
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract
side = 'ask' # str | All bids or asks. Both included if not specified (optional)
try:
# Cancel all `open` orders matched
api_response = api_instance.cancel_delivery_orders(settle, contract, side=side)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->cancel_delivery_orders: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | |
side | str | All bids or asks. Both included if not specified | [optional] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | All orders matched cancelled | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrder get_delivery_order(settle, order_id)
Get a single order
Zero-filled order cannot be retrieved 10 minutes after order cancellation
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
order_id = '12345' # str | Retrieve the data of the order with the specified ID
try:
# Get a single order
api_response = api_instance.get_delivery_order(settle, order_id)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->get_delivery_order: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
order_id | str | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Order details | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrder cancel_delivery_order(settle, order_id)
Cancel a single order
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
order_id = '12345' # str | Retrieve the data of the order with the specified ID
try:
# Cancel a single order
api_response = api_instance.cancel_delivery_order(settle, order_id)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->cancel_delivery_order: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
order_id | str | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Order details | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[MyFuturesTrade] get_my_delivery_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
List personal trading history
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract (optional)
order = 12345 # int | Futures order ID, return related data only if specified (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
last_id = '12345' # str | Specify list staring point using the `id` of last record in previous list-query results (optional)
count_total = 0 # int | Whether to return total number matched. Default to 0(no return) (optional) (default to 0)
try:
# List personal trading history
api_response = api_instance.get_my_delivery_trades(settle, contract=contract, order=order, limit=limit, offset=offset, last_id=last_id, count_total=count_total)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->get_my_delivery_trades: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | [optional] |
order | int | Futures order ID, return related data only if specified | [optional] |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | int | List offset, starting from 0 | [optional] [default to 0] |
last_id | str | Specify list staring point using the `id` of last record in previous list-query results | [optional] |
count_total | int | Whether to return total number matched. Default to 0(no return) | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | * X-Pagination-Limit - Request limit specified * X-Pagination-Offset - Request offset specified * X-Pagination-Total - Total number matched. Only returned if `count_total` set to 1 |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[PositionClose] list_delivery_position_close(settle, contract=contract, limit=limit)
List position close history
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
try:
# List position close history
api_response = api_instance.list_delivery_position_close(settle, contract=contract, limit=limit)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_position_close: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | [optional] |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesLiquidate] list_delivery_liquidates(settle, contract=contract, limit=limit, at=at)
List liquidation history
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
at = 0 # int | Specify a liquidation timestamp (optional) (default to 0)
try:
# List liquidation history
api_response = api_instance.list_delivery_liquidates(settle, contract=contract, limit=limit, at=at)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_liquidates: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | [optional] |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
at | int | Specify a liquidation timestamp | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[DeliverySettlement] list_delivery_settlements(settle, contract=contract, limit=limit, at=at)
List settlement history
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
at = 0 # int | Specify a settlement timestamp (optional) (default to 0)
try:
# List settlement history
api_response = api_instance.list_delivery_settlements(settle, contract=contract, limit=limit, at=at)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_settlements: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | [optional] |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
at | int | Specify a settlement timestamp | [optional] [default to 0] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesLimitRiskTiers] list_delivery_risk_limit_tiers(settle, contract=contract, limit=limit, offset=offset)
List risk limit tiers
When the 'contract' parameter is not passed, the default is to query the risk limits for the top 100 markets.'Limit' and 'offset' correspond to pagination queries at the market level, not to the length of the returned array. This only takes effect when the 'contract' parameter is empty.
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT_20200814' # str | Futures contract (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
try:
# List risk limit tiers
api_response = api_instance.list_delivery_risk_limit_tiers(settle, contract=contract, limit=limit, offset=offset)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_delivery_risk_limit_tiers: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract | [optional] |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | int | List offset, starting from 0 | [optional] [default to 0] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successfully retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesPriceTriggeredOrder] list_price_triggered_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset)
List all auto orders
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
status = 'status_example' # str | Only list the orders with this status
contract = 'BTC_USDT' # str | Futures contract, return related data only if specified (optional)
limit = 100 # int | Maximum number of records to be returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
try:
# List all auto orders
api_response = api_instance.list_price_triggered_delivery_orders(settle, status, contract=contract, limit=limit, offset=offset)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->list_price_triggered_delivery_orders: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
status | str | Only list the orders with this status | |
contract | str | Futures contract, return related data only if specified | [optional] |
limit | int | Maximum number of records to be returned in a single list | [optional] [default to 100] |
offset | int | List offset, starting from 0 | [optional] [default to 0] |
list[FuturesPriceTriggeredOrder]
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | List retrieved | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TriggerOrderResponse create_price_triggered_delivery_order(settle, futures_price_triggered_order)
Create a price-triggered order
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
futures_price_triggered_order = gate_api.FuturesPriceTriggeredOrder() # FuturesPriceTriggeredOrder |
try:
# Create a price-triggered order
api_response = api_instance.create_price_triggered_delivery_order(settle, futures_price_triggered_order)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->create_price_triggered_delivery_order: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
futures_price_triggered_order | FuturesPriceTriggeredOrder |
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
201 | Order created | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesPriceTriggeredOrder] cancel_price_triggered_delivery_order_list(settle, contract)
Cancel all open orders
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
contract = 'BTC_USDT' # str | Futures contract
try:
# Cancel all open orders
api_response = api_instance.cancel_price_triggered_delivery_order_list(settle, contract)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->cancel_price_triggered_delivery_order_list: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
contract | str | Futures contract |
list[FuturesPriceTriggeredOrder]
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Batch cancellation request accepted. Query order status by listing orders | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesPriceTriggeredOrder get_price_triggered_delivery_order(settle, order_id)
Get a price-triggered order
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID
try:
# Get a price-triggered order
api_response = api_instance.get_price_triggered_delivery_order(settle, order_id)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->get_price_triggered_delivery_order: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
order_id | str | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Auto order detail | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesPriceTriggeredOrder cancel_price_triggered_delivery_order(settle, order_id)
cancel a price-triggered order
- Api Key Authentication (apiv4):
from __future__ import print_function
import gate_api
from gate_api.exceptions import ApiException, GateApiException
# Defining the host is optional and defaults to https://api.gateio.ws/api/v4
# See configuration.py for a list of all supported configuration parameters.
# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.
# Configure APIv4 key authorization
configuration = gate_api.Configuration(
host = "https://api.gateio.ws/api/v4",
key = "YOU_API_KEY",
secret = "YOUR_API_SECRET"
)
api_client = gate_api.ApiClient(configuration)
# Create an instance of the API class
api_instance = gate_api.DeliveryApi(api_client)
settle = 'usdt' # str | Settle currency
order_id = 'order_id_example' # str | Retrieve the data of the order with the specified ID
try:
# cancel a price-triggered order
api_response = api_instance.cancel_price_triggered_delivery_order(settle, order_id)
print(api_response)
except GateApiException as ex:
print("Gate api exception, label: %s, message: %s\n" % (ex.label, ex.message))
except ApiException as e:
print("Exception when calling DeliveryApi->cancel_price_triggered_delivery_order: %s\n" % e)
Name | Type | Description | Notes |
---|---|---|---|
settle | str | Settle currency | |
order_id | str | Retrieve the data of the order with the specified ID |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Auto order detail | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]