All URIs are relative to https://api.gateio.ws/api/v4
| Method | HTTP request | Description |
|---|---|---|
| listAlphaAccounts | GET /alpha/accounts | Alpha Account API |
| listAlphaAccountBook | GET /alpha/account_book | Alpha Account Transaction History API |
| quoteAlphaOrder | POST /alpha/quote | Alpha Quote API |
| listAlphaOrder | GET /alpha/orders | Alpha Order List API |
| placeAlphaOrder | POST /alpha/orders | Alpha Order API |
| getAlphaOrder | GET /alpha/order | Alpha Single Order Query API |
| listAlphaCurrencies | GET /alpha/currencies | Query currency information |
| listAlphaTickers | GET /alpha/tickers | Query currency ticker |
| listAlphaTokens | GET /alpha/tokens | Query Token Information |
List<AccountsResponse> listAlphaAccounts()
Alpha Account API
Query position assets
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
AlphaApiapiInstance = newAlphaApi(defaultClient);
try {
List<AccountsResponse> result = apiInstance.listAlphaAccounts();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#listAlphaAccounts");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Positions queried successfully | - |
List<AccountBookResponse> listAlphaAccountBook(from).to(to).page(page).limit(limit).execute();
Alpha Account Transaction History API
Query asset transactions
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
AlphaApiapiInstance = newAlphaApi(defaultClient);
Longfrom = 56L; // Long | Start timestamp for the queryLongto = 56L; // Long | End timestamp for the query, defaults to current time if not specifiedIntegerpage = 56; // Integer | Page numberIntegerlimit = 56; // Integer | Maximum 100 items per pagetry {
List<AccountBookResponse> result = apiInstance.listAlphaAccountBook(from)
.to(to)
.page(page)
.limit(limit)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#listAlphaAccountBook");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| from | Long | Start timestamp for the query | |
| to | Long | End timestamp for the query, defaults to current time if not specified | [optional] |
| page | Integer | Page number | [optional] |
| limit | Integer | Maximum 100 items per page | [optional] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Transaction history retrieved successfully | - |
QuoteResponse quoteAlphaOrder(quoteRequest)
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.
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
AlphaApiapiInstance = newAlphaApi(defaultClient);
QuoteRequestquoteRequest = newQuoteRequest(); // QuoteRequest | try {
QuoteResponseresult = apiInstance.quoteAlphaOrder(quoteRequest);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#quoteAlphaOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| quoteRequest | QuoteRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Quote retrieved successfully | - |
List<OrderResponse> listAlphaOrder().currency(currency).side(side).status(status).from(from).to(to).limit(limit).page(page).execute();
Alpha Order List API
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
AlphaApiapiInstance = newAlphaApi(defaultClient);
Stringcurrency = "memeboxsst"; // String | Trading symbolStringside = "buy"; // String | Buy or sell orders - buy - sellIntegerstatus = 2; // Integer | 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 completedLongfrom = 1627706330L; // Long | Start time for order queryLongto = 1635329650L; // Long | End time for order query, defaults to current time if not specifiedIntegerlimit = 100; // Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100Integerpage = 1; // Integer | Page numbertry {
List<OrderResponse> result = apiInstance.listAlphaOrder()
.currency(currency)
.side(side)
.status(status)
.from(from)
.to(to)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#listAlphaOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Trading symbol | [optional] |
| side | String | Buy or sell orders - buy - sell | [optional] |
| status | Integer | 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 | Long | Start time for order query | [optional] |
| to | Long | End time for order query, defaults to current time if not specified | [optional] |
| limit | Integer | Maximum number of items returned. Default: 100, minimum: 1, maximum: 100 | [optional] [default to 100] |
| page | Integer | Page number | [optional] [default to 1] |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | List retrieved successfully | - |
PlaceOrderResponse placeAlphaOrder(placeOrderRequest)
Alpha Order API
Order placement interface, rate-limited at 5 requests per second per user.
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
AlphaApiapiInstance = newAlphaApi(defaultClient);
PlaceOrderRequestplaceOrderRequest = newPlaceOrderRequest(); // PlaceOrderRequest | try {
PlaceOrderResponseresult = apiInstance.placeAlphaOrder(placeOrderRequest);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#placeAlphaOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| placeOrderRequest | PlaceOrderRequest |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order placed successfully | - |
OrderResponse getAlphaOrder(orderId)
Alpha Single Order Query API
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.auth.*;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
// Configure APIv4 authorization: apiv4defaultClient.setApiKeySecret("YOUR_API_KEY", "YOUR_API_SECRET");
AlphaApiapiInstance = newAlphaApi(defaultClient);
StringorderId = "fdaf12321"; // String | Order IDtry {
OrderResponseresult = apiInstance.getAlphaOrder(orderId);
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#getAlphaOrder");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| orderId | String | Order ID |
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Order queried successfully | - |
List<AlphaCurrency> listAlphaCurrencies().currency(currency).limit(limit).page(page).execute();
Query currency information
When currency is provided, query and return specified currency information; when currency is not provided, return paginated currency list
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
AlphaApiapiInstance = newAlphaApi(defaultClient);
Stringcurrency = "memeboxtrump"; // String | Query currency information by currency symbolIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegerpage = 1; // Integer | Page numbertry {
List<AlphaCurrency> result = apiInstance.listAlphaCurrencies()
.currency(currency)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#listAlphaCurrencies");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Query currency information by currency symbol | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| page | Integer | Page number | [optional] [default to 1] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<AlphaTicker> listAlphaTickers().currency(currency).limit(limit).page(page).execute();
Query currency ticker
When currency is provided, returns ticker information for the specified currency. When currency is not provided, returns paginated ticker list
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
AlphaApiapiInstance = newAlphaApi(defaultClient);
Stringcurrency = "memeboxtrump"; // String | Query by specified currency nameIntegerlimit = 100; // Integer | Maximum number of records returned in a single listIntegerpage = 1; // Integer | Page numbertry {
List<AlphaTicker> result = apiInstance.listAlphaTickers()
.currency(currency)
.limit(limit)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#listAlphaTickers");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| currency | String | Query by specified currency name | [optional] |
| limit | Integer | Maximum number of records returned in a single list | [optional] [default to 100] |
| page | Integer | Page number | [optional] [default to 1] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |
List<Tokens> listAlphaTokens().chain(chain).launchPlatform(launchPlatform).address(address).page(page).execute();
Query Token Information
Supports passing chain, platform, and address
// Import classes:importio.gate.gateapi.ApiClient;
importio.gate.gateapi.ApiException;
importio.gate.gateapi.Configuration;
importio.gate.gateapi.GateApiException;
importio.gate.gateapi.models.*;
importio.gate.gateapi.api.AlphaApi;
publicclassExample {
publicstaticvoidmain(String[] args) {
ApiClientdefaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.gateio.ws/api/v4");
AlphaApiapiInstance = newAlphaApi(defaultClient);
Stringchain = "solana"; // String | Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayerStringlaunchPlatform = "pump"; // String | Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtualsStringaddress = "0x1234p"; // String | Query Token List by Contract AddressIntegerpage = 1; // Integer | Page numbertry {
List<Tokens> result = apiInstance.listAlphaTokens()
.chain(chain)
.launchPlatform(launchPlatform)
.address(address)
.page(page)
.execute();
System.out.println(result);
} catch (GateApiExceptione) {
System.err.println(String.format("Gate api exception, label: %s, message: %s", e.getErrorLabel(), e.getMessage()));
e.printStackTrace();
} catch (ApiExceptione) {
System.err.println("Exception when calling AlphaApi#listAlphaTokens");
System.err.println("Status code: " + e.getCode());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| chain | String | Query Token List by Chain - solana - eth - bsc - base - world - sui - arbitrum - avalanche - polygon - linea - optimism - zksync - gatelayer | [optional] |
| launchPlatform | String | Query Token List by Launch Platform - meteora_dbc - fourmeme - moonshot - pump - raydium_launchlab - letsbonk - gatefun - virtuals | [optional] |
| address | String | Query Token List by Contract Address | [optional] |
| page | Integer | Page number | [optional] [default to 1] |
No authorization required
- Content-Type: Not defined
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Query successful | - |