All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| list_alpha_accounts | GET /alpha/accounts | Alpha Account API |
| list_alpha_account_book | GET /alpha/account_book | Alpha Account Transaction History API |
| quote_alpha_order | POST /alpha/quote | Alpha Quote API |
| list_alpha_order | GET /alpha/orders | Alpha Order List API |
| place_alpha_order | POST /alpha/orders | Alpha Order API |
| get_alpha_order | GET /alpha/order | Alpha Single Order Query API |
| list_alpha_currencies | GET /alpha/currencies | Query currency information |
| list_alpha_tickers | GET /alpha/tickers | Query currency ticker |
| list_alpha_tokens | GET /alpha/tokens | Query Token Information |
list[AccountsResponse] list_alpha_accounts()
Alpha Account API
Query position assets
- Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 authorizationconfiguration=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 classapi_instance=gate_api.AlphaApi(api_client)
try:
# Alpha Account APIapi_response=api_instance.list_alpha_accounts()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->list_alpha_accounts: %s\n"%e)This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Positions queried successfully | - |
[Back to top][Back to API list][Back to Model list][Back to README]
list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)
Alpha Account Transaction History API
Query asset transactions
- Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 authorizationconfiguration=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 classapi_instance=gate_api.AlphaApi(api_client)
_from=56# int | Start timestamp for the queryto=56# int | End timestamp for the query, defaults to current time if not specified (optional)page=56# int | Page number (optional)limit=56# int | Maximum 100 items per page (optional)try:
# Alpha Account Transaction History APIapi_response=api_instance.list_alpha_account_book(_from, to=to, page=page, limit=limit)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->list_alpha_account_book: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| _from | int | Start timestamp for the query | |
| to | int | End timestamp for the query, defaults to current time if not specified | [optional] |
| page | int | Page number | [optional] |
| limit | int | Maximum 100 items per page | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Transaction history retrieved successfully | - |
[Back to top][Back to API list][Back to Model list][Back to README]
QuoteResponse quote_alpha_order(quote_request)
Alpha Quote API
The quote_id returned by the price inquiry interface is valid for one minute; an order must be placed within this minute. If it times out, a new price inquiry is required. Rate-limited at 10 requests per second per user.
- Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 authorizationconfiguration=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 classapi_instance=gate_api.AlphaApi(api_client)
quote_request=gate_api.QuoteRequest() # QuoteRequest | try:
# Alpha Quote APIapi_response=api_instance.quote_alpha_order(quote_request)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->quote_alpha_order: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| quote_request | QuoteRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Quote retrieved successfully | - |
[Back to top][Back to API list][Back to Model list][Back to README]
list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)
Alpha Order List API
- Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 authorizationconfiguration=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 classapi_instance=gate_api.AlphaApi(api_client)
currency='memeboxsst'# str | Trading symbol (optional)side='buy'# str | Buy or sell orders - buy - sell (optional)status=2# int | Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed (optional)_from=1627706330# int | Start time for order query (optional)to=1635329650# int | End time for order query, defaults to current time if not specified (optional)limit=100# int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 (optional) (default to 100)page=1# int | Page number (optional) (default to 1)try:
# Alpha Order List APIapi_response=api_instance.list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->list_alpha_order: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| currency | str | Trading symbol | [optional] |
| side | str | Buy or sell orders - buy - sell | [optional] |
| status | int | Order Status - `0` : All - `1` : Processing - `2` : Successful - `3` : Failed - `4` : Cancelled - `5` : Buy order placed but transfer not completed - `6` : Order cancelled but transfer not completed | [optional] |
| _from | int | Start time for order query | [optional] |
| to | int | End time for order query, defaults to current time if not specified | [optional] |
| limit | int | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
| page | int | Page number | [optional] [default to 1] |
- 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]
PlaceOrderResponse place_alpha_order(place_order_request)
Alpha Order API
Order placement interface, rate-limited at 5 requests per second per user.
- Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 authorizationconfiguration=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 classapi_instance=gate_api.AlphaApi(api_client)
place_order_request=gate_api.PlaceOrderRequest() # PlaceOrderRequest | try:
# Alpha Order APIapi_response=api_instance.place_alpha_order(place_order_request)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->place_alpha_order: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| place_order_request | PlaceOrderRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order placed successfully | - |
[Back to top][Back to API list][Back to Model list][Back to README]
OrderResponse get_alpha_order(order_id)
Alpha Single Order Query API
- Api Key Authentication (apiv4):
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 authorizationconfiguration=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 classapi_instance=gate_api.AlphaApi(api_client)
order_id='fdaf12321'# str | Order IDtry:
# Alpha Single Order Query APIapi_response=api_instance.get_alpha_order(order_id)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->get_alpha_order: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| order_id | str | Order ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order queried successfully | - |
[Back to top][Back to API list][Back to Model list][Back to README]
list[AlphaCurrency] list_alpha_currencies(currency=currency, limit=limit, page=page)
Query currency information
When currency is provided, query and return specified currency information; when currency is not provided, return paginated currency list
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 classapi_instance=gate_api.AlphaApi(api_client)
currency='memeboxtrump'# str | Query currency information by currency symbol (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)page=1# int | Page number (optional) (default to 1)try:
# Query currency informationapi_response=api_instance.list_alpha_currencies(currency=currency, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->list_alpha_currencies: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| currency | str | Query currency information by currency symbol | [optional] |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| page | int | Page number | [optional] [default to 1] |
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[AlphaTicker] list_alpha_tickers(currency=currency, limit=limit, page=page)
Query currency ticker
When currency is provided, returns ticker information for the specified currency. When currency is not provided, returns paginated ticker list
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 classapi_instance=gate_api.AlphaApi(api_client)
currency='memeboxtrump'# str | Query by specified currency name (optional)limit=100# int | Maximum number of records returned in a single list (optional) (default to 100)page=1# int | Page number (optional) (default to 1)try:
# Query currency tickerapi_response=api_instance.list_alpha_tickers(currency=currency, limit=limit, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->list_alpha_tickers: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| currency | str | Query by specified currency name | [optional] |
| limit | int | Maximum number of records returned in a single list | [optional] [default to 100] |
| page | int | Page number | [optional] [default to 1] |
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[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)
Query Token Information
Supports passing chain, platform, and address
from __future__ importprint_functionimportgate_apifromgate_api.exceptionsimportApiException, 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 classapi_instance=gate_api.AlphaApi(api_client)
chain='solana'# str | Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer (optional)launch_platform='pump'# str | Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals (optional)address='0x1234p'# str | Query Token List by Contract Address (optional)page=1# int | Page number (optional) (default to 1)try:
# Query Token Informationapi_response=api_instance.list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling AlphaApi->list_alpha_tokens: %s\n"%e)| Name | Type | Description | Notes |
|---|---|---|---|
| chain | str | Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer | [optional] |
| launch_platform | str | Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals | [optional] |
| address | str | Query Token List by Contract Address | [optional] |
| page | int | Page number | [optional] [default to 1] |
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]