All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| list_options_underlyings | GET /options/underlyings | List all underlying assets |
| list_options_expirations | GET /options/expirations | List all expiration dates |
| list_options_contracts | GET /options/contracts | List all contracts for specified underlying and expiration date |
| get_options_contract | GET /options/contracts/{contract} | Query specified contract details |
| list_options_settlements | GET /options/settlements | List settlement history |
| get_options_settlement | GET /options/settlements/{contract} | Get specified contract settlement information |
| list_my_options_settlements | GET /options/my_settlements | Query personal settlement records |
| list_options_order_book | GET /options/order_book | Query options contract order book |
| list_options_tickers | GET /options/tickers | Query options market ticker information |
| list_options_underlying_tickers | GET /options/underlying/tickers/{underlying} | Query underlying ticker information |
| list_options_candlesticks | GET /options/candlesticks | Options contract market candlestick chart |
| list_options_underlying_candlesticks | GET /options/underlying/candlesticks | Underlying index price candlestick chart |
| list_options_trades | GET /options/trades | Market trade records |
| list_options_account | GET /options/accounts | Query account information |
| list_options_account_book | GET /options/account_book | Query account change history |
| list_options_positions | GET /options/positions | List user's positions of specified underlying |
| get_options_position | GET /options/positions/{contract} | Get specified contract position |
| list_options_position_close | GET /options/position_close | List user's liquidation history of specified underlying |
| list_options_orders | GET /options/orders | List options orders |
| create_options_order | POST /options/orders | Create an options order |
| cancel_options_orders | DELETE /options/orders | Cancel all orders with 'open' status |
| get_options_order | GET /options/orders/{order_id} | Query single order details |
| cancel_options_order | DELETE /options/orders/{order_id} | Cancel single order |
| countdown_cancel_all_options | POST /options/countdown_cancel_all | Countdown cancel orders |
| list_my_options_trades | GET /options/my_trades | Query personal trading records |
| get_options_mmp | GET /options/mmp | MMP Query. |
| set_options_mmp | POST /options/mmp | MMP Settings |
| reset_options_mmp | POST /options/mmp/reset | MMP Reset |
list[OptionsUnderlying] list_options_underlyings()
List all underlying assets
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.OptionsApi(api_client)
try:
# List all underlying assets
api_response = api_instance.list_options_underlyings()
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 OptionsApi->list_options_underlyings: %s\n" % e)This endpoint does not need any parameter.
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[int] list_options_expirations(underlying)
List all expiration dates
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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
try:
# List all expiration dates
api_response = api_instance.list_options_expirations(underlying)
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 OptionsApi->list_options_expirations: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) |
list[int]
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List expiration dates for specified underlying | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsContract] list_options_contracts(underlying, expiration=expiration)
List all contracts for specified underlying and expiration date
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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
expiration = 1636588800 # int | Unix timestamp of expiration date (optional)
try:
# List all contracts for specified underlying and expiration date
api_response = api_instance.list_options_contracts(underlying, expiration=expiration)
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 OptionsApi->list_options_contracts: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) | |
| expiration | int | Unix timestamp of expiration date | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsContract get_options_contract(contract)
Query specified contract details
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.OptionsApi(api_client)
contract = 'BTC_USDT-20211130-65000-C' # str |
try:
# Query specified contract details
api_response = api_instance.get_options_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 OptionsApi->get_options_contract: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| contract | str |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsSettlement] list_options_settlements(underlying, limit=limit, offset=offset, _from=_from, to=to)
List settlement 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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
try:
# List settlement history
api_response = api_instance.list_options_settlements(underlying, limit=limit, offset=offset, _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 OptionsApi->list_options_settlements: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) | |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | int | List offset, starting from 0 | [optional] [default to 0] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsSettlement get_options_settlement(contract, underlying, at)
Get specified contract settlement information
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.OptionsApi(api_client)
contract = 'BTC_USDT-20211130-65000-C' # str |
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
at = 56 # int |
try:
# Get specified contract settlement information
api_response = api_instance.get_options_settlement(contract, underlying, 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 OptionsApi->get_options_settlement: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| contract | str | ||
| underlying | str | Underlying (Obtained by listing underlying endpoint) | |
| at | int |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsMySettlements] list_my_options_settlements(underlying, contract=contract, limit=limit, offset=offset, _from=_from, to=to)
Query personal settlement records
- 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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
try:
# Query personal settlement records
api_response = api_instance.list_my_options_settlements(underlying, contract=contract, limit=limit, offset=offset, _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 OptionsApi->list_my_options_settlements: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) | |
| contract | str | Options contract name | [optional] |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | int | List offset, starting from 0 | [optional] [default to 0] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
FuturesOrderBook list_options_order_book(contract, interval=interval, limit=limit, with_id=with_id)
Query options contract 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.OptionsApi(api_client)
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name
interval = '0' # str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified (optional) (default to '0')
limit = 10 # int | Number of depth levels (optional) (default to 10)
with_id = False # bool | Whether to return depth update ID. This ID increments by 1 each time depth changes (optional) (default to False)
try:
# Query options contract order book
api_response = api_instance.list_options_order_book(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 OptionsApi->list_options_order_book: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| contract | str | Options contract name | |
| interval | str | Price precision for depth aggregation, 0 means no aggregation, defaults to 0 if not specified | [optional] [default to '0'] |
| limit | int | Number of depth levels | [optional] [default to 10] |
| with_id | bool | Whether to return depth update ID. This ID increments by 1 each time depth changes | [optional] [default to False] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Depth query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsTicker] list_options_tickers(underlying)
Query options market ticker information
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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
try:
# Query options market ticker information
api_response = api_instance.list_options_tickers(underlying)
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 OptionsApi->list_options_tickers: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsUnderlyingTicker list_options_underlying_tickers(underlying)
Query underlying ticker information
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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying
try:
# Query underlying ticker information
api_response = api_instance.list_options_underlying_tickers(underlying)
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 OptionsApi->list_options_underlying_tickers: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsCandlestick] list_options_candlesticks(contract, limit=limit, _from=_from, to=to, interval=interval)
Options contract market candlestick chart
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.OptionsApi(api_client)
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
interval = '5m' # str | Time interval between data points (optional) (default to '5m')
try:
# Options contract market candlestick chart
api_response = api_instance.list_options_candlesticks(contract, limit=limit, _from=_from, to=to, 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 OptionsApi->list_options_candlesticks: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| contract | str | Options contract name | |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
| interval | str | Time interval between data points | [optional] [default to '5m'] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesCandlestick] list_options_underlying_candlesticks(underlying, limit=limit, _from=_from, to=to, interval=interval)
Underlying index price candlestick chart
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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
interval = '5m' # str | Time interval between data points (optional) (default to '5m')
try:
# Underlying index price candlestick chart
api_response = api_instance.list_options_underlying_candlesticks(underlying, limit=limit, _from=_from, to=to, 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 OptionsApi->list_options_underlying_candlesticks: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) | |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
| interval | str | Time interval between data points | [optional] [default to '5m'] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[FuturesTrade] list_options_trades(contract=contract, type=type, limit=limit, offset=offset, _from=_from, to=to)
Market trade records
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.OptionsApi(api_client)
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional)
type = '1546935600' # str | `C` for call, `P` for put (optional)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
try:
# Market trade records
api_response = api_instance.list_options_trades(contract=contract, type=type, limit=limit, offset=offset, _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 OptionsApi->list_options_trades: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| contract | str | Options contract name | [optional] |
| type | str | `C` for call, `P` for put | [optional] |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | int | List offset, starting from 0 | [optional] [default to 0] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsAccount list_options_account()
Query account information
- 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.OptionsApi(api_client)
try:
# Query account information
api_response = api_instance.list_options_account()
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 OptionsApi->list_options_account: %s\n" % e)This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsAccountBook] list_options_account_book(limit=limit, offset=offset, _from=_from, to=to, type=type)
Query account change 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.OptionsApi(api_client)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
type = 'dnw' # str | Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L (optional)
try:
# Query account change history
api_response = api_instance.list_options_account_book(limit=limit, offset=offset, _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 OptionsApi->list_options_account_book: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | int | List offset, starting from 0 | [optional] [default to 0] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
| type | str | Change types: - dnw: Deposit & Withdrawal - prem: Trading premium - fee: Trading fee - refr: Referrer rebate - set: Settlement P&L | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsPosition] list_options_positions(underlying=underlying)
List user's positions of specified underlying
- 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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (optional)
try:
# List user's positions of specified underlying
api_response = api_instance.list_options_positions(underlying=underlying)
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 OptionsApi->list_options_positions: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsPosition get_options_position(contract)
Get specified contract 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.OptionsApi(api_client)
contract = 'BTC_USDT-20211130-65000-C' # str |
try:
# Get specified contract position
api_response = api_instance.get_options_position(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 OptionsApi->get_options_position: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| contract | str |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsPositionClose] list_options_position_close(underlying, contract=contract)
List user's liquidation history of specified underlying
- 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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional)
try:
# List user's liquidation history of specified underlying
api_response = api_instance.list_options_position_close(underlying, 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 OptionsApi->list_options_position_close: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) | |
| contract | str | Options contract name | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsOrder] list_options_orders(status, contract=contract, underlying=underlying, limit=limit, offset=offset, _from=_from, to=to)
List options 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.OptionsApi(api_client)
status = 'open' # str | Query order list based on status
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional)
underlying = 'BTC_USDT' # str | Underlying (optional)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
try:
# List options orders
api_response = api_instance.list_options_orders(status, contract=contract, underlying=underlying, limit=limit, offset=offset, _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 OptionsApi->list_options_orders: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| status | str | Query order list based on status | |
| contract | str | Options contract name | [optional] |
| underlying | str | Underlying | [optional] |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | int | List offset, starting from 0 | [optional] [default to 0] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsOrder create_options_order(options_order)
Create an options 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.OptionsApi(api_client)
options_order = gate_api.OptionsOrder() # OptionsOrder |
try:
# Create an options order
api_response = api_instance.create_options_order(options_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 OptionsApi->create_options_order: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| options_order | OptionsOrder |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 201 | Order detail | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsOrder] cancel_options_orders(contract=contract, underlying=underlying, side=side)
Cancel all orders with 'open' status
- 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.OptionsApi(api_client)
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional)
underlying = 'BTC_USDT' # str | Underlying (optional)
side = 'ask' # str | Specify all bids or all asks, both included if not specified (optional)
try:
# Cancel all orders with 'open' status
api_response = api_instance.cancel_options_orders(contract=contract, underlying=underlying, 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 OptionsApi->cancel_options_orders: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| contract | str | Options contract name | [optional] |
| underlying | str | Underlying | [optional] |
| side | str | Specify all bids or all asks, both included if not specified | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Batch cancellation successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsOrder get_options_order(order_id)
Query single order details
- 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.OptionsApi(api_client)
order_id = 12345 # int | Order ID returned when order is successfully created
try:
# Query single order details
api_response = api_instance.get_options_order(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 OptionsApi->get_options_order: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| order_id | int | Order ID returned when order is successfully created |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order detail | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsOrder cancel_options_order(order_id)
Cancel 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.OptionsApi(api_client)
order_id = 12345 # int | Order ID returned when order is successfully created
try:
# Cancel single order
api_response = api_instance.cancel_options_order(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 OptionsApi->cancel_options_order: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| order_id | int | Order ID returned when order is successfully created |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order detail | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
TriggerTime countdown_cancel_all_options(countdown_cancel_all_options_task)
Countdown cancel orders
Option order heartbeat detection, when the timeout time set by the user is reached, if the existing countdown is not canceled or a new countdown is set, the related option pending order will be automatically canceled. This interface can be called repeatedly to set a new countdown or cancel the countdown. Usage example: Repeat this interface at intervals of 30 seconds, with each countdown timeout set to 30 (seconds). If this interface is not called again within 30 seconds, all pending orders on the underlying contract you specified will be automatically cancelled. If underlying contract is not specified, user will be automatically cancelled If timeout is set to 0 within 30 seconds, the countdown timer will expire and the automatic order cancellation function will be cancelled.
- 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.OptionsApi(api_client)
countdown_cancel_all_options_task = gate_api.CountdownCancelAllOptionsTask() # CountdownCancelAllOptionsTask |
try:
# Countdown cancel orders
api_response = api_instance.countdown_cancel_all_options(countdown_cancel_all_options_task)
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 OptionsApi->countdown_cancel_all_options: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| countdown_cancel_all_options_task | CountdownCancelAllOptionsTask |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Countdown set successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsMyTrade] list_my_options_trades(underlying, contract=contract, limit=limit, offset=offset, _from=_from, to=to)
Query personal trading records
- 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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (Obtained by listing underlying endpoint)
contract = 'BTC_USDT-20210916-5000-C' # str | Options contract name (optional)
limit = 100 # int | Maximum number of records returned in a single list (optional) (default to 100)
offset = 0 # int | List offset, starting from 0 (optional) (default to 0)
_from = 1547706332 # int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) (optional)
to = 1547706332 # int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp (optional)
try:
# Query personal trading records
api_response = api_instance.list_my_options_trades(underlying, contract=contract, limit=limit, offset=offset, _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 OptionsApi->list_my_options_trades: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying (Obtained by listing underlying endpoint) | |
| contract | str | Options contract name | [optional] |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| offset | int | List offset, starting from 0 | [optional] [default to 0] |
| _from | int | Start timestamp Specify start time, time format is Unix timestamp. If not specified, it defaults to (the data start time of the time range actually returned by to and limit) | [optional] |
| to | int | Termination Timestamp Specify the end time. If not specified, it defaults to the current time, and the time format is a Unix timestamp | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
list[OptionsMMP] get_options_mmp(underlying=underlying)
MMP Query.
- 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.OptionsApi(api_client)
underlying = 'BTC_USDT' # str | Underlying (optional)
try:
# MMP Query.
api_response = api_instance.get_options_mmp(underlying=underlying)
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 OptionsApi->get_options_mmp: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| underlying | str | Underlying | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsMMP set_options_mmp(options_mmp)
MMP Settings
- 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.OptionsApi(api_client)
options_mmp = gate_api.OptionsMMP() # OptionsMMP |
try:
# MMP Settings
api_response = api_instance.set_options_mmp(options_mmp)
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 OptionsApi->set_options_mmp: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| options_mmp | OptionsMMP |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | MMP Information | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
OptionsMMP reset_options_mmp(options_mmp_reset)
MMP Reset
- 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.OptionsApi(api_client)
options_mmp_reset = gate_api.OptionsMMPReset() # OptionsMMPReset |
try:
# MMP Reset
api_response = api_instance.reset_options_mmp(options_mmp_reset)
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 OptionsApi->reset_options_mmp: %s\n" % e)| Name | Type | Description | Notes |
|---|---|---|---|
| options_mmp_reset | OptionsMMPReset |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | MMP Information | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]