Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Latest commit

History

History
635 lines (475 loc) · 22.7 KB

File metadata and controls

635 lines (475 loc) · 22.7 KB

gate_api.AlphaApi

All URIs are relative to https://api.gateio.ws/api/v4

MethodHTTP requestDescription
list_alpha_accountsGET /alpha/accountsAlpha Account API
list_alpha_account_bookGET /alpha/account_bookAlpha Account Transaction History API
quote_alpha_orderPOST /alpha/quoteAlpha Quote API
list_alpha_orderGET /alpha/ordersAlpha Order List API
place_alpha_orderPOST /alpha/ordersAlpha Order API
get_alpha_orderGET /alpha/orderAlpha Single Order Query API
list_alpha_currenciesGET /alpha/currenciesQuery currency information
list_alpha_tickersGET /alpha/tickersQuery currency ticker
list_alpha_tokensGET /alpha/tokensQuery Token Information

list_alpha_accounts

list[AccountsResponse] list_alpha_accounts()

Alpha Account API

Query position assets

Example

  • 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)

Parameters

This endpoint does not need any parameter.

Return type

list[AccountsResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Positions queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_account_book

list[AccountBookResponse] list_alpha_account_book(_from, to=to, page=page, limit=limit)

Alpha Account Transaction History API

Query asset transactions

Example

  • 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)

Parameters

NameTypeDescriptionNotes
_fromintStart timestamp for the query
tointEnd timestamp for the query, defaults to current time if not specified[optional]
pageintPage number[optional]
limitintMaximum 100 items per page[optional]

Return type

list[AccountBookResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Transaction history retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

quote_alpha_order

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.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
quote_requestQuoteRequest

Return type

QuoteResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Quote retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_order

list[OrderResponse] list_alpha_order(currency=currency, side=side, status=status, _from=_from, to=to, limit=limit, page=page)

Alpha Order List API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
currencystrTrading symbol[optional]
sidestrBuy or sell orders - buy - sell[optional]
statusintOrder 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]
_fromintStart time for order query[optional]
tointEnd time for order query, defaults to current time if not specified[optional]
limitintMaximum number of items returned. Default: 100, minimum: 1, maximum: 100[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[OrderResponse]

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200List retrieved successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

place_alpha_order

PlaceOrderResponse place_alpha_order(place_order_request)

Alpha Order API

Order placement interface, rate-limited at 5 requests per second per user.

Example

  • 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)

Parameters

NameTypeDescriptionNotes
place_order_requestPlaceOrderRequest

Return type

PlaceOrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order placed successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

get_alpha_order

OrderResponse get_alpha_order(order_id)

Alpha Single Order Query API

Example

  • 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)

Parameters

NameTypeDescriptionNotes
order_idstrOrder ID

Return type

OrderResponse

Authorization

apiv4

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Order queried successfully-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_currencies

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery currency information by currency symbol[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaCurrency]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tickers

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

Example

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)

Parameters

NameTypeDescriptionNotes
currencystrQuery by specified currency name[optional]
limitintMaximum number of records returned in a single list[optional] [default to 100]
pageintPage number[optional] [default to 1]

Return type

list[AlphaTicker]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]

list_alpha_tokens

list[Tokens] list_alpha_tokens(chain=chain, launch_platform=launch_platform, address=address, page=page)

Query Token Information

Supports passing chain, platform, and address

Example

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)

Parameters

NameTypeDescriptionNotes
chainstrQuery Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer[optional]
launch_platformstrQuery Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals[optional]
addressstrQuery Token List by Contract Address[optional]
pageintPage number[optional] [default to 1]

Return type

list[Tokens]

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status codeDescriptionResponse headers
200Query successful-

[Back to top][Back to API list][Back to Model list][Back to README]