Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Repository files navigation

Important

This repository has been archived and is no longer maintained. The project has moved to gate/gateapi-python. Please use the new repository for updates, issues, and pull requests.

gate-api

Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v4.105.8
  • Package version: 7.1.8
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.gate.com/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

You can install directly using:

pip install --user gate-api

Then import the package:

importgate_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importgate_api

Getting Started

Please follow the installation procedure and then run the following:

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.EarnUniApi(api_client)
try:
# Query lending currency listapi_response=api_instance.list_uni_currencies()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n"%e)

For a more complete API usage example, refer to the demo application in example directory

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
EarnUniApilist_uni_currenciesGET /earn/uni/currenciesQuery lending currency list
EarnUniApiget_uni_currencyGET /earn/uni/currencies/{currency}Query single lending currency details
EarnUniApilist_user_uni_lendsGET /earn/uni/lendsQuery user's lending order list
EarnUniApicreate_uni_lendPOST /earn/uni/lendsCreate lending or redemption
EarnUniApichange_uni_lendPATCH /earn/uni/lendsAmend user lending information
EarnUniApilist_uni_lend_recordsGET /earn/uni/lend_recordsQuery lending transaction records
EarnUniApiget_uni_interestGET /earn/uni/interests/{currency}Query user's total interest income for specified currency
EarnUniApilist_uni_interest_recordsGET /earn/uni/interest_recordsQuery user dividend records
EarnUniApiget_uni_interest_statusGET /earn/uni/interest_status/{currency}Query currency interest compounding status
EarnUniApilist_uni_chartGET /earn/uni/chartUniLoan currency annualized trend chart
EarnUniApilist_uni_rateGET /earn/uni/rateCurrency estimated annualized interest rate
MarginUniApilist_uni_currency_pairsGET /margin/uni/currency_pairsList lending markets
MarginUniApiget_uni_currency_pairGET /margin/uni/currency_pairs/{currency_pair}Get lending market details
MarginUniApiget_margin_uni_estimate_rateGET /margin/uni/estimate_rateEstimate interest rate for isolated margin currencies
MarginUniApilist_uni_loansGET /margin/uni/loansQuery loans
MarginUniApicreate_uni_loanPOST /margin/uni/loansBorrow or repay
MarginUniApilist_uni_loan_recordsGET /margin/uni/loan_recordsQuery loan records
MarginUniApilist_uni_loan_interest_recordsGET /margin/uni/interest_recordsQuery interest deduction records
MarginUniApiget_uni_borrowableGET /margin/uni/borrowableQuery maximum borrowable amount by currency
SubAccountApilist_sub_accountsGET /sub_accountsList sub-accounts
SubAccountApicreate_sub_accountsPOST /sub_accountsCreate a new sub-account
SubAccountApiget_sub_accountGET /sub_accounts/{user_id}Get sub-account
SubAccountApilist_sub_account_keysGET /sub_accounts/{user_id}/keysList all API key pairs of the sub-account
SubAccountApicreate_sub_account_keysPOST /sub_accounts/{user_id}/keysCreate new sub-account API key pair
SubAccountApiget_sub_account_keyGET /sub_accounts/{user_id}/keys/{key}Get specific API key pair of the sub-account
SubAccountApiupdate_sub_account_keysPUT /sub_accounts/{user_id}/keys/{key}Update sub-account API key pair
SubAccountApidelete_sub_account_keysDELETE /sub_accounts/{user_id}/keys/{key}Delete sub-account API key pair
SubAccountApilock_sub_accountPOST /sub_accounts/{user_id}/lockLock sub-account
SubAccountApiunlock_sub_accountPOST /sub_accounts/{user_id}/unlockUnlock sub-account
SubAccountApilist_unified_modeGET /sub_accounts/unified_modeGet sub-account mode
UnifiedApilist_unified_accountsGET /unified/accountsGet unified account information
UnifiedApiget_unified_borrowableGET /unified/borrowableQuery maximum borrowable amount for unified account
UnifiedApiget_unified_transferableGET /unified/transferableQuery maximum transferable amount for unified account
UnifiedApiget_unified_transferablesGET /unified/transferablesBatch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
UnifiedApiget_unified_borrowable_listGET /unified/batch_borrowableBatch query unified account maximum borrowable amount
UnifiedApilist_unified_loansGET /unified/loansQuery loans
UnifiedApicreate_unified_loanPOST /unified/loansBorrow or repay
UnifiedApilist_unified_loan_recordsGET /unified/loan_recordsQuery loan records
UnifiedApilist_unified_loan_interest_recordsGET /unified/interest_recordsQuery interest deduction records
UnifiedApiget_unified_risk_unitsGET /unified/risk_unitsGet user risk unit details
UnifiedApiget_unified_modeGET /unified/unified_modeQuery mode of the unified account
UnifiedApiset_unified_modePUT /unified/unified_modeSet unified account mode
UnifiedApiget_unified_estimate_rateGET /unified/estimate_rateQuery unified account estimated interest rate
UnifiedApilist_currency_discount_tiersGET /unified/currency_discount_tiersQuery unified account tiered
UnifiedApilist_loan_margin_tiersGET /unified/loan_margin_tiersQuery unified account tiered loan margin
UnifiedApicalculate_portfolio_marginPOST /unified/portfolio_calculatorPortfolio margin calculator
UnifiedApiget_user_leverage_currency_configGET /unified/leverage/user_currency_configMaximum and minimum currency leverage that can be set
UnifiedApiget_user_leverage_currency_settingGET /unified/leverage/user_currency_settingGet user currency leverage
UnifiedApiset_user_leverage_currency_settingPOST /unified/leverage/user_currency_settingSet loan currency leverage
UnifiedApilist_unified_currenciesGET /unified/currenciesList of loan currencies supported by unified account
UnifiedApiget_history_loan_rateGET /unified/history_loan_rateGet historical lending rates
UnifiedApiset_unified_collateralPOST /unified/collateral_currenciesSet collateral currency
AccountApiget_account_detailGET /account/detailRetrieve user account information
AccountApiget_account_rate_limitGET /account/rate_limitGet user transaction rate limit information
AccountApilist_stp_groupsGET /account/stp_groupsQuery STP user groups created by the user
AccountApicreate_stp_groupPOST /account/stp_groupsCreate STP user group
AccountApilist_stp_groups_usersGET /account/stp_groups/{stp_id}/usersQuery users in the STP user group
AccountApiadd_stp_group_usersPOST /account/stp_groups/{stp_id}/usersAdd users to the STP user group
AccountApidelete_stp_group_usersDELETE /account/stp_groups/{stp_id}/usersDelete users from the STP user group
AccountApiget_debit_feeGET /account/debit_feeQuery GT fee deduction configuration
AccountApiset_debit_feePOST /account/debit_feeConfigure GT fee deduction
CollateralLoanApilist_collateral_loan_ordersGET /loan/collateral/ordersQuery collateral loan order list
CollateralLoanApicreate_collateral_loanPOST /loan/collateral/ordersPlace collateral loan order
CollateralLoanApiget_collateral_loan_order_detailGET /loan/collateral/orders/{order_id}Query single order details
CollateralLoanApirepay_collateral_loanPOST /loan/collateral/repayCollateral loan repayment
CollateralLoanApilist_repay_recordsGET /loan/collateral/repay_recordsQuery collateral loan repayment records
CollateralLoanApilist_collateral_recordsGET /loan/collateral/collateralsQuery collateral adjustment records
CollateralLoanApioperate_collateralPOST /loan/collateral/collateralsIncrease or redeem collateral
CollateralLoanApiget_user_total_amountGET /loan/collateral/total_amountQuery user's total borrowing and collateral amount
CollateralLoanApiget_user_ltv_infoGET /loan/collateral/ltvQuery user's collateralization ratio and remaining borrowable currencies
CollateralLoanApilist_collateral_currenciesGET /loan/collateral/currenciesQuery supported borrowing and collateral currencies
DeliveryApilist_delivery_contractsGET /delivery/{settle}/contractsQuery all futures contracts
DeliveryApiget_delivery_contractGET /delivery/{settle}/contracts/{contract}Query single contract information
DeliveryApilist_delivery_order_bookGET /delivery/{settle}/order_bookQuery futures market depth information
DeliveryApilist_delivery_tradesGET /delivery/{settle}/tradesFutures market transaction records
DeliveryApilist_delivery_candlesticksGET /delivery/{settle}/candlesticksFutures market K-line chart
DeliveryApilist_delivery_tickersGET /delivery/{settle}/tickersGet all futures trading statistics
DeliveryApilist_delivery_insurance_ledgerGET /delivery/{settle}/insuranceFutures market insurance fund history
DeliveryApilist_delivery_accountsGET /delivery/{settle}/accountsGet futures account
DeliveryApilist_delivery_account_bookGET /delivery/{settle}/account_bookQuery futures account change history
DeliveryApilist_delivery_positionsGET /delivery/{settle}/positionsGet user position list
DeliveryApiget_delivery_positionGET /delivery/{settle}/positions/{contract}Get single position information
DeliveryApiupdate_delivery_position_marginPOST /delivery/{settle}/positions/{contract}/marginUpdate position margin
DeliveryApiupdate_delivery_position_leveragePOST /delivery/{settle}/positions/{contract}/leverageUpdate position leverage
DeliveryApiupdate_delivery_position_risk_limitPOST /delivery/{settle}/positions/{contract}/risk_limitUpdate position risk limit
DeliveryApilist_delivery_ordersGET /delivery/{settle}/ordersQuery futures order list
DeliveryApicreate_delivery_orderPOST /delivery/{settle}/ordersPlace futures order
DeliveryApicancel_delivery_ordersDELETE /delivery/{settle}/ordersCancel all orders with 'open' status
DeliveryApiget_delivery_orderGET /delivery/{settle}/orders/{order_id}Query single order details
DeliveryApicancel_delivery_orderDELETE /delivery/{settle}/orders/{order_id}Cancel single order
DeliveryApiget_my_delivery_tradesGET /delivery/{settle}/my_tradesQuery personal trading records
DeliveryApilist_delivery_position_closeGET /delivery/{settle}/position_closeQuery position close history
DeliveryApilist_delivery_liquidatesGET /delivery/{settle}/liquidatesQuery liquidation history
DeliveryApilist_delivery_settlementsGET /delivery/{settle}/settlementsQuery settlement records
DeliveryApilist_delivery_risk_limit_tiersGET /delivery/{settle}/risk_limit_tiersQuery risk limit tiers
DeliveryApilist_price_triggered_delivery_ordersGET /delivery/{settle}/price_ordersQuery auto order list
DeliveryApicreate_price_triggered_delivery_orderPOST /delivery/{settle}/price_ordersCreate price-triggered order
DeliveryApicancel_price_triggered_delivery_order_listDELETE /delivery/{settle}/price_ordersCancel all auto orders
DeliveryApiget_price_triggered_delivery_orderGET /delivery/{settle}/price_orders/{order_id}Query single auto order details
DeliveryApicancel_price_triggered_delivery_orderDELETE /delivery/{settle}/price_orders/{order_id}Cancel single auto order
EarnApiswap_eth2POST /earn/staking/eth2/swapETH2 swap
EarnApirate_list_eth2GET /earn/staking/eth2/rate_recordsETH2 historical return rate query
EarnApilist_dual_investment_plansGET /earn/dual/investment_planDual Investment product list
EarnApilist_dual_ordersGET /earn/dual/ordersDual Investment order list
EarnApiplace_dual_orderPOST /earn/dual/ordersPlace Dual Investment order
EarnApilist_structured_productsGET /earn/structured/productsStructured Product List
EarnApilist_structured_ordersGET /earn/structured/ordersStructured Product Order List
EarnApiplace_structured_orderPOST /earn/structured/ordersPlace Structured Product Order
EarnApifind_coinGET /earn/staking/coinsStaking coins
EarnApiswap_staking_coinPOST /earn/staking/swapOn-chain token swap for earned coins
FlashSwapApilist_flash_swap_currency_pairGET /flash_swap/currency_pairsList All Supported Currency Pairs In Flash Swap
FlashSwapApilist_flash_swap_ordersGET /flash_swap/ordersQuery flash swap order list
FlashSwapApicreate_flash_swap_orderPOST /flash_swap/ordersCreate a flash swap order
FlashSwapApiget_flash_swap_orderGET /flash_swap/orders/{order_id}Query single flash swap order
FlashSwapApipreview_flash_swap_orderPOST /flash_swap/orders/previewFlash swap order preview
FuturesApilist_futures_contractsGET /futures/{settle}/contractsQuery all futures contracts
FuturesApiget_futures_contractGET /futures/{settle}/contracts/{contract}Query single contract information
FuturesApilist_futures_order_bookGET /futures/{settle}/order_bookQuery futures market depth information
FuturesApilist_futures_tradesGET /futures/{settle}/tradesFutures market transaction records
FuturesApilist_futures_candlesticksGET /futures/{settle}/candlesticksFutures market K-line chart
FuturesApilist_futures_premium_indexGET /futures/{settle}/premium_indexPremium Index K-line chart
FuturesApilist_futures_tickersGET /futures/{settle}/tickersGet all futures trading statistics
FuturesApilist_futures_funding_rate_historyGET /futures/{settle}/funding_rateFutures market historical funding rate
FuturesApilist_futures_insurance_ledgerGET /futures/{settle}/insuranceFutures market insurance fund history
FuturesApilist_contract_statsGET /futures/{settle}/contract_statsFutures statistics
FuturesApiget_index_constituentsGET /futures/{settle}/index_constituents/{index}Query index constituents
FuturesApilist_liquidated_ordersGET /futures/{settle}/liq_ordersQuery liquidation order history
FuturesApilist_futures_risk_limit_tiersGET /futures/{settle}/risk_limit_tiersQuery risk limit tiers
FuturesApilist_futures_accountsGET /futures/{settle}/accountsGet futures account
FuturesApilist_futures_account_bookGET /futures/{settle}/account_bookQuery futures account change history
FuturesApilist_positionsGET /futures/{settle}/positionsGet user position list
FuturesApiget_positionGET /futures/{settle}/positions/{contract}Get single position information
FuturesApiupdate_position_marginPOST /futures/{settle}/positions/{contract}/marginUpdate position margin
FuturesApiupdate_position_leveragePOST /futures/{settle}/positions/{contract}/leverageUpdate position leverage
FuturesApiupdate_position_cross_modePOST /futures/{settle}/positions/cross_modeSwitch Position Margin Mode
FuturesApiupdate_dual_comp_position_cross_modePOST /futures/{settle}/dual_comp/positions/cross_modeSwitch Between Cross and Isolated Margin Modes Under Hedge Mode
FuturesApiupdate_position_risk_limitPOST /futures/{settle}/positions/{contract}/risk_limitUpdate position risk limit
FuturesApiset_dual_modePOST /futures/{settle}/dual_modeSet position mode
FuturesApiget_dual_mode_positionGET /futures/{settle}/dual_comp/positions/{contract}Get position information in dual mode
FuturesApiupdate_dual_mode_position_marginPOST /futures/{settle}/dual_comp/positions/{contract}/marginUpdate position margin in dual mode
FuturesApiupdate_dual_mode_position_leveragePOST /futures/{settle}/dual_comp/positions/{contract}/leverageUpdate position leverage in dual mode
FuturesApiupdate_dual_mode_position_risk_limitPOST /futures/{settle}/dual_comp/positions/{contract}/risk_limitUpdate position risk limit in dual mode
FuturesApilist_futures_ordersGET /futures/{settle}/ordersQuery futures order list
FuturesApicreate_futures_orderPOST /futures/{settle}/ordersPlace futures order
FuturesApicancel_futures_ordersDELETE /futures/{settle}/ordersCancel all orders with 'open' status
FuturesApiget_orders_with_time_rangeGET /futures/{settle}/orders_timerangeQuery futures order list by time range
FuturesApicreate_batch_futures_orderPOST /futures/{settle}/batch_ordersPlace batch futures orders
FuturesApiget_futures_orderGET /futures/{settle}/orders/{order_id}Query single order details
FuturesApiamend_futures_orderPUT /futures/{settle}/orders/{order_id}Amend single order
FuturesApicancel_futures_orderDELETE /futures/{settle}/orders/{order_id}Cancel single order
FuturesApiget_my_tradesGET /futures/{settle}/my_tradesQuery personal trading records
FuturesApiget_my_trades_with_time_rangeGET /futures/{settle}/my_trades_timerangeQuery personal trading records by time range
FuturesApilist_position_closeGET /futures/{settle}/position_closeQuery position close history
FuturesApilist_liquidatesGET /futures/{settle}/liquidatesQuery liquidation history
FuturesApilist_auto_deleveragesGET /futures/{settle}/auto_deleveragesQuery ADL auto-deleveraging order information
FuturesApicountdown_cancel_all_futuresPOST /futures/{settle}/countdown_cancel_allCountdown cancel orders
FuturesApiget_futures_feeGET /futures/{settle}/feeQuery futures market trading fee rates
FuturesApicancel_batch_future_ordersPOST /futures/{settle}/batch_cancel_ordersCancel batch orders by specified ID list
FuturesApiamend_batch_future_ordersPOST /futures/{settle}/batch_amend_ordersBatch modify orders by specified IDs
FuturesApiget_futures_risk_limit_tableGET /futures/{settle}/risk_limit_tableQuery risk limit table by table_id
FuturesApilist_price_triggered_ordersGET /futures/{settle}/price_ordersQuery auto order list
FuturesApicreate_price_triggered_orderPOST /futures/{settle}/price_ordersCreate price-triggered order
FuturesApicancel_price_triggered_order_listDELETE /futures/{settle}/price_ordersCancel all auto orders
FuturesApiget_price_triggered_orderGET /futures/{settle}/price_orders/{order_id}Query single auto order details
FuturesApicancel_price_triggered_orderDELETE /futures/{settle}/price_orders/{order_id}Cancel single auto order
MarginApilist_margin_accountsGET /margin/accountsMargin account list
MarginApilist_margin_account_bookGET /margin/account_bookQuery margin account balance change history
MarginApilist_funding_accountsGET /margin/funding_accountsFunding account list
MarginApiget_auto_repay_statusGET /margin/auto_repayQuery user auto repayment settings
MarginApiset_auto_repayPOST /margin/auto_repayUpdate user auto repayment settings
MarginApiget_margin_transferableGET /margin/transferableGet maximum transferable amount for isolated margin
MarginApiget_user_margin_tierGET /margin/user/loan_margin_tiersQuery user's own leverage lending tiers in current market
MarginApiget_market_margin_tierGET /margin/loan_margin_tiersQuery current market leverage lending tiers
MarginApiset_user_market_leveragePOST /margin/leverage/user_market_settingSet user market leverage multiplier
MarginApilist_margin_user_accountGET /margin/user/accountQuery user's isolated margin account list
MarginApilist_cross_margin_loansGET /margin/cross/loansQuery cross margin borrow history (deprecated)
MarginApilist_cross_margin_repaymentsGET /margin/cross/repaymentsRetrieve cross margin repayments. (deprecated)
MultiCollateralLoanApilist_multi_collateral_ordersGET /loan/multi_collateral/ordersQuery multi-currency collateral order list
MultiCollateralLoanApicreate_multi_collateralPOST /loan/multi_collateral/ordersPlace multi-currency collateral order
MultiCollateralLoanApiget_multi_collateral_order_detailGET /loan/multi_collateral/orders/{order_id}Query order details
MultiCollateralLoanApilist_multi_repay_recordsGET /loan/multi_collateral/repayQuery multi-currency collateral repayment records
MultiCollateralLoanApirepay_multi_collateral_loanPOST /loan/multi_collateral/repayMulti-currency collateral repayment
MultiCollateralLoanApilist_multi_collateral_recordsGET /loan/multi_collateral/mortgageQuery collateral adjustment records
MultiCollateralLoanApioperate_multi_collateralPOST /loan/multi_collateral/mortgageAdd or withdraw collateral
MultiCollateralLoanApilist_user_currency_quotaGET /loan/multi_collateral/currency_quotaQuery user's collateral and borrowing currency quota information
MultiCollateralLoanApilist_multi_collateral_currenciesGET /loan/multi_collateral/currenciesQuery supported borrowing and collateral currencies for multi-currency collateral
MultiCollateralLoanApiget_multi_collateral_ltvGET /loan/multi_collateral/ltvQuery collateralization ratio information
MultiCollateralLoanApiget_multi_collateral_fix_rateGET /loan/multi_collateral/fixed_rateQuery currency's 7-day and 30-day fixed interest rates
MultiCollateralLoanApiget_multi_collateral_current_rateGET /loan/multi_collateral/current_rateQuery currency's current interest rate
OptionsApilist_options_underlyingsGET /options/underlyingsList all underlying assets
OptionsApilist_options_expirationsGET /options/expirationsList all expiration dates
OptionsApilist_options_contractsGET /options/contractsList all contracts for specified underlying and expiration date
OptionsApiget_options_contractGET /options/contracts/{contract}Query specified contract details
OptionsApilist_options_settlementsGET /options/settlementsList settlement history
OptionsApiget_options_settlementGET /options/settlements/{contract}Get specified contract settlement information
OptionsApilist_my_options_settlementsGET /options/my_settlementsQuery personal settlement records
OptionsApilist_options_order_bookGET /options/order_bookQuery options contract order book
OptionsApilist_options_tickersGET /options/tickersQuery options market ticker information
OptionsApilist_options_underlying_tickersGET /options/underlying/tickers/{underlying}Query underlying ticker information
OptionsApilist_options_candlesticksGET /options/candlesticksOptions contract market candlestick chart
OptionsApilist_options_underlying_candlesticksGET /options/underlying/candlesticksUnderlying index price candlestick chart
OptionsApilist_options_tradesGET /options/tradesMarket trade records
OptionsApilist_options_accountGET /options/accountsQuery account information
OptionsApilist_options_account_bookGET /options/account_bookQuery account change history
OptionsApilist_options_positionsGET /options/positionsList user's positions of specified underlying
OptionsApiget_options_positionGET /options/positions/{contract}Get specified contract position
OptionsApilist_options_position_closeGET /options/position_closeList user's liquidation history of specified underlying
OptionsApilist_options_ordersGET /options/ordersList options orders
OptionsApicreate_options_orderPOST /options/ordersCreate an options order
OptionsApicancel_options_ordersDELETE /options/ordersCancel all orders with 'open' status
OptionsApiget_options_orderGET /options/orders/{order_id}Query single order details
OptionsApicancel_options_orderDELETE /options/orders/{order_id}Cancel single order
OptionsApicountdown_cancel_all_optionsPOST /options/countdown_cancel_allCountdown cancel orders
OptionsApilist_my_options_tradesGET /options/my_tradesQuery personal trading records
OptionsApiget_options_mmpGET /options/mmpMMP Query.
OptionsApiset_options_mmpPOST /options/mmpMMP Settings
OptionsApireset_options_mmpPOST /options/mmp/resetMMP Reset
RebateApiagency_transaction_historyGET /rebate/agency/transaction_historyBroker obtains transaction history of recommended users
RebateApiagency_commissions_historyGET /rebate/agency/commission_historyBroker obtains rebate history of recommended users
RebateApipartner_transaction_historyGET /rebate/partner/transaction_historyPartner obtains transaction history of recommended users
RebateApipartner_commissions_historyGET /rebate/partner/commission_historyPartner obtains rebate records of recommended users
RebateApipartner_sub_listGET /rebate/partner/sub_listPartner subordinate list
RebateApirebate_broker_commission_historyGET /rebate/broker/commission_historyBroker obtains user's rebate records
RebateApirebate_broker_transaction_historyGET /rebate/broker/transaction_historyBroker obtains user's trading history
RebateApirebate_user_infoGET /rebate/user/infoUser obtains rebate information
RebateApiuser_sub_relationGET /rebate/user/sub_relationUser subordinate relationship
SpotApilist_currenciesGET /spot/currenciesQuery all currency information
SpotApiget_currencyGET /spot/currencies/{currency}Query single currency information
SpotApilist_currency_pairsGET /spot/currency_pairsQuery all supported currency pairs
SpotApiget_currency_pairGET /spot/currency_pairs/{currency_pair}Query single currency pair details
SpotApilist_tickersGET /spot/tickersGet currency pair ticker information
SpotApilist_order_bookGET /spot/order_bookGet market depth information
SpotApilist_tradesGET /spot/tradesQuery market transaction records
SpotApilist_candlesticksGET /spot/candlesticksMarket K-line chart
SpotApiget_feeGET /spot/feeQuery account fee rates
SpotApiget_batch_spot_feeGET /spot/batch_feeBatch query account fee rates
SpotApilist_spot_accountsGET /spot/accountsList spot trading accounts
SpotApilist_spot_account_bookGET /spot/account_bookQuery spot account transaction history
SpotApicreate_batch_ordersPOST /spot/batch_ordersBatch place orders
SpotApilist_all_open_ordersGET /spot/open_ordersList all open orders
SpotApicreate_cross_liquidate_orderPOST /spot/cross_liquidate_ordersClose position when cross-currency is disabled
SpotApilist_ordersGET /spot/ordersList orders
SpotApicreate_orderPOST /spot/ordersCreate an order
SpotApicancel_ordersDELETE /spot/ordersCancel all `open` orders in specified currency pair
SpotApicancel_batch_ordersPOST /spot/cancel_batch_ordersCancel batch orders by specified ID list
SpotApiget_orderGET /spot/orders/{order_id}Query single order details
SpotApicancel_orderDELETE /spot/orders/{order_id}Cancel single order
SpotApiamend_orderPATCH /spot/orders/{order_id}Amend single order
SpotApilist_my_tradesGET /spot/my_tradesQuery personal trading records
SpotApiget_system_timeGET /spot/timeGet server current time
SpotApicountdown_cancel_all_spotPOST /spot/countdown_cancel_allCountdown cancel orders
SpotApiamend_batch_ordersPOST /spot/amend_batch_ordersBatch modification of orders
SpotApiget_spot_insurance_historyGET /spot/insurance_historyQuery spot insurance fund historical data
SpotApilist_spot_price_triggered_ordersGET /spot/price_ordersQuery running auto order list
SpotApicreate_spot_price_triggered_orderPOST /spot/price_ordersCreate price-triggered order
SpotApicancel_spot_price_triggered_order_listDELETE /spot/price_ordersCancel all auto orders
SpotApiget_spot_price_triggered_orderGET /spot/price_orders/{order_id}Query single auto order details
SpotApicancel_spot_price_triggered_orderDELETE /spot/price_orders/{order_id}Cancel single auto order
WalletApilist_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
WalletApiget_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
WalletApilist_withdrawalsGET /wallet/withdrawalsGet withdrawal records
WalletApilist_depositsGET /wallet/depositsGet deposit records
WalletApitransferPOST /wallet/transfersTransfer between trading accounts
WalletApilist_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
WalletApitransfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
WalletApisub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
WalletApiget_transfer_order_statusGET /wallet/order_statusTransfer status query
WalletApilist_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
WalletApilist_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
WalletApilist_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
WalletApilist_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
WalletApilist_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
WalletApilist_saved_addressGET /wallet/saved_addressQuery withdrawal address whitelist
WalletApiget_trade_feeGET /wallet/feeQuery personal trading fees
WalletApiget_total_balanceGET /wallet/total_balanceQuery personal account totals
WalletApilist_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
WalletApiconvert_small_balancePOST /wallet/small_balanceConvert small balance currency
WalletApilist_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
WalletApilist_push_ordersGET /wallet/pushGet UID transfer history
WithdrawalApiwithdrawPOST /withdrawalsWithdraw
WithdrawalApiwithdraw_push_orderPOST /withdrawals/pushUID transfer
WithdrawalApicancel_withdrawalDELETE /withdrawals/{withdrawal_id}Cancel withdrawal with specified ID

Documentation For Models

Documentation For Authorization

apiv4

Authentication with APIv4 key and secret

For details, refer to: APIv4 signed request requirements

Author

support@mail.gate.com

About

No description, website, or topics provided.

Resources

Stars

344 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Add copy buttons to all
 blocks
(function() {
function addCopyButtons() {
document.querySelectorAll('pre code').forEach(function(codeBlock) {
if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;
codeBlock.parentElement.setAttribute('data-copy-added', 'true');
var btn = document.createElement('button');
btn.textContent = 'Copy';
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;';
btn.onmouseover = function() { this.style.opacity = '1'; };
btn.onmouseout = function() { this.style.opacity = '0.7'; };
btn.onclick = function() {
navigator.clipboard.writeText(codeBlock.textContent).then(function() {
btn.textContent = 'Copied!';
setTimeout(function() { btn.textContent = 'Copy'; }, 1500);
});
};
codeBlock.parentElement.style.position = 'relative';
codeBlock.parentElement.appendChild(btn);
});
}
addCopyButtons();
// Re-run on dynamic content
var observer = new MutationObserver(addCopyButtons);
observer.observe(document.body, { childList: true, subtree: true });
})();
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
GitHub - gateio/gateapi-python · GitHub
Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Repository files navigation

Important

This repository has been archived and is no longer maintained. The project has moved to gate/gateapi-python. Please use the new repository for updates, issues, and pull requests.

gate-api

Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v4.105.8
  • Package version: 7.1.8
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.gate.com/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

You can install directly using:

pip install --user gate-api

Then import the package:

importgate_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importgate_api

Getting Started

Please follow the installation procedure and then run the following:

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.EarnUniApi(api_client)
try:
# Query lending currency listapi_response=api_instance.list_uni_currencies()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n"%e)

For a more complete API usage example, refer to the demo application in example directory

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
EarnUniApilist_uni_currenciesGET /earn/uni/currenciesQuery lending currency list
EarnUniApiget_uni_currencyGET /earn/uni/currencies/{currency}Query single lending currency details
EarnUniApilist_user_uni_lendsGET /earn/uni/lendsQuery user's lending order list
EarnUniApicreate_uni_lendPOST /earn/uni/lendsCreate lending or redemption
EarnUniApichange_uni_lendPATCH /earn/uni/lendsAmend user lending information
EarnUniApilist_uni_lend_recordsGET /earn/uni/lend_recordsQuery lending transaction records
EarnUniApiget_uni_interestGET /earn/uni/interests/{currency}Query user's total interest income for specified currency
EarnUniApilist_uni_interest_recordsGET /earn/uni/interest_recordsQuery user dividend records
EarnUniApiget_uni_interest_statusGET /earn/uni/interest_status/{currency}Query currency interest compounding status
EarnUniApilist_uni_chartGET /earn/uni/chartUniLoan currency annualized trend chart
EarnUniApilist_uni_rateGET /earn/uni/rateCurrency estimated annualized interest rate
MarginUniApilist_uni_currency_pairsGET /margin/uni/currency_pairsList lending markets
MarginUniApiget_uni_currency_pairGET /margin/uni/currency_pairs/{currency_pair}Get lending market details
MarginUniApiget_margin_uni_estimate_rateGET /margin/uni/estimate_rateEstimate interest rate for isolated margin currencies
MarginUniApilist_uni_loansGET /margin/uni/loansQuery loans
MarginUniApicreate_uni_loanPOST /margin/uni/loansBorrow or repay
MarginUniApilist_uni_loan_recordsGET /margin/uni/loan_recordsQuery loan records
MarginUniApilist_uni_loan_interest_recordsGET /margin/uni/interest_recordsQuery interest deduction records
MarginUniApiget_uni_borrowableGET /margin/uni/borrowableQuery maximum borrowable amount by currency
SubAccountApilist_sub_accountsGET /sub_accountsList sub-accounts
SubAccountApicreate_sub_accountsPOST /sub_accountsCreate a new sub-account
SubAccountApiget_sub_accountGET /sub_accounts/{user_id}Get sub-account
SubAccountApilist_sub_account_keysGET /sub_accounts/{user_id}/keysList all API key pairs of the sub-account
SubAccountApicreate_sub_account_keysPOST /sub_accounts/{user_id}/keysCreate new sub-account API key pair
SubAccountApiget_sub_account_keyGET /sub_accounts/{user_id}/keys/{key}Get specific API key pair of the sub-account
SubAccountApiupdate_sub_account_keysPUT /sub_accounts/{user_id}/keys/{key}Update sub-account API key pair
SubAccountApidelete_sub_account_keysDELETE /sub_accounts/{user_id}/keys/{key}Delete sub-account API key pair
SubAccountApilock_sub_accountPOST /sub_accounts/{user_id}/lockLock sub-account
SubAccountApiunlock_sub_accountPOST /sub_accounts/{user_id}/unlockUnlock sub-account
SubAccountApilist_unified_modeGET /sub_accounts/unified_modeGet sub-account mode
UnifiedApilist_unified_accountsGET /unified/accountsGet unified account information
UnifiedApiget_unified_borrowableGET /unified/borrowableQuery maximum borrowable amount for unified account
UnifiedApiget_unified_transferableGET /unified/transferableQuery maximum transferable amount for unified account
UnifiedApiget_unified_transferablesGET /unified/transferablesBatch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
UnifiedApiget_unified_borrowable_listGET /unified/batch_borrowableBatch query unified account maximum borrowable amount
UnifiedApilist_unified_loansGET /unified/loansQuery loans
UnifiedApicreate_unified_loanPOST /unified/loansBorrow or repay
UnifiedApilist_unified_loan_recordsGET /unified/loan_recordsQuery loan records
UnifiedApilist_unified_loan_interest_recordsGET /unified/interest_recordsQuery interest deduction records
UnifiedApiget_unified_risk_unitsGET /unified/risk_unitsGet user risk unit details
UnifiedApiget_unified_modeGET /unified/unified_modeQuery mode of the unified account
UnifiedApiset_unified_modePUT /unified/unified_modeSet unified account mode
UnifiedApiget_unified_estimate_rateGET /unified/estimate_rateQuery unified account estimated interest rate
UnifiedApilist_currency_discount_tiersGET /unified/currency_discount_tiersQuery unified account tiered
UnifiedApilist_loan_margin_tiersGET /unified/loan_margin_tiersQuery unified account tiered loan margin
UnifiedApicalculate_portfolio_marginPOST /unified/portfolio_calculatorPortfolio margin calculator
UnifiedApiget_user_leverage_currency_configGET /unified/leverage/user_currency_configMaximum and minimum currency leverage that can be set
UnifiedApiget_user_leverage_currency_settingGET /unified/leverage/user_currency_settingGet user currency leverage
UnifiedApiset_user_leverage_currency_settingPOST /unified/leverage/user_currency_settingSet loan currency leverage
UnifiedApilist_unified_currenciesGET /unified/currenciesList of loan currencies supported by unified account
UnifiedApiget_history_loan_rateGET /unified/history_loan_rateGet historical lending rates
UnifiedApiset_unified_collateralPOST /unified/collateral_currenciesSet collateral currency
AccountApiget_account_detailGET /account/detailRetrieve user account information
AccountApiget_account_rate_limitGET /account/rate_limitGet user transaction rate limit information
AccountApilist_stp_groupsGET /account/stp_groupsQuery STP user groups created by the user
AccountApicreate_stp_groupPOST /account/stp_groupsCreate STP user group
AccountApilist_stp_groups_usersGET /account/stp_groups/{stp_id}/usersQuery users in the STP user group
AccountApiadd_stp_group_usersPOST /account/stp_groups/{stp_id}/usersAdd users to the STP user group
AccountApidelete_stp_group_usersDELETE /account/stp_groups/{stp_id}/usersDelete users from the STP user group
AccountApiget_debit_feeGET /account/debit_feeQuery GT fee deduction configuration
AccountApiset_debit_feePOST /account/debit_feeConfigure GT fee deduction
CollateralLoanApilist_collateral_loan_ordersGET /loan/collateral/ordersQuery collateral loan order list
CollateralLoanApicreate_collateral_loanPOST /loan/collateral/ordersPlace collateral loan order
CollateralLoanApiget_collateral_loan_order_detailGET /loan/collateral/orders/{order_id}Query single order details
CollateralLoanApirepay_collateral_loanPOST /loan/collateral/repayCollateral loan repayment
CollateralLoanApilist_repay_recordsGET /loan/collateral/repay_recordsQuery collateral loan repayment records
CollateralLoanApilist_collateral_recordsGET /loan/collateral/collateralsQuery collateral adjustment records
CollateralLoanApioperate_collateralPOST /loan/collateral/collateralsIncrease or redeem collateral
CollateralLoanApiget_user_total_amountGET /loan/collateral/total_amountQuery user's total borrowing and collateral amount
CollateralLoanApiget_user_ltv_infoGET /loan/collateral/ltvQuery user's collateralization ratio and remaining borrowable currencies
CollateralLoanApilist_collateral_currenciesGET /loan/collateral/currenciesQuery supported borrowing and collateral currencies
DeliveryApilist_delivery_contractsGET /delivery/{settle}/contractsQuery all futures contracts
DeliveryApiget_delivery_contractGET /delivery/{settle}/contracts/{contract}Query single contract information
DeliveryApilist_delivery_order_bookGET /delivery/{settle}/order_bookQuery futures market depth information
DeliveryApilist_delivery_tradesGET /delivery/{settle}/tradesFutures market transaction records
DeliveryApilist_delivery_candlesticksGET /delivery/{settle}/candlesticksFutures market K-line chart
DeliveryApilist_delivery_tickersGET /delivery/{settle}/tickersGet all futures trading statistics
DeliveryApilist_delivery_insurance_ledgerGET /delivery/{settle}/insuranceFutures market insurance fund history
DeliveryApilist_delivery_accountsGET /delivery/{settle}/accountsGet futures account
DeliveryApilist_delivery_account_bookGET /delivery/{settle}/account_bookQuery futures account change history
DeliveryApilist_delivery_positionsGET /delivery/{settle}/positionsGet user position list
DeliveryApiget_delivery_positionGET /delivery/{settle}/positions/{contract}Get single position information
DeliveryApiupdate_delivery_position_marginPOST /delivery/{settle}/positions/{contract}/marginUpdate position margin
DeliveryApiupdate_delivery_position_leveragePOST /delivery/{settle}/positions/{contract}/leverageUpdate position leverage
DeliveryApiupdate_delivery_position_risk_limitPOST /delivery/{settle}/positions/{contract}/risk_limitUpdate position risk limit
DeliveryApilist_delivery_ordersGET /delivery/{settle}/ordersQuery futures order list
DeliveryApicreate_delivery_orderPOST /delivery/{settle}/ordersPlace futures order
DeliveryApicancel_delivery_ordersDELETE /delivery/{settle}/ordersCancel all orders with 'open' status
DeliveryApiget_delivery_orderGET /delivery/{settle}/orders/{order_id}Query single order details
DeliveryApicancel_delivery_orderDELETE /delivery/{settle}/orders/{order_id}Cancel single order
DeliveryApiget_my_delivery_tradesGET /delivery/{settle}/my_tradesQuery personal trading records
DeliveryApilist_delivery_position_closeGET /delivery/{settle}/position_closeQuery position close history
DeliveryApilist_delivery_liquidatesGET /delivery/{settle}/liquidatesQuery liquidation history
DeliveryApilist_delivery_settlementsGET /delivery/{settle}/settlementsQuery settlement records
DeliveryApilist_delivery_risk_limit_tiersGET /delivery/{settle}/risk_limit_tiersQuery risk limit tiers
DeliveryApilist_price_triggered_delivery_ordersGET /delivery/{settle}/price_ordersQuery auto order list
DeliveryApicreate_price_triggered_delivery_orderPOST /delivery/{settle}/price_ordersCreate price-triggered order
DeliveryApicancel_price_triggered_delivery_order_listDELETE /delivery/{settle}/price_ordersCancel all auto orders
DeliveryApiget_price_triggered_delivery_orderGET /delivery/{settle}/price_orders/{order_id}Query single auto order details
DeliveryApicancel_price_triggered_delivery_orderDELETE /delivery/{settle}/price_orders/{order_id}Cancel single auto order
EarnApiswap_eth2POST /earn/staking/eth2/swapETH2 swap
EarnApirate_list_eth2GET /earn/staking/eth2/rate_recordsETH2 historical return rate query
EarnApilist_dual_investment_plansGET /earn/dual/investment_planDual Investment product list
EarnApilist_dual_ordersGET /earn/dual/ordersDual Investment order list
EarnApiplace_dual_orderPOST /earn/dual/ordersPlace Dual Investment order
EarnApilist_structured_productsGET /earn/structured/productsStructured Product List
EarnApilist_structured_ordersGET /earn/structured/ordersStructured Product Order List
EarnApiplace_structured_orderPOST /earn/structured/ordersPlace Structured Product Order
EarnApifind_coinGET /earn/staking/coinsStaking coins
EarnApiswap_staking_coinPOST /earn/staking/swapOn-chain token swap for earned coins
FlashSwapApilist_flash_swap_currency_pairGET /flash_swap/currency_pairsList All Supported Currency Pairs In Flash Swap
FlashSwapApilist_flash_swap_ordersGET /flash_swap/ordersQuery flash swap order list
FlashSwapApicreate_flash_swap_orderPOST /flash_swap/ordersCreate a flash swap order
FlashSwapApiget_flash_swap_orderGET /flash_swap/orders/{order_id}Query single flash swap order
FlashSwapApipreview_flash_swap_orderPOST /flash_swap/orders/previewFlash swap order preview
FuturesApilist_futures_contractsGET /futures/{settle}/contractsQuery all futures contracts
FuturesApiget_futures_contractGET /futures/{settle}/contracts/{contract}Query single contract information
FuturesApilist_futures_order_bookGET /futures/{settle}/order_bookQuery futures market depth information
FuturesApilist_futures_tradesGET /futures/{settle}/tradesFutures market transaction records
FuturesApilist_futures_candlesticksGET /futures/{settle}/candlesticksFutures market K-line chart
FuturesApilist_futures_premium_indexGET /futures/{settle}/premium_indexPremium Index K-line chart
FuturesApilist_futures_tickersGET /futures/{settle}/tickersGet all futures trading statistics
FuturesApilist_futures_funding_rate_historyGET /futures/{settle}/funding_rateFutures market historical funding rate
FuturesApilist_futures_insurance_ledgerGET /futures/{settle}/insuranceFutures market insurance fund history
FuturesApilist_contract_statsGET /futures/{settle}/contract_statsFutures statistics
FuturesApiget_index_constituentsGET /futures/{settle}/index_constituents/{index}Query index constituents
FuturesApilist_liquidated_ordersGET /futures/{settle}/liq_ordersQuery liquidation order history
FuturesApilist_futures_risk_limit_tiersGET /futures/{settle}/risk_limit_tiersQuery risk limit tiers
FuturesApilist_futures_accountsGET /futures/{settle}/accountsGet futures account
FuturesApilist_futures_account_bookGET /futures/{settle}/account_bookQuery futures account change history
FuturesApilist_positionsGET /futures/{settle}/positionsGet user position list
FuturesApiget_positionGET /futures/{settle}/positions/{contract}Get single position information
FuturesApiupdate_position_marginPOST /futures/{settle}/positions/{contract}/marginUpdate position margin
FuturesApiupdate_position_leveragePOST /futures/{settle}/positions/{contract}/leverageUpdate position leverage
FuturesApiupdate_position_cross_modePOST /futures/{settle}/positions/cross_modeSwitch Position Margin Mode
FuturesApiupdate_dual_comp_position_cross_modePOST /futures/{settle}/dual_comp/positions/cross_modeSwitch Between Cross and Isolated Margin Modes Under Hedge Mode
FuturesApiupdate_position_risk_limitPOST /futures/{settle}/positions/{contract}/risk_limitUpdate position risk limit
FuturesApiset_dual_modePOST /futures/{settle}/dual_modeSet position mode
FuturesApiget_dual_mode_positionGET /futures/{settle}/dual_comp/positions/{contract}Get position information in dual mode
FuturesApiupdate_dual_mode_position_marginPOST /futures/{settle}/dual_comp/positions/{contract}/marginUpdate position margin in dual mode
FuturesApiupdate_dual_mode_position_leveragePOST /futures/{settle}/dual_comp/positions/{contract}/leverageUpdate position leverage in dual mode
FuturesApiupdate_dual_mode_position_risk_limitPOST /futures/{settle}/dual_comp/positions/{contract}/risk_limitUpdate position risk limit in dual mode
FuturesApilist_futures_ordersGET /futures/{settle}/ordersQuery futures order list
FuturesApicreate_futures_orderPOST /futures/{settle}/ordersPlace futures order
FuturesApicancel_futures_ordersDELETE /futures/{settle}/ordersCancel all orders with 'open' status
FuturesApiget_orders_with_time_rangeGET /futures/{settle}/orders_timerangeQuery futures order list by time range
FuturesApicreate_batch_futures_orderPOST /futures/{settle}/batch_ordersPlace batch futures orders
FuturesApiget_futures_orderGET /futures/{settle}/orders/{order_id}Query single order details
FuturesApiamend_futures_orderPUT /futures/{settle}/orders/{order_id}Amend single order
FuturesApicancel_futures_orderDELETE /futures/{settle}/orders/{order_id}Cancel single order
FuturesApiget_my_tradesGET /futures/{settle}/my_tradesQuery personal trading records
FuturesApiget_my_trades_with_time_rangeGET /futures/{settle}/my_trades_timerangeQuery personal trading records by time range
FuturesApilist_position_closeGET /futures/{settle}/position_closeQuery position close history
FuturesApilist_liquidatesGET /futures/{settle}/liquidatesQuery liquidation history
FuturesApilist_auto_deleveragesGET /futures/{settle}/auto_deleveragesQuery ADL auto-deleveraging order information
FuturesApicountdown_cancel_all_futuresPOST /futures/{settle}/countdown_cancel_allCountdown cancel orders
FuturesApiget_futures_feeGET /futures/{settle}/feeQuery futures market trading fee rates
FuturesApicancel_batch_future_ordersPOST /futures/{settle}/batch_cancel_ordersCancel batch orders by specified ID list
FuturesApiamend_batch_future_ordersPOST /futures/{settle}/batch_amend_ordersBatch modify orders by specified IDs
FuturesApiget_futures_risk_limit_tableGET /futures/{settle}/risk_limit_tableQuery risk limit table by table_id
FuturesApilist_price_triggered_ordersGET /futures/{settle}/price_ordersQuery auto order list
FuturesApicreate_price_triggered_orderPOST /futures/{settle}/price_ordersCreate price-triggered order
FuturesApicancel_price_triggered_order_listDELETE /futures/{settle}/price_ordersCancel all auto orders
FuturesApiget_price_triggered_orderGET /futures/{settle}/price_orders/{order_id}Query single auto order details
FuturesApicancel_price_triggered_orderDELETE /futures/{settle}/price_orders/{order_id}Cancel single auto order
MarginApilist_margin_accountsGET /margin/accountsMargin account list
MarginApilist_margin_account_bookGET /margin/account_bookQuery margin account balance change history
MarginApilist_funding_accountsGET /margin/funding_accountsFunding account list
MarginApiget_auto_repay_statusGET /margin/auto_repayQuery user auto repayment settings
MarginApiset_auto_repayPOST /margin/auto_repayUpdate user auto repayment settings
MarginApiget_margin_transferableGET /margin/transferableGet maximum transferable amount for isolated margin
MarginApiget_user_margin_tierGET /margin/user/loan_margin_tiersQuery user's own leverage lending tiers in current market
MarginApiget_market_margin_tierGET /margin/loan_margin_tiersQuery current market leverage lending tiers
MarginApiset_user_market_leveragePOST /margin/leverage/user_market_settingSet user market leverage multiplier
MarginApilist_margin_user_accountGET /margin/user/accountQuery user's isolated margin account list
MarginApilist_cross_margin_loansGET /margin/cross/loansQuery cross margin borrow history (deprecated)
MarginApilist_cross_margin_repaymentsGET /margin/cross/repaymentsRetrieve cross margin repayments. (deprecated)
MultiCollateralLoanApilist_multi_collateral_ordersGET /loan/multi_collateral/ordersQuery multi-currency collateral order list
MultiCollateralLoanApicreate_multi_collateralPOST /loan/multi_collateral/ordersPlace multi-currency collateral order
MultiCollateralLoanApiget_multi_collateral_order_detailGET /loan/multi_collateral/orders/{order_id}Query order details
MultiCollateralLoanApilist_multi_repay_recordsGET /loan/multi_collateral/repayQuery multi-currency collateral repayment records
MultiCollateralLoanApirepay_multi_collateral_loanPOST /loan/multi_collateral/repayMulti-currency collateral repayment
MultiCollateralLoanApilist_multi_collateral_recordsGET /loan/multi_collateral/mortgageQuery collateral adjustment records
MultiCollateralLoanApioperate_multi_collateralPOST /loan/multi_collateral/mortgageAdd or withdraw collateral
MultiCollateralLoanApilist_user_currency_quotaGET /loan/multi_collateral/currency_quotaQuery user's collateral and borrowing currency quota information
MultiCollateralLoanApilist_multi_collateral_currenciesGET /loan/multi_collateral/currenciesQuery supported borrowing and collateral currencies for multi-currency collateral
MultiCollateralLoanApiget_multi_collateral_ltvGET /loan/multi_collateral/ltvQuery collateralization ratio information
MultiCollateralLoanApiget_multi_collateral_fix_rateGET /loan/multi_collateral/fixed_rateQuery currency's 7-day and 30-day fixed interest rates
MultiCollateralLoanApiget_multi_collateral_current_rateGET /loan/multi_collateral/current_rateQuery currency's current interest rate
OptionsApilist_options_underlyingsGET /options/underlyingsList all underlying assets
OptionsApilist_options_expirationsGET /options/expirationsList all expiration dates
OptionsApilist_options_contractsGET /options/contractsList all contracts for specified underlying and expiration date
OptionsApiget_options_contractGET /options/contracts/{contract}Query specified contract details
OptionsApilist_options_settlementsGET /options/settlementsList settlement history
OptionsApiget_options_settlementGET /options/settlements/{contract}Get specified contract settlement information
OptionsApilist_my_options_settlementsGET /options/my_settlementsQuery personal settlement records
OptionsApilist_options_order_bookGET /options/order_bookQuery options contract order book
OptionsApilist_options_tickersGET /options/tickersQuery options market ticker information
OptionsApilist_options_underlying_tickersGET /options/underlying/tickers/{underlying}Query underlying ticker information
OptionsApilist_options_candlesticksGET /options/candlesticksOptions contract market candlestick chart
OptionsApilist_options_underlying_candlesticksGET /options/underlying/candlesticksUnderlying index price candlestick chart
OptionsApilist_options_tradesGET /options/tradesMarket trade records
OptionsApilist_options_accountGET /options/accountsQuery account information
OptionsApilist_options_account_bookGET /options/account_bookQuery account change history
OptionsApilist_options_positionsGET /options/positionsList user's positions of specified underlying
OptionsApiget_options_positionGET /options/positions/{contract}Get specified contract position
OptionsApilist_options_position_closeGET /options/position_closeList user's liquidation history of specified underlying
OptionsApilist_options_ordersGET /options/ordersList options orders
OptionsApicreate_options_orderPOST /options/ordersCreate an options order
OptionsApicancel_options_ordersDELETE /options/ordersCancel all orders with 'open' status
OptionsApiget_options_orderGET /options/orders/{order_id}Query single order details
OptionsApicancel_options_orderDELETE /options/orders/{order_id}Cancel single order
OptionsApicountdown_cancel_all_optionsPOST /options/countdown_cancel_allCountdown cancel orders
OptionsApilist_my_options_tradesGET /options/my_tradesQuery personal trading records
OptionsApiget_options_mmpGET /options/mmpMMP Query.
OptionsApiset_options_mmpPOST /options/mmpMMP Settings
OptionsApireset_options_mmpPOST /options/mmp/resetMMP Reset
RebateApiagency_transaction_historyGET /rebate/agency/transaction_historyBroker obtains transaction history of recommended users
RebateApiagency_commissions_historyGET /rebate/agency/commission_historyBroker obtains rebate history of recommended users
RebateApipartner_transaction_historyGET /rebate/partner/transaction_historyPartner obtains transaction history of recommended users
RebateApipartner_commissions_historyGET /rebate/partner/commission_historyPartner obtains rebate records of recommended users
RebateApipartner_sub_listGET /rebate/partner/sub_listPartner subordinate list
RebateApirebate_broker_commission_historyGET /rebate/broker/commission_historyBroker obtains user's rebate records
RebateApirebate_broker_transaction_historyGET /rebate/broker/transaction_historyBroker obtains user's trading history
RebateApirebate_user_infoGET /rebate/user/infoUser obtains rebate information
RebateApiuser_sub_relationGET /rebate/user/sub_relationUser subordinate relationship
SpotApilist_currenciesGET /spot/currenciesQuery all currency information
SpotApiget_currencyGET /spot/currencies/{currency}Query single currency information
SpotApilist_currency_pairsGET /spot/currency_pairsQuery all supported currency pairs
SpotApiget_currency_pairGET /spot/currency_pairs/{currency_pair}Query single currency pair details
SpotApilist_tickersGET /spot/tickersGet currency pair ticker information
SpotApilist_order_bookGET /spot/order_bookGet market depth information
SpotApilist_tradesGET /spot/tradesQuery market transaction records
SpotApilist_candlesticksGET /spot/candlesticksMarket K-line chart
SpotApiget_feeGET /spot/feeQuery account fee rates
SpotApiget_batch_spot_feeGET /spot/batch_feeBatch query account fee rates
SpotApilist_spot_accountsGET /spot/accountsList spot trading accounts
SpotApilist_spot_account_bookGET /spot/account_bookQuery spot account transaction history
SpotApicreate_batch_ordersPOST /spot/batch_ordersBatch place orders
SpotApilist_all_open_ordersGET /spot/open_ordersList all open orders
SpotApicreate_cross_liquidate_orderPOST /spot/cross_liquidate_ordersClose position when cross-currency is disabled
SpotApilist_ordersGET /spot/ordersList orders
SpotApicreate_orderPOST /spot/ordersCreate an order
SpotApicancel_ordersDELETE /spot/ordersCancel all `open` orders in specified currency pair
SpotApicancel_batch_ordersPOST /spot/cancel_batch_ordersCancel batch orders by specified ID list
SpotApiget_orderGET /spot/orders/{order_id}Query single order details
SpotApicancel_orderDELETE /spot/orders/{order_id}Cancel single order
SpotApiamend_orderPATCH /spot/orders/{order_id}Amend single order
SpotApilist_my_tradesGET /spot/my_tradesQuery personal trading records
SpotApiget_system_timeGET /spot/timeGet server current time
SpotApicountdown_cancel_all_spotPOST /spot/countdown_cancel_allCountdown cancel orders
SpotApiamend_batch_ordersPOST /spot/amend_batch_ordersBatch modification of orders
SpotApiget_spot_insurance_historyGET /spot/insurance_historyQuery spot insurance fund historical data
SpotApilist_spot_price_triggered_ordersGET /spot/price_ordersQuery running auto order list
SpotApicreate_spot_price_triggered_orderPOST /spot/price_ordersCreate price-triggered order
SpotApicancel_spot_price_triggered_order_listDELETE /spot/price_ordersCancel all auto orders
SpotApiget_spot_price_triggered_orderGET /spot/price_orders/{order_id}Query single auto order details
SpotApicancel_spot_price_triggered_orderDELETE /spot/price_orders/{order_id}Cancel single auto order
WalletApilist_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
WalletApiget_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
WalletApilist_withdrawalsGET /wallet/withdrawalsGet withdrawal records
WalletApilist_depositsGET /wallet/depositsGet deposit records
WalletApitransferPOST /wallet/transfersTransfer between trading accounts
WalletApilist_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
WalletApitransfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
WalletApisub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
WalletApiget_transfer_order_statusGET /wallet/order_statusTransfer status query
WalletApilist_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
WalletApilist_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
WalletApilist_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
WalletApilist_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
WalletApilist_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
WalletApilist_saved_addressGET /wallet/saved_addressQuery withdrawal address whitelist
WalletApiget_trade_feeGET /wallet/feeQuery personal trading fees
WalletApiget_total_balanceGET /wallet/total_balanceQuery personal account totals
WalletApilist_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
WalletApiconvert_small_balancePOST /wallet/small_balanceConvert small balance currency
WalletApilist_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
WalletApilist_push_ordersGET /wallet/pushGet UID transfer history
WithdrawalApiwithdrawPOST /withdrawalsWithdraw
WithdrawalApiwithdraw_push_orderPOST /withdrawals/pushUID transfer
WithdrawalApicancel_withdrawalDELETE /withdrawals/{withdrawal_id}Cancel withdrawal with specified ID

Documentation For Models

Documentation For Authorization

apiv4

Authentication with APIv4 key and secret

For details, refer to: APIv4 signed request requirements

Author

support@mail.gate.com

About

No description, website, or topics provided.

Resources

Stars

344 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Force GitHub README to respect dark mode (function() { var style = document.createElement('style'); style.textContent = ' .markdown-body { color-scheme: dark light; } .markdown-body pre { background: #161b22 !important; } .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; } .markdown-body table th, .markdown-body table td { border-color: #30363d !important; } .markdown-body img { background: #0d1117; } .markdown-body blockquote { border-left-color: #8b949e; } .markdown-body hr { border-color: #30363d; } '; document.head.appendChild(style); })(); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gateio/gateapi-python · GitHub
Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Repository files navigation

Important

This repository has been archived and is no longer maintained. The project has moved to gate/gateapi-python. Please use the new repository for updates, issues, and pull requests.

gate-api

Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v4.105.8
  • Package version: 7.1.8
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.gate.com/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

You can install directly using:

pip install --user gate-api

Then import the package:

importgate_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importgate_api

Getting Started

Please follow the installation procedure and then run the following:

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.EarnUniApi(api_client)
try:
# Query lending currency listapi_response=api_instance.list_uni_currencies()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n"%e)

For a more complete API usage example, refer to the demo application in example directory

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
EarnUniApilist_uni_currenciesGET /earn/uni/currenciesQuery lending currency list
EarnUniApiget_uni_currencyGET /earn/uni/currencies/{currency}Query single lending currency details
EarnUniApilist_user_uni_lendsGET /earn/uni/lendsQuery user's lending order list
EarnUniApicreate_uni_lendPOST /earn/uni/lendsCreate lending or redemption
EarnUniApichange_uni_lendPATCH /earn/uni/lendsAmend user lending information
EarnUniApilist_uni_lend_recordsGET /earn/uni/lend_recordsQuery lending transaction records
EarnUniApiget_uni_interestGET /earn/uni/interests/{currency}Query user's total interest income for specified currency
EarnUniApilist_uni_interest_recordsGET /earn/uni/interest_recordsQuery user dividend records
EarnUniApiget_uni_interest_statusGET /earn/uni/interest_status/{currency}Query currency interest compounding status
EarnUniApilist_uni_chartGET /earn/uni/chartUniLoan currency annualized trend chart
EarnUniApilist_uni_rateGET /earn/uni/rateCurrency estimated annualized interest rate
MarginUniApilist_uni_currency_pairsGET /margin/uni/currency_pairsList lending markets
MarginUniApiget_uni_currency_pairGET /margin/uni/currency_pairs/{currency_pair}Get lending market details
MarginUniApiget_margin_uni_estimate_rateGET /margin/uni/estimate_rateEstimate interest rate for isolated margin currencies
MarginUniApilist_uni_loansGET /margin/uni/loansQuery loans
MarginUniApicreate_uni_loanPOST /margin/uni/loansBorrow or repay
MarginUniApilist_uni_loan_recordsGET /margin/uni/loan_recordsQuery loan records
MarginUniApilist_uni_loan_interest_recordsGET /margin/uni/interest_recordsQuery interest deduction records
MarginUniApiget_uni_borrowableGET /margin/uni/borrowableQuery maximum borrowable amount by currency
SubAccountApilist_sub_accountsGET /sub_accountsList sub-accounts
SubAccountApicreate_sub_accountsPOST /sub_accountsCreate a new sub-account
SubAccountApiget_sub_accountGET /sub_accounts/{user_id}Get sub-account
SubAccountApilist_sub_account_keysGET /sub_accounts/{user_id}/keysList all API key pairs of the sub-account
SubAccountApicreate_sub_account_keysPOST /sub_accounts/{user_id}/keysCreate new sub-account API key pair
SubAccountApiget_sub_account_keyGET /sub_accounts/{user_id}/keys/{key}Get specific API key pair of the sub-account
SubAccountApiupdate_sub_account_keysPUT /sub_accounts/{user_id}/keys/{key}Update sub-account API key pair
SubAccountApidelete_sub_account_keysDELETE /sub_accounts/{user_id}/keys/{key}Delete sub-account API key pair
SubAccountApilock_sub_accountPOST /sub_accounts/{user_id}/lockLock sub-account
SubAccountApiunlock_sub_accountPOST /sub_accounts/{user_id}/unlockUnlock sub-account
SubAccountApilist_unified_modeGET /sub_accounts/unified_modeGet sub-account mode
UnifiedApilist_unified_accountsGET /unified/accountsGet unified account information
UnifiedApiget_unified_borrowableGET /unified/borrowableQuery maximum borrowable amount for unified account
UnifiedApiget_unified_transferableGET /unified/transferableQuery maximum transferable amount for unified account
UnifiedApiget_unified_transferablesGET /unified/transferablesBatch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
UnifiedApiget_unified_borrowable_listGET /unified/batch_borrowableBatch query unified account maximum borrowable amount
UnifiedApilist_unified_loansGET /unified/loansQuery loans
UnifiedApicreate_unified_loanPOST /unified/loansBorrow or repay
UnifiedApilist_unified_loan_recordsGET /unified/loan_recordsQuery loan records
UnifiedApilist_unified_loan_interest_recordsGET /unified/interest_recordsQuery interest deduction records
UnifiedApiget_unified_risk_unitsGET /unified/risk_unitsGet user risk unit details
UnifiedApiget_unified_modeGET /unified/unified_modeQuery mode of the unified account
UnifiedApiset_unified_modePUT /unified/unified_modeSet unified account mode
UnifiedApiget_unified_estimate_rateGET /unified/estimate_rateQuery unified account estimated interest rate
UnifiedApilist_currency_discount_tiersGET /unified/currency_discount_tiersQuery unified account tiered
UnifiedApilist_loan_margin_tiersGET /unified/loan_margin_tiersQuery unified account tiered loan margin
UnifiedApicalculate_portfolio_marginPOST /unified/portfolio_calculatorPortfolio margin calculator
UnifiedApiget_user_leverage_currency_configGET /unified/leverage/user_currency_configMaximum and minimum currency leverage that can be set
UnifiedApiget_user_leverage_currency_settingGET /unified/leverage/user_currency_settingGet user currency leverage
UnifiedApiset_user_leverage_currency_settingPOST /unified/leverage/user_currency_settingSet loan currency leverage
UnifiedApilist_unified_currenciesGET /unified/currenciesList of loan currencies supported by unified account
UnifiedApiget_history_loan_rateGET /unified/history_loan_rateGet historical lending rates
UnifiedApiset_unified_collateralPOST /unified/collateral_currenciesSet collateral currency
AccountApiget_account_detailGET /account/detailRetrieve user account information
AccountApiget_account_rate_limitGET /account/rate_limitGet user transaction rate limit information
AccountApilist_stp_groupsGET /account/stp_groupsQuery STP user groups created by the user
AccountApicreate_stp_groupPOST /account/stp_groupsCreate STP user group
AccountApilist_stp_groups_usersGET /account/stp_groups/{stp_id}/usersQuery users in the STP user group
AccountApiadd_stp_group_usersPOST /account/stp_groups/{stp_id}/usersAdd users to the STP user group
AccountApidelete_stp_group_usersDELETE /account/stp_groups/{stp_id}/usersDelete users from the STP user group
AccountApiget_debit_feeGET /account/debit_feeQuery GT fee deduction configuration
AccountApiset_debit_feePOST /account/debit_feeConfigure GT fee deduction
CollateralLoanApilist_collateral_loan_ordersGET /loan/collateral/ordersQuery collateral loan order list
CollateralLoanApicreate_collateral_loanPOST /loan/collateral/ordersPlace collateral loan order
CollateralLoanApiget_collateral_loan_order_detailGET /loan/collateral/orders/{order_id}Query single order details
CollateralLoanApirepay_collateral_loanPOST /loan/collateral/repayCollateral loan repayment
CollateralLoanApilist_repay_recordsGET /loan/collateral/repay_recordsQuery collateral loan repayment records
CollateralLoanApilist_collateral_recordsGET /loan/collateral/collateralsQuery collateral adjustment records
CollateralLoanApioperate_collateralPOST /loan/collateral/collateralsIncrease or redeem collateral
CollateralLoanApiget_user_total_amountGET /loan/collateral/total_amountQuery user's total borrowing and collateral amount
CollateralLoanApiget_user_ltv_infoGET /loan/collateral/ltvQuery user's collateralization ratio and remaining borrowable currencies
CollateralLoanApilist_collateral_currenciesGET /loan/collateral/currenciesQuery supported borrowing and collateral currencies
DeliveryApilist_delivery_contractsGET /delivery/{settle}/contractsQuery all futures contracts
DeliveryApiget_delivery_contractGET /delivery/{settle}/contracts/{contract}Query single contract information
DeliveryApilist_delivery_order_bookGET /delivery/{settle}/order_bookQuery futures market depth information
DeliveryApilist_delivery_tradesGET /delivery/{settle}/tradesFutures market transaction records
DeliveryApilist_delivery_candlesticksGET /delivery/{settle}/candlesticksFutures market K-line chart
DeliveryApilist_delivery_tickersGET /delivery/{settle}/tickersGet all futures trading statistics
DeliveryApilist_delivery_insurance_ledgerGET /delivery/{settle}/insuranceFutures market insurance fund history
DeliveryApilist_delivery_accountsGET /delivery/{settle}/accountsGet futures account
DeliveryApilist_delivery_account_bookGET /delivery/{settle}/account_bookQuery futures account change history
DeliveryApilist_delivery_positionsGET /delivery/{settle}/positionsGet user position list
DeliveryApiget_delivery_positionGET /delivery/{settle}/positions/{contract}Get single position information
DeliveryApiupdate_delivery_position_marginPOST /delivery/{settle}/positions/{contract}/marginUpdate position margin
DeliveryApiupdate_delivery_position_leveragePOST /delivery/{settle}/positions/{contract}/leverageUpdate position leverage
DeliveryApiupdate_delivery_position_risk_limitPOST /delivery/{settle}/positions/{contract}/risk_limitUpdate position risk limit
DeliveryApilist_delivery_ordersGET /delivery/{settle}/ordersQuery futures order list
DeliveryApicreate_delivery_orderPOST /delivery/{settle}/ordersPlace futures order
DeliveryApicancel_delivery_ordersDELETE /delivery/{settle}/ordersCancel all orders with 'open' status
DeliveryApiget_delivery_orderGET /delivery/{settle}/orders/{order_id}Query single order details
DeliveryApicancel_delivery_orderDELETE /delivery/{settle}/orders/{order_id}Cancel single order
DeliveryApiget_my_delivery_tradesGET /delivery/{settle}/my_tradesQuery personal trading records
DeliveryApilist_delivery_position_closeGET /delivery/{settle}/position_closeQuery position close history
DeliveryApilist_delivery_liquidatesGET /delivery/{settle}/liquidatesQuery liquidation history
DeliveryApilist_delivery_settlementsGET /delivery/{settle}/settlementsQuery settlement records
DeliveryApilist_delivery_risk_limit_tiersGET /delivery/{settle}/risk_limit_tiersQuery risk limit tiers
DeliveryApilist_price_triggered_delivery_ordersGET /delivery/{settle}/price_ordersQuery auto order list
DeliveryApicreate_price_triggered_delivery_orderPOST /delivery/{settle}/price_ordersCreate price-triggered order
DeliveryApicancel_price_triggered_delivery_order_listDELETE /delivery/{settle}/price_ordersCancel all auto orders
DeliveryApiget_price_triggered_delivery_orderGET /delivery/{settle}/price_orders/{order_id}Query single auto order details
DeliveryApicancel_price_triggered_delivery_orderDELETE /delivery/{settle}/price_orders/{order_id}Cancel single auto order
EarnApiswap_eth2POST /earn/staking/eth2/swapETH2 swap
EarnApirate_list_eth2GET /earn/staking/eth2/rate_recordsETH2 historical return rate query
EarnApilist_dual_investment_plansGET /earn/dual/investment_planDual Investment product list
EarnApilist_dual_ordersGET /earn/dual/ordersDual Investment order list
EarnApiplace_dual_orderPOST /earn/dual/ordersPlace Dual Investment order
EarnApilist_structured_productsGET /earn/structured/productsStructured Product List
EarnApilist_structured_ordersGET /earn/structured/ordersStructured Product Order List
EarnApiplace_structured_orderPOST /earn/structured/ordersPlace Structured Product Order
EarnApifind_coinGET /earn/staking/coinsStaking coins
EarnApiswap_staking_coinPOST /earn/staking/swapOn-chain token swap for earned coins
FlashSwapApilist_flash_swap_currency_pairGET /flash_swap/currency_pairsList All Supported Currency Pairs In Flash Swap
FlashSwapApilist_flash_swap_ordersGET /flash_swap/ordersQuery flash swap order list
FlashSwapApicreate_flash_swap_orderPOST /flash_swap/ordersCreate a flash swap order
FlashSwapApiget_flash_swap_orderGET /flash_swap/orders/{order_id}Query single flash swap order
FlashSwapApipreview_flash_swap_orderPOST /flash_swap/orders/previewFlash swap order preview
FuturesApilist_futures_contractsGET /futures/{settle}/contractsQuery all futures contracts
FuturesApiget_futures_contractGET /futures/{settle}/contracts/{contract}Query single contract information
FuturesApilist_futures_order_bookGET /futures/{settle}/order_bookQuery futures market depth information
FuturesApilist_futures_tradesGET /futures/{settle}/tradesFutures market transaction records
FuturesApilist_futures_candlesticksGET /futures/{settle}/candlesticksFutures market K-line chart
FuturesApilist_futures_premium_indexGET /futures/{settle}/premium_indexPremium Index K-line chart
FuturesApilist_futures_tickersGET /futures/{settle}/tickersGet all futures trading statistics
FuturesApilist_futures_funding_rate_historyGET /futures/{settle}/funding_rateFutures market historical funding rate
FuturesApilist_futures_insurance_ledgerGET /futures/{settle}/insuranceFutures market insurance fund history
FuturesApilist_contract_statsGET /futures/{settle}/contract_statsFutures statistics
FuturesApiget_index_constituentsGET /futures/{settle}/index_constituents/{index}Query index constituents
FuturesApilist_liquidated_ordersGET /futures/{settle}/liq_ordersQuery liquidation order history
FuturesApilist_futures_risk_limit_tiersGET /futures/{settle}/risk_limit_tiersQuery risk limit tiers
FuturesApilist_futures_accountsGET /futures/{settle}/accountsGet futures account
FuturesApilist_futures_account_bookGET /futures/{settle}/account_bookQuery futures account change history
FuturesApilist_positionsGET /futures/{settle}/positionsGet user position list
FuturesApiget_positionGET /futures/{settle}/positions/{contract}Get single position information
FuturesApiupdate_position_marginPOST /futures/{settle}/positions/{contract}/marginUpdate position margin
FuturesApiupdate_position_leveragePOST /futures/{settle}/positions/{contract}/leverageUpdate position leverage
FuturesApiupdate_position_cross_modePOST /futures/{settle}/positions/cross_modeSwitch Position Margin Mode
FuturesApiupdate_dual_comp_position_cross_modePOST /futures/{settle}/dual_comp/positions/cross_modeSwitch Between Cross and Isolated Margin Modes Under Hedge Mode
FuturesApiupdate_position_risk_limitPOST /futures/{settle}/positions/{contract}/risk_limitUpdate position risk limit
FuturesApiset_dual_modePOST /futures/{settle}/dual_modeSet position mode
FuturesApiget_dual_mode_positionGET /futures/{settle}/dual_comp/positions/{contract}Get position information in dual mode
FuturesApiupdate_dual_mode_position_marginPOST /futures/{settle}/dual_comp/positions/{contract}/marginUpdate position margin in dual mode
FuturesApiupdate_dual_mode_position_leveragePOST /futures/{settle}/dual_comp/positions/{contract}/leverageUpdate position leverage in dual mode
FuturesApiupdate_dual_mode_position_risk_limitPOST /futures/{settle}/dual_comp/positions/{contract}/risk_limitUpdate position risk limit in dual mode
FuturesApilist_futures_ordersGET /futures/{settle}/ordersQuery futures order list
FuturesApicreate_futures_orderPOST /futures/{settle}/ordersPlace futures order
FuturesApicancel_futures_ordersDELETE /futures/{settle}/ordersCancel all orders with 'open' status
FuturesApiget_orders_with_time_rangeGET /futures/{settle}/orders_timerangeQuery futures order list by time range
FuturesApicreate_batch_futures_orderPOST /futures/{settle}/batch_ordersPlace batch futures orders
FuturesApiget_futures_orderGET /futures/{settle}/orders/{order_id}Query single order details
FuturesApiamend_futures_orderPUT /futures/{settle}/orders/{order_id}Amend single order
FuturesApicancel_futures_orderDELETE /futures/{settle}/orders/{order_id}Cancel single order
FuturesApiget_my_tradesGET /futures/{settle}/my_tradesQuery personal trading records
FuturesApiget_my_trades_with_time_rangeGET /futures/{settle}/my_trades_timerangeQuery personal trading records by time range
FuturesApilist_position_closeGET /futures/{settle}/position_closeQuery position close history
FuturesApilist_liquidatesGET /futures/{settle}/liquidatesQuery liquidation history
FuturesApilist_auto_deleveragesGET /futures/{settle}/auto_deleveragesQuery ADL auto-deleveraging order information
FuturesApicountdown_cancel_all_futuresPOST /futures/{settle}/countdown_cancel_allCountdown cancel orders
FuturesApiget_futures_feeGET /futures/{settle}/feeQuery futures market trading fee rates
FuturesApicancel_batch_future_ordersPOST /futures/{settle}/batch_cancel_ordersCancel batch orders by specified ID list
FuturesApiamend_batch_future_ordersPOST /futures/{settle}/batch_amend_ordersBatch modify orders by specified IDs
FuturesApiget_futures_risk_limit_tableGET /futures/{settle}/risk_limit_tableQuery risk limit table by table_id
FuturesApilist_price_triggered_ordersGET /futures/{settle}/price_ordersQuery auto order list
FuturesApicreate_price_triggered_orderPOST /futures/{settle}/price_ordersCreate price-triggered order
FuturesApicancel_price_triggered_order_listDELETE /futures/{settle}/price_ordersCancel all auto orders
FuturesApiget_price_triggered_orderGET /futures/{settle}/price_orders/{order_id}Query single auto order details
FuturesApicancel_price_triggered_orderDELETE /futures/{settle}/price_orders/{order_id}Cancel single auto order
MarginApilist_margin_accountsGET /margin/accountsMargin account list
MarginApilist_margin_account_bookGET /margin/account_bookQuery margin account balance change history
MarginApilist_funding_accountsGET /margin/funding_accountsFunding account list
MarginApiget_auto_repay_statusGET /margin/auto_repayQuery user auto repayment settings
MarginApiset_auto_repayPOST /margin/auto_repayUpdate user auto repayment settings
MarginApiget_margin_transferableGET /margin/transferableGet maximum transferable amount for isolated margin
MarginApiget_user_margin_tierGET /margin/user/loan_margin_tiersQuery user's own leverage lending tiers in current market
MarginApiget_market_margin_tierGET /margin/loan_margin_tiersQuery current market leverage lending tiers
MarginApiset_user_market_leveragePOST /margin/leverage/user_market_settingSet user market leverage multiplier
MarginApilist_margin_user_accountGET /margin/user/accountQuery user's isolated margin account list
MarginApilist_cross_margin_loansGET /margin/cross/loansQuery cross margin borrow history (deprecated)
MarginApilist_cross_margin_repaymentsGET /margin/cross/repaymentsRetrieve cross margin repayments. (deprecated)
MultiCollateralLoanApilist_multi_collateral_ordersGET /loan/multi_collateral/ordersQuery multi-currency collateral order list
MultiCollateralLoanApicreate_multi_collateralPOST /loan/multi_collateral/ordersPlace multi-currency collateral order
MultiCollateralLoanApiget_multi_collateral_order_detailGET /loan/multi_collateral/orders/{order_id}Query order details
MultiCollateralLoanApilist_multi_repay_recordsGET /loan/multi_collateral/repayQuery multi-currency collateral repayment records
MultiCollateralLoanApirepay_multi_collateral_loanPOST /loan/multi_collateral/repayMulti-currency collateral repayment
MultiCollateralLoanApilist_multi_collateral_recordsGET /loan/multi_collateral/mortgageQuery collateral adjustment records
MultiCollateralLoanApioperate_multi_collateralPOST /loan/multi_collateral/mortgageAdd or withdraw collateral
MultiCollateralLoanApilist_user_currency_quotaGET /loan/multi_collateral/currency_quotaQuery user's collateral and borrowing currency quota information
MultiCollateralLoanApilist_multi_collateral_currenciesGET /loan/multi_collateral/currenciesQuery supported borrowing and collateral currencies for multi-currency collateral
MultiCollateralLoanApiget_multi_collateral_ltvGET /loan/multi_collateral/ltvQuery collateralization ratio information
MultiCollateralLoanApiget_multi_collateral_fix_rateGET /loan/multi_collateral/fixed_rateQuery currency's 7-day and 30-day fixed interest rates
MultiCollateralLoanApiget_multi_collateral_current_rateGET /loan/multi_collateral/current_rateQuery currency's current interest rate
OptionsApilist_options_underlyingsGET /options/underlyingsList all underlying assets
OptionsApilist_options_expirationsGET /options/expirationsList all expiration dates
OptionsApilist_options_contractsGET /options/contractsList all contracts for specified underlying and expiration date
OptionsApiget_options_contractGET /options/contracts/{contract}Query specified contract details
OptionsApilist_options_settlementsGET /options/settlementsList settlement history
OptionsApiget_options_settlementGET /options/settlements/{contract}Get specified contract settlement information
OptionsApilist_my_options_settlementsGET /options/my_settlementsQuery personal settlement records
OptionsApilist_options_order_bookGET /options/order_bookQuery options contract order book
OptionsApilist_options_tickersGET /options/tickersQuery options market ticker information
OptionsApilist_options_underlying_tickersGET /options/underlying/tickers/{underlying}Query underlying ticker information
OptionsApilist_options_candlesticksGET /options/candlesticksOptions contract market candlestick chart
OptionsApilist_options_underlying_candlesticksGET /options/underlying/candlesticksUnderlying index price candlestick chart
OptionsApilist_options_tradesGET /options/tradesMarket trade records
OptionsApilist_options_accountGET /options/accountsQuery account information
OptionsApilist_options_account_bookGET /options/account_bookQuery account change history
OptionsApilist_options_positionsGET /options/positionsList user's positions of specified underlying
OptionsApiget_options_positionGET /options/positions/{contract}Get specified contract position
OptionsApilist_options_position_closeGET /options/position_closeList user's liquidation history of specified underlying
OptionsApilist_options_ordersGET /options/ordersList options orders
OptionsApicreate_options_orderPOST /options/ordersCreate an options order
OptionsApicancel_options_ordersDELETE /options/ordersCancel all orders with 'open' status
OptionsApiget_options_orderGET /options/orders/{order_id}Query single order details
OptionsApicancel_options_orderDELETE /options/orders/{order_id}Cancel single order
OptionsApicountdown_cancel_all_optionsPOST /options/countdown_cancel_allCountdown cancel orders
OptionsApilist_my_options_tradesGET /options/my_tradesQuery personal trading records
OptionsApiget_options_mmpGET /options/mmpMMP Query.
OptionsApiset_options_mmpPOST /options/mmpMMP Settings
OptionsApireset_options_mmpPOST /options/mmp/resetMMP Reset
RebateApiagency_transaction_historyGET /rebate/agency/transaction_historyBroker obtains transaction history of recommended users
RebateApiagency_commissions_historyGET /rebate/agency/commission_historyBroker obtains rebate history of recommended users
RebateApipartner_transaction_historyGET /rebate/partner/transaction_historyPartner obtains transaction history of recommended users
RebateApipartner_commissions_historyGET /rebate/partner/commission_historyPartner obtains rebate records of recommended users
RebateApipartner_sub_listGET /rebate/partner/sub_listPartner subordinate list
RebateApirebate_broker_commission_historyGET /rebate/broker/commission_historyBroker obtains user's rebate records
RebateApirebate_broker_transaction_historyGET /rebate/broker/transaction_historyBroker obtains user's trading history
RebateApirebate_user_infoGET /rebate/user/infoUser obtains rebate information
RebateApiuser_sub_relationGET /rebate/user/sub_relationUser subordinate relationship
SpotApilist_currenciesGET /spot/currenciesQuery all currency information
SpotApiget_currencyGET /spot/currencies/{currency}Query single currency information
SpotApilist_currency_pairsGET /spot/currency_pairsQuery all supported currency pairs
SpotApiget_currency_pairGET /spot/currency_pairs/{currency_pair}Query single currency pair details
SpotApilist_tickersGET /spot/tickersGet currency pair ticker information
SpotApilist_order_bookGET /spot/order_bookGet market depth information
SpotApilist_tradesGET /spot/tradesQuery market transaction records
SpotApilist_candlesticksGET /spot/candlesticksMarket K-line chart
SpotApiget_feeGET /spot/feeQuery account fee rates
SpotApiget_batch_spot_feeGET /spot/batch_feeBatch query account fee rates
SpotApilist_spot_accountsGET /spot/accountsList spot trading accounts
SpotApilist_spot_account_bookGET /spot/account_bookQuery spot account transaction history
SpotApicreate_batch_ordersPOST /spot/batch_ordersBatch place orders
SpotApilist_all_open_ordersGET /spot/open_ordersList all open orders
SpotApicreate_cross_liquidate_orderPOST /spot/cross_liquidate_ordersClose position when cross-currency is disabled
SpotApilist_ordersGET /spot/ordersList orders
SpotApicreate_orderPOST /spot/ordersCreate an order
SpotApicancel_ordersDELETE /spot/ordersCancel all `open` orders in specified currency pair
SpotApicancel_batch_ordersPOST /spot/cancel_batch_ordersCancel batch orders by specified ID list
SpotApiget_orderGET /spot/orders/{order_id}Query single order details
SpotApicancel_orderDELETE /spot/orders/{order_id}Cancel single order
SpotApiamend_orderPATCH /spot/orders/{order_id}Amend single order
SpotApilist_my_tradesGET /spot/my_tradesQuery personal trading records
SpotApiget_system_timeGET /spot/timeGet server current time
SpotApicountdown_cancel_all_spotPOST /spot/countdown_cancel_allCountdown cancel orders
SpotApiamend_batch_ordersPOST /spot/amend_batch_ordersBatch modification of orders
SpotApiget_spot_insurance_historyGET /spot/insurance_historyQuery spot insurance fund historical data
SpotApilist_spot_price_triggered_ordersGET /spot/price_ordersQuery running auto order list
SpotApicreate_spot_price_triggered_orderPOST /spot/price_ordersCreate price-triggered order
SpotApicancel_spot_price_triggered_order_listDELETE /spot/price_ordersCancel all auto orders
SpotApiget_spot_price_triggered_orderGET /spot/price_orders/{order_id}Query single auto order details
SpotApicancel_spot_price_triggered_orderDELETE /spot/price_orders/{order_id}Cancel single auto order
WalletApilist_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
WalletApiget_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
WalletApilist_withdrawalsGET /wallet/withdrawalsGet withdrawal records
WalletApilist_depositsGET /wallet/depositsGet deposit records
WalletApitransferPOST /wallet/transfersTransfer between trading accounts
WalletApilist_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
WalletApitransfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
WalletApisub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
WalletApiget_transfer_order_statusGET /wallet/order_statusTransfer status query
WalletApilist_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
WalletApilist_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
WalletApilist_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
WalletApilist_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
WalletApilist_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
WalletApilist_saved_addressGET /wallet/saved_addressQuery withdrawal address whitelist
WalletApiget_trade_feeGET /wallet/feeQuery personal trading fees
WalletApiget_total_balanceGET /wallet/total_balanceQuery personal account totals
WalletApilist_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
WalletApiconvert_small_balancePOST /wallet/small_balanceConvert small balance currency
WalletApilist_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
WalletApilist_push_ordersGET /wallet/pushGet UID transfer history
WithdrawalApiwithdrawPOST /withdrawalsWithdraw
WithdrawalApiwithdraw_push_orderPOST /withdrawals/pushUID transfer
WithdrawalApicancel_withdrawalDELETE /withdrawals/{withdrawal_id}Cancel withdrawal with specified ID

Documentation For Models

Documentation For Authorization

apiv4

Authentication with APIv4 key and secret

For details, refer to: APIv4 signed request requirements

Author

support@mail.gate.com

About

No description, website, or topics provided.

Resources

Stars

344 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages

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

Repository files navigation

Important

This repository has been archived and is no longer maintained. The project has moved to gate/gateapi-python. Please use the new repository for updates, issues, and pull requests.

gate-api

Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v4.105.8
  • Package version: 7.1.8
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.gate.com/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

You can install directly using:

pip install --user gate-api

Then import the package:

importgate_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importgate_api

Getting Started

Please follow the installation procedure and then run the following:

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.EarnUniApi(api_client)
try:
# Query lending currency listapi_response=api_instance.list_uni_currencies()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n"%e)

For a more complete API usage example, refer to the demo application in example directory

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
EarnUniApilist_uni_currenciesGET /earn/uni/currenciesQuery lending currency list
EarnUniApiget_uni_currencyGET /earn/uni/currencies/{currency}Query single lending currency details
EarnUniApilist_user_uni_lendsGET /earn/uni/lendsQuery user's lending order list
EarnUniApicreate_uni_lendPOST /earn/uni/lendsCreate lending or redemption
EarnUniApichange_uni_lendPATCH /earn/uni/lendsAmend user lending information
EarnUniApilist_uni_lend_recordsGET /earn/uni/lend_recordsQuery lending transaction records
EarnUniApiget_uni_interestGET /earn/uni/interests/{currency}Query user's total interest income for specified currency
EarnUniApilist_uni_interest_recordsGET /earn/uni/interest_recordsQuery user dividend records
EarnUniApiget_uni_interest_statusGET /earn/uni/interest_status/{currency}Query currency interest compounding status
EarnUniApilist_uni_chartGET /earn/uni/chartUniLoan currency annualized trend chart
EarnUniApilist_uni_rateGET /earn/uni/rateCurrency estimated annualized interest rate
MarginUniApilist_uni_currency_pairsGET /margin/uni/currency_pairsList lending markets
MarginUniApiget_uni_currency_pairGET /margin/uni/currency_pairs/{currency_pair}Get lending market details
MarginUniApiget_margin_uni_estimate_rateGET /margin/uni/estimate_rateEstimate interest rate for isolated margin currencies
MarginUniApilist_uni_loansGET /margin/uni/loansQuery loans
MarginUniApicreate_uni_loanPOST /margin/uni/loansBorrow or repay
MarginUniApilist_uni_loan_recordsGET /margin/uni/loan_recordsQuery loan records
MarginUniApilist_uni_loan_interest_recordsGET /margin/uni/interest_recordsQuery interest deduction records
MarginUniApiget_uni_borrowableGET /margin/uni/borrowableQuery maximum borrowable amount by currency
SubAccountApilist_sub_accountsGET /sub_accountsList sub-accounts
SubAccountApicreate_sub_accountsPOST /sub_accountsCreate a new sub-account
SubAccountApiget_sub_accountGET /sub_accounts/{user_id}Get sub-account
SubAccountApilist_sub_account_keysGET /sub_accounts/{user_id}/keysList all API key pairs of the sub-account
SubAccountApicreate_sub_account_keysPOST /sub_accounts/{user_id}/keysCreate new sub-account API key pair
SubAccountApiget_sub_account_keyGET /sub_accounts/{user_id}/keys/{key}Get specific API key pair of the sub-account
SubAccountApiupdate_sub_account_keysPUT /sub_accounts/{user_id}/keys/{key}Update sub-account API key pair
SubAccountApidelete_sub_account_keysDELETE /sub_accounts/{user_id}/keys/{key}Delete sub-account API key pair
SubAccountApilock_sub_accountPOST /sub_accounts/{user_id}/lockLock sub-account
SubAccountApiunlock_sub_accountPOST /sub_accounts/{user_id}/unlockUnlock sub-account
SubAccountApilist_unified_modeGET /sub_accounts/unified_modeGet sub-account mode
UnifiedApilist_unified_accountsGET /unified/accountsGet unified account information
UnifiedApiget_unified_borrowableGET /unified/borrowableQuery maximum borrowable amount for unified account
UnifiedApiget_unified_transferableGET /unified/transferableQuery maximum transferable amount for unified account
UnifiedApiget_unified_transferablesGET /unified/transferablesBatch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
UnifiedApiget_unified_borrowable_listGET /unified/batch_borrowableBatch query unified account maximum borrowable amount
UnifiedApilist_unified_loansGET /unified/loansQuery loans
UnifiedApicreate_unified_loanPOST /unified/loansBorrow or repay
UnifiedApilist_unified_loan_recordsGET /unified/loan_recordsQuery loan records
UnifiedApilist_unified_loan_interest_recordsGET /unified/interest_recordsQuery interest deduction records
UnifiedApiget_unified_risk_unitsGET /unified/risk_unitsGet user risk unit details
UnifiedApiget_unified_modeGET /unified/unified_modeQuery mode of the unified account
UnifiedApiset_unified_modePUT /unified/unified_modeSet unified account mode
UnifiedApiget_unified_estimate_rateGET /unified/estimate_rateQuery unified account estimated interest rate
UnifiedApilist_currency_discount_tiersGET /unified/currency_discount_tiersQuery unified account tiered
UnifiedApilist_loan_margin_tiersGET /unified/loan_margin_tiersQuery unified account tiered loan margin
UnifiedApicalculate_portfolio_marginPOST /unified/portfolio_calculatorPortfolio margin calculator
UnifiedApiget_user_leverage_currency_configGET /unified/leverage/user_currency_configMaximum and minimum currency leverage that can be set
UnifiedApiget_user_leverage_currency_settingGET /unified/leverage/user_currency_settingGet user currency leverage
UnifiedApiset_user_leverage_currency_settingPOST /unified/leverage/user_currency_settingSet loan currency leverage
UnifiedApilist_unified_currenciesGET /unified/currenciesList of loan currencies supported by unified account
UnifiedApiget_history_loan_rateGET /unified/history_loan_rateGet historical lending rates
UnifiedApiset_unified_collateralPOST /unified/collateral_currenciesSet collateral currency
AccountApiget_account_detailGET /account/detailRetrieve user account information
AccountApiget_account_rate_limitGET /account/rate_limitGet user transaction rate limit information
AccountApilist_stp_groupsGET /account/stp_groupsQuery STP user groups created by the user
AccountApicreate_stp_groupPOST /account/stp_groupsCreate STP user group
AccountApilist_stp_groups_usersGET /account/stp_groups/{stp_id}/usersQuery users in the STP user group
AccountApiadd_stp_group_usersPOST /account/stp_groups/{stp_id}/usersAdd users to the STP user group
AccountApidelete_stp_group_usersDELETE /account/stp_groups/{stp_id}/usersDelete users from the STP user group
AccountApiget_debit_feeGET /account/debit_feeQuery GT fee deduction configuration
AccountApiset_debit_feePOST /account/debit_feeConfigure GT fee deduction
CollateralLoanApilist_collateral_loan_ordersGET /loan/collateral/ordersQuery collateral loan order list
CollateralLoanApicreate_collateral_loanPOST /loan/collateral/ordersPlace collateral loan order
CollateralLoanApiget_collateral_loan_order_detailGET /loan/collateral/orders/{order_id}Query single order details
CollateralLoanApirepay_collateral_loanPOST /loan/collateral/repayCollateral loan repayment
CollateralLoanApilist_repay_recordsGET /loan/collateral/repay_recordsQuery collateral loan repayment records
CollateralLoanApilist_collateral_recordsGET /loan/collateral/collateralsQuery collateral adjustment records
CollateralLoanApioperate_collateralPOST /loan/collateral/collateralsIncrease or redeem collateral
CollateralLoanApiget_user_total_amountGET /loan/collateral/total_amountQuery user's total borrowing and collateral amount
CollateralLoanApiget_user_ltv_infoGET /loan/collateral/ltvQuery user's collateralization ratio and remaining borrowable currencies
CollateralLoanApilist_collateral_currenciesGET /loan/collateral/currenciesQuery supported borrowing and collateral currencies
DeliveryApilist_delivery_contractsGET /delivery/{settle}/contractsQuery all futures contracts
DeliveryApiget_delivery_contractGET /delivery/{settle}/contracts/{contract}Query single contract information
DeliveryApilist_delivery_order_bookGET /delivery/{settle}/order_bookQuery futures market depth information
DeliveryApilist_delivery_tradesGET /delivery/{settle}/tradesFutures market transaction records
DeliveryApilist_delivery_candlesticksGET /delivery/{settle}/candlesticksFutures market K-line chart
DeliveryApilist_delivery_tickersGET /delivery/{settle}/tickersGet all futures trading statistics
DeliveryApilist_delivery_insurance_ledgerGET /delivery/{settle}/insuranceFutures market insurance fund history
DeliveryApilist_delivery_accountsGET /delivery/{settle}/accountsGet futures account
DeliveryApilist_delivery_account_bookGET /delivery/{settle}/account_bookQuery futures account change history
DeliveryApilist_delivery_positionsGET /delivery/{settle}/positionsGet user position list
DeliveryApiget_delivery_positionGET /delivery/{settle}/positions/{contract}Get single position information
DeliveryApiupdate_delivery_position_marginPOST /delivery/{settle}/positions/{contract}/marginUpdate position margin
DeliveryApiupdate_delivery_position_leveragePOST /delivery/{settle}/positions/{contract}/leverageUpdate position leverage
DeliveryApiupdate_delivery_position_risk_limitPOST /delivery/{settle}/positions/{contract}/risk_limitUpdate position risk limit
DeliveryApilist_delivery_ordersGET /delivery/{settle}/ordersQuery futures order list
DeliveryApicreate_delivery_orderPOST /delivery/{settle}/ordersPlace futures order
DeliveryApicancel_delivery_ordersDELETE /delivery/{settle}/ordersCancel all orders with 'open' status
DeliveryApiget_delivery_orderGET /delivery/{settle}/orders/{order_id}Query single order details
DeliveryApicancel_delivery_orderDELETE /delivery/{settle}/orders/{order_id}Cancel single order
DeliveryApiget_my_delivery_tradesGET /delivery/{settle}/my_tradesQuery personal trading records
DeliveryApilist_delivery_position_closeGET /delivery/{settle}/position_closeQuery position close history
DeliveryApilist_delivery_liquidatesGET /delivery/{settle}/liquidatesQuery liquidation history
DeliveryApilist_delivery_settlementsGET /delivery/{settle}/settlementsQuery settlement records
DeliveryApilist_delivery_risk_limit_tiersGET /delivery/{settle}/risk_limit_tiersQuery risk limit tiers
DeliveryApilist_price_triggered_delivery_ordersGET /delivery/{settle}/price_ordersQuery auto order list
DeliveryApicreate_price_triggered_delivery_orderPOST /delivery/{settle}/price_ordersCreate price-triggered order
DeliveryApicancel_price_triggered_delivery_order_listDELETE /delivery/{settle}/price_ordersCancel all auto orders
DeliveryApiget_price_triggered_delivery_orderGET /delivery/{settle}/price_orders/{order_id}Query single auto order details
DeliveryApicancel_price_triggered_delivery_orderDELETE /delivery/{settle}/price_orders/{order_id}Cancel single auto order
EarnApiswap_eth2POST /earn/staking/eth2/swapETH2 swap
EarnApirate_list_eth2GET /earn/staking/eth2/rate_recordsETH2 historical return rate query
EarnApilist_dual_investment_plansGET /earn/dual/investment_planDual Investment product list
EarnApilist_dual_ordersGET /earn/dual/ordersDual Investment order list
EarnApiplace_dual_orderPOST /earn/dual/ordersPlace Dual Investment order
EarnApilist_structured_productsGET /earn/structured/productsStructured Product List
EarnApilist_structured_ordersGET /earn/structured/ordersStructured Product Order List
EarnApiplace_structured_orderPOST /earn/structured/ordersPlace Structured Product Order
EarnApifind_coinGET /earn/staking/coinsStaking coins
EarnApiswap_staking_coinPOST /earn/staking/swapOn-chain token swap for earned coins
FlashSwapApilist_flash_swap_currency_pairGET /flash_swap/currency_pairsList All Supported Currency Pairs In Flash Swap
FlashSwapApilist_flash_swap_ordersGET /flash_swap/ordersQuery flash swap order list
FlashSwapApicreate_flash_swap_orderPOST /flash_swap/ordersCreate a flash swap order
FlashSwapApiget_flash_swap_orderGET /flash_swap/orders/{order_id}Query single flash swap order
FlashSwapApipreview_flash_swap_orderPOST /flash_swap/orders/previewFlash swap order preview
FuturesApilist_futures_contractsGET /futures/{settle}/contractsQuery all futures contracts
FuturesApiget_futures_contractGET /futures/{settle}/contracts/{contract}Query single contract information
FuturesApilist_futures_order_bookGET /futures/{settle}/order_bookQuery futures market depth information
FuturesApilist_futures_tradesGET /futures/{settle}/tradesFutures market transaction records
FuturesApilist_futures_candlesticksGET /futures/{settle}/candlesticksFutures market K-line chart
FuturesApilist_futures_premium_indexGET /futures/{settle}/premium_indexPremium Index K-line chart
FuturesApilist_futures_tickersGET /futures/{settle}/tickersGet all futures trading statistics
FuturesApilist_futures_funding_rate_historyGET /futures/{settle}/funding_rateFutures market historical funding rate
FuturesApilist_futures_insurance_ledgerGET /futures/{settle}/insuranceFutures market insurance fund history
FuturesApilist_contract_statsGET /futures/{settle}/contract_statsFutures statistics
FuturesApiget_index_constituentsGET /futures/{settle}/index_constituents/{index}Query index constituents
FuturesApilist_liquidated_ordersGET /futures/{settle}/liq_ordersQuery liquidation order history
FuturesApilist_futures_risk_limit_tiersGET /futures/{settle}/risk_limit_tiersQuery risk limit tiers
FuturesApilist_futures_accountsGET /futures/{settle}/accountsGet futures account
FuturesApilist_futures_account_bookGET /futures/{settle}/account_bookQuery futures account change history
FuturesApilist_positionsGET /futures/{settle}/positionsGet user position list
FuturesApiget_positionGET /futures/{settle}/positions/{contract}Get single position information
FuturesApiupdate_position_marginPOST /futures/{settle}/positions/{contract}/marginUpdate position margin
FuturesApiupdate_position_leveragePOST /futures/{settle}/positions/{contract}/leverageUpdate position leverage
FuturesApiupdate_position_cross_modePOST /futures/{settle}/positions/cross_modeSwitch Position Margin Mode
FuturesApiupdate_dual_comp_position_cross_modePOST /futures/{settle}/dual_comp/positions/cross_modeSwitch Between Cross and Isolated Margin Modes Under Hedge Mode
FuturesApiupdate_position_risk_limitPOST /futures/{settle}/positions/{contract}/risk_limitUpdate position risk limit
FuturesApiset_dual_modePOST /futures/{settle}/dual_modeSet position mode
FuturesApiget_dual_mode_positionGET /futures/{settle}/dual_comp/positions/{contract}Get position information in dual mode
FuturesApiupdate_dual_mode_position_marginPOST /futures/{settle}/dual_comp/positions/{contract}/marginUpdate position margin in dual mode
FuturesApiupdate_dual_mode_position_leveragePOST /futures/{settle}/dual_comp/positions/{contract}/leverageUpdate position leverage in dual mode
FuturesApiupdate_dual_mode_position_risk_limitPOST /futures/{settle}/dual_comp/positions/{contract}/risk_limitUpdate position risk limit in dual mode
FuturesApilist_futures_ordersGET /futures/{settle}/ordersQuery futures order list
FuturesApicreate_futures_orderPOST /futures/{settle}/ordersPlace futures order
FuturesApicancel_futures_ordersDELETE /futures/{settle}/ordersCancel all orders with 'open' status
FuturesApiget_orders_with_time_rangeGET /futures/{settle}/orders_timerangeQuery futures order list by time range
FuturesApicreate_batch_futures_orderPOST /futures/{settle}/batch_ordersPlace batch futures orders
FuturesApiget_futures_orderGET /futures/{settle}/orders/{order_id}Query single order details
FuturesApiamend_futures_orderPUT /futures/{settle}/orders/{order_id}Amend single order
FuturesApicancel_futures_orderDELETE /futures/{settle}/orders/{order_id}Cancel single order
FuturesApiget_my_tradesGET /futures/{settle}/my_tradesQuery personal trading records
FuturesApiget_my_trades_with_time_rangeGET /futures/{settle}/my_trades_timerangeQuery personal trading records by time range
FuturesApilist_position_closeGET /futures/{settle}/position_closeQuery position close history
FuturesApilist_liquidatesGET /futures/{settle}/liquidatesQuery liquidation history
FuturesApilist_auto_deleveragesGET /futures/{settle}/auto_deleveragesQuery ADL auto-deleveraging order information
FuturesApicountdown_cancel_all_futuresPOST /futures/{settle}/countdown_cancel_allCountdown cancel orders
FuturesApiget_futures_feeGET /futures/{settle}/feeQuery futures market trading fee rates
FuturesApicancel_batch_future_ordersPOST /futures/{settle}/batch_cancel_ordersCancel batch orders by specified ID list
FuturesApiamend_batch_future_ordersPOST /futures/{settle}/batch_amend_ordersBatch modify orders by specified IDs
FuturesApiget_futures_risk_limit_tableGET /futures/{settle}/risk_limit_tableQuery risk limit table by table_id
FuturesApilist_price_triggered_ordersGET /futures/{settle}/price_ordersQuery auto order list
FuturesApicreate_price_triggered_orderPOST /futures/{settle}/price_ordersCreate price-triggered order
FuturesApicancel_price_triggered_order_listDELETE /futures/{settle}/price_ordersCancel all auto orders
FuturesApiget_price_triggered_orderGET /futures/{settle}/price_orders/{order_id}Query single auto order details
FuturesApicancel_price_triggered_orderDELETE /futures/{settle}/price_orders/{order_id}Cancel single auto order
MarginApilist_margin_accountsGET /margin/accountsMargin account list
MarginApilist_margin_account_bookGET /margin/account_bookQuery margin account balance change history
MarginApilist_funding_accountsGET /margin/funding_accountsFunding account list
MarginApiget_auto_repay_statusGET /margin/auto_repayQuery user auto repayment settings
MarginApiset_auto_repayPOST /margin/auto_repayUpdate user auto repayment settings
MarginApiget_margin_transferableGET /margin/transferableGet maximum transferable amount for isolated margin
MarginApiget_user_margin_tierGET /margin/user/loan_margin_tiersQuery user's own leverage lending tiers in current market
MarginApiget_market_margin_tierGET /margin/loan_margin_tiersQuery current market leverage lending tiers
MarginApiset_user_market_leveragePOST /margin/leverage/user_market_settingSet user market leverage multiplier
MarginApilist_margin_user_accountGET /margin/user/accountQuery user's isolated margin account list
MarginApilist_cross_margin_loansGET /margin/cross/loansQuery cross margin borrow history (deprecated)
MarginApilist_cross_margin_repaymentsGET /margin/cross/repaymentsRetrieve cross margin repayments. (deprecated)
MultiCollateralLoanApilist_multi_collateral_ordersGET /loan/multi_collateral/ordersQuery multi-currency collateral order list
MultiCollateralLoanApicreate_multi_collateralPOST /loan/multi_collateral/ordersPlace multi-currency collateral order
MultiCollateralLoanApiget_multi_collateral_order_detailGET /loan/multi_collateral/orders/{order_id}Query order details
MultiCollateralLoanApilist_multi_repay_recordsGET /loan/multi_collateral/repayQuery multi-currency collateral repayment records
MultiCollateralLoanApirepay_multi_collateral_loanPOST /loan/multi_collateral/repayMulti-currency collateral repayment
MultiCollateralLoanApilist_multi_collateral_recordsGET /loan/multi_collateral/mortgageQuery collateral adjustment records
MultiCollateralLoanApioperate_multi_collateralPOST /loan/multi_collateral/mortgageAdd or withdraw collateral
MultiCollateralLoanApilist_user_currency_quotaGET /loan/multi_collateral/currency_quotaQuery user's collateral and borrowing currency quota information
MultiCollateralLoanApilist_multi_collateral_currenciesGET /loan/multi_collateral/currenciesQuery supported borrowing and collateral currencies for multi-currency collateral
MultiCollateralLoanApiget_multi_collateral_ltvGET /loan/multi_collateral/ltvQuery collateralization ratio information
MultiCollateralLoanApiget_multi_collateral_fix_rateGET /loan/multi_collateral/fixed_rateQuery currency's 7-day and 30-day fixed interest rates
MultiCollateralLoanApiget_multi_collateral_current_rateGET /loan/multi_collateral/current_rateQuery currency's current interest rate
OptionsApilist_options_underlyingsGET /options/underlyingsList all underlying assets
OptionsApilist_options_expirationsGET /options/expirationsList all expiration dates
OptionsApilist_options_contractsGET /options/contractsList all contracts for specified underlying and expiration date
OptionsApiget_options_contractGET /options/contracts/{contract}Query specified contract details
OptionsApilist_options_settlementsGET /options/settlementsList settlement history
OptionsApiget_options_settlementGET /options/settlements/{contract}Get specified contract settlement information
OptionsApilist_my_options_settlementsGET /options/my_settlementsQuery personal settlement records
OptionsApilist_options_order_bookGET /options/order_bookQuery options contract order book
OptionsApilist_options_tickersGET /options/tickersQuery options market ticker information
OptionsApilist_options_underlying_tickersGET /options/underlying/tickers/{underlying}Query underlying ticker information
OptionsApilist_options_candlesticksGET /options/candlesticksOptions contract market candlestick chart
OptionsApilist_options_underlying_candlesticksGET /options/underlying/candlesticksUnderlying index price candlestick chart
OptionsApilist_options_tradesGET /options/tradesMarket trade records
OptionsApilist_options_accountGET /options/accountsQuery account information
OptionsApilist_options_account_bookGET /options/account_bookQuery account change history
OptionsApilist_options_positionsGET /options/positionsList user's positions of specified underlying
OptionsApiget_options_positionGET /options/positions/{contract}Get specified contract position
OptionsApilist_options_position_closeGET /options/position_closeList user's liquidation history of specified underlying
OptionsApilist_options_ordersGET /options/ordersList options orders
OptionsApicreate_options_orderPOST /options/ordersCreate an options order
OptionsApicancel_options_ordersDELETE /options/ordersCancel all orders with 'open' status
OptionsApiget_options_orderGET /options/orders/{order_id}Query single order details
OptionsApicancel_options_orderDELETE /options/orders/{order_id}Cancel single order
OptionsApicountdown_cancel_all_optionsPOST /options/countdown_cancel_allCountdown cancel orders
OptionsApilist_my_options_tradesGET /options/my_tradesQuery personal trading records
OptionsApiget_options_mmpGET /options/mmpMMP Query.
OptionsApiset_options_mmpPOST /options/mmpMMP Settings
OptionsApireset_options_mmpPOST /options/mmp/resetMMP Reset
RebateApiagency_transaction_historyGET /rebate/agency/transaction_historyBroker obtains transaction history of recommended users
RebateApiagency_commissions_historyGET /rebate/agency/commission_historyBroker obtains rebate history of recommended users
RebateApipartner_transaction_historyGET /rebate/partner/transaction_historyPartner obtains transaction history of recommended users
RebateApipartner_commissions_historyGET /rebate/partner/commission_historyPartner obtains rebate records of recommended users
RebateApipartner_sub_listGET /rebate/partner/sub_listPartner subordinate list
RebateApirebate_broker_commission_historyGET /rebate/broker/commission_historyBroker obtains user's rebate records
RebateApirebate_broker_transaction_historyGET /rebate/broker/transaction_historyBroker obtains user's trading history
RebateApirebate_user_infoGET /rebate/user/infoUser obtains rebate information
RebateApiuser_sub_relationGET /rebate/user/sub_relationUser subordinate relationship
SpotApilist_currenciesGET /spot/currenciesQuery all currency information
SpotApiget_currencyGET /spot/currencies/{currency}Query single currency information
SpotApilist_currency_pairsGET /spot/currency_pairsQuery all supported currency pairs
SpotApiget_currency_pairGET /spot/currency_pairs/{currency_pair}Query single currency pair details
SpotApilist_tickersGET /spot/tickersGet currency pair ticker information
SpotApilist_order_bookGET /spot/order_bookGet market depth information
SpotApilist_tradesGET /spot/tradesQuery market transaction records
SpotApilist_candlesticksGET /spot/candlesticksMarket K-line chart
SpotApiget_feeGET /spot/feeQuery account fee rates
SpotApiget_batch_spot_feeGET /spot/batch_feeBatch query account fee rates
SpotApilist_spot_accountsGET /spot/accountsList spot trading accounts
SpotApilist_spot_account_bookGET /spot/account_bookQuery spot account transaction history
SpotApicreate_batch_ordersPOST /spot/batch_ordersBatch place orders
SpotApilist_all_open_ordersGET /spot/open_ordersList all open orders
SpotApicreate_cross_liquidate_orderPOST /spot/cross_liquidate_ordersClose position when cross-currency is disabled
SpotApilist_ordersGET /spot/ordersList orders
SpotApicreate_orderPOST /spot/ordersCreate an order
SpotApicancel_ordersDELETE /spot/ordersCancel all `open` orders in specified currency pair
SpotApicancel_batch_ordersPOST /spot/cancel_batch_ordersCancel batch orders by specified ID list
SpotApiget_orderGET /spot/orders/{order_id}Query single order details
SpotApicancel_orderDELETE /spot/orders/{order_id}Cancel single order
SpotApiamend_orderPATCH /spot/orders/{order_id}Amend single order
SpotApilist_my_tradesGET /spot/my_tradesQuery personal trading records
SpotApiget_system_timeGET /spot/timeGet server current time
SpotApicountdown_cancel_all_spotPOST /spot/countdown_cancel_allCountdown cancel orders
SpotApiamend_batch_ordersPOST /spot/amend_batch_ordersBatch modification of orders
SpotApiget_spot_insurance_historyGET /spot/insurance_historyQuery spot insurance fund historical data
SpotApilist_spot_price_triggered_ordersGET /spot/price_ordersQuery running auto order list
SpotApicreate_spot_price_triggered_orderPOST /spot/price_ordersCreate price-triggered order
SpotApicancel_spot_price_triggered_order_listDELETE /spot/price_ordersCancel all auto orders
SpotApiget_spot_price_triggered_orderGET /spot/price_orders/{order_id}Query single auto order details
SpotApicancel_spot_price_triggered_orderDELETE /spot/price_orders/{order_id}Cancel single auto order
WalletApilist_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
WalletApiget_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
WalletApilist_withdrawalsGET /wallet/withdrawalsGet withdrawal records
WalletApilist_depositsGET /wallet/depositsGet deposit records
WalletApitransferPOST /wallet/transfersTransfer between trading accounts
WalletApilist_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
WalletApitransfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
WalletApisub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
WalletApiget_transfer_order_statusGET /wallet/order_statusTransfer status query
WalletApilist_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
WalletApilist_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
WalletApilist_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
WalletApilist_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
WalletApilist_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
WalletApilist_saved_addressGET /wallet/saved_addressQuery withdrawal address whitelist
WalletApiget_trade_feeGET /wallet/feeQuery personal trading fees
WalletApiget_total_balanceGET /wallet/total_balanceQuery personal account totals
WalletApilist_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
WalletApiconvert_small_balancePOST /wallet/small_balanceConvert small balance currency
WalletApilist_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
WalletApilist_push_ordersGET /wallet/pushGet UID transfer history
WithdrawalApiwithdrawPOST /withdrawalsWithdraw
WithdrawalApiwithdraw_push_orderPOST /withdrawals/pushUID transfer
WithdrawalApicancel_withdrawalDELETE /withdrawals/{withdrawal_id}Cancel withdrawal with specified ID

Documentation For Models

Documentation For Authorization

apiv4

Authentication with APIv4 key and secret

For details, refer to: APIv4 signed request requirements

Author

support@mail.gate.com

About

No description, website, or topics provided.

Resources

Stars

344 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages

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

Repository files navigation

Important

This repository has been archived and is no longer maintained. The project has moved to gate/gateapi-python. Please use the new repository for updates, issues, and pull requests.

gate-api

Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v4.105.8
  • Package version: 7.1.8
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.gate.com/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

You can install directly using:

pip install --user gate-api

Then import the package:

importgate_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importgate_api

Getting Started

Please follow the installation procedure and then run the following:

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.EarnUniApi(api_client)
try:
# Query lending currency listapi_response=api_instance.list_uni_currencies()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n"%e)

For a more complete API usage example, refer to the demo application in example directory

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
EarnUniApilist_uni_currenciesGET /earn/uni/currenciesQuery lending currency list
EarnUniApiget_uni_currencyGET /earn/uni/currencies/{currency}Query single lending currency details
EarnUniApilist_user_uni_lendsGET /earn/uni/lendsQuery user's lending order list
EarnUniApicreate_uni_lendPOST /earn/uni/lendsCreate lending or redemption
EarnUniApichange_uni_lendPATCH /earn/uni/lendsAmend user lending information
EarnUniApilist_uni_lend_recordsGET /earn/uni/lend_recordsQuery lending transaction records
EarnUniApiget_uni_interestGET /earn/uni/interests/{currency}Query user's total interest income for specified currency
EarnUniApilist_uni_interest_recordsGET /earn/uni/interest_recordsQuery user dividend records
EarnUniApiget_uni_interest_statusGET /earn/uni/interest_status/{currency}Query currency interest compounding status
EarnUniApilist_uni_chartGET /earn/uni/chartUniLoan currency annualized trend chart
EarnUniApilist_uni_rateGET /earn/uni/rateCurrency estimated annualized interest rate
MarginUniApilist_uni_currency_pairsGET /margin/uni/currency_pairsList lending markets
MarginUniApiget_uni_currency_pairGET /margin/uni/currency_pairs/{currency_pair}Get lending market details
MarginUniApiget_margin_uni_estimate_rateGET /margin/uni/estimate_rateEstimate interest rate for isolated margin currencies
MarginUniApilist_uni_loansGET /margin/uni/loansQuery loans
MarginUniApicreate_uni_loanPOST /margin/uni/loansBorrow or repay
MarginUniApilist_uni_loan_recordsGET /margin/uni/loan_recordsQuery loan records
MarginUniApilist_uni_loan_interest_recordsGET /margin/uni/interest_recordsQuery interest deduction records
MarginUniApiget_uni_borrowableGET /margin/uni/borrowableQuery maximum borrowable amount by currency
SubAccountApilist_sub_accountsGET /sub_accountsList sub-accounts
SubAccountApicreate_sub_accountsPOST /sub_accountsCreate a new sub-account
SubAccountApiget_sub_accountGET /sub_accounts/{user_id}Get sub-account
SubAccountApilist_sub_account_keysGET /sub_accounts/{user_id}/keysList all API key pairs of the sub-account
SubAccountApicreate_sub_account_keysPOST /sub_accounts/{user_id}/keysCreate new sub-account API key pair
SubAccountApiget_sub_account_keyGET /sub_accounts/{user_id}/keys/{key}Get specific API key pair of the sub-account
SubAccountApiupdate_sub_account_keysPUT /sub_accounts/{user_id}/keys/{key}Update sub-account API key pair
SubAccountApidelete_sub_account_keysDELETE /sub_accounts/{user_id}/keys/{key}Delete sub-account API key pair
SubAccountApilock_sub_accountPOST /sub_accounts/{user_id}/lockLock sub-account
SubAccountApiunlock_sub_accountPOST /sub_accounts/{user_id}/unlockUnlock sub-account
SubAccountApilist_unified_modeGET /sub_accounts/unified_modeGet sub-account mode
UnifiedApilist_unified_accountsGET /unified/accountsGet unified account information
UnifiedApiget_unified_borrowableGET /unified/borrowableQuery maximum borrowable amount for unified account
UnifiedApiget_unified_transferableGET /unified/transferableQuery maximum transferable amount for unified account
UnifiedApiget_unified_transferablesGET /unified/transferablesBatch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
UnifiedApiget_unified_borrowable_listGET /unified/batch_borrowableBatch query unified account maximum borrowable amount
UnifiedApilist_unified_loansGET /unified/loansQuery loans
UnifiedApicreate_unified_loanPOST /unified/loansBorrow or repay
UnifiedApilist_unified_loan_recordsGET /unified/loan_recordsQuery loan records
UnifiedApilist_unified_loan_interest_recordsGET /unified/interest_recordsQuery interest deduction records
UnifiedApiget_unified_risk_unitsGET /unified/risk_unitsGet user risk unit details
UnifiedApiget_unified_modeGET /unified/unified_modeQuery mode of the unified account
UnifiedApiset_unified_modePUT /unified/unified_modeSet unified account mode
UnifiedApiget_unified_estimate_rateGET /unified/estimate_rateQuery unified account estimated interest rate
UnifiedApilist_currency_discount_tiersGET /unified/currency_discount_tiersQuery unified account tiered
UnifiedApilist_loan_margin_tiersGET /unified/loan_margin_tiersQuery unified account tiered loan margin
UnifiedApicalculate_portfolio_marginPOST /unified/portfolio_calculatorPortfolio margin calculator
UnifiedApiget_user_leverage_currency_configGET /unified/leverage/user_currency_configMaximum and minimum currency leverage that can be set
UnifiedApiget_user_leverage_currency_settingGET /unified/leverage/user_currency_settingGet user currency leverage
UnifiedApiset_user_leverage_currency_settingPOST /unified/leverage/user_currency_settingSet loan currency leverage
UnifiedApilist_unified_currenciesGET /unified/currenciesList of loan currencies supported by unified account
UnifiedApiget_history_loan_rateGET /unified/history_loan_rateGet historical lending rates
UnifiedApiset_unified_collateralPOST /unified/collateral_currenciesSet collateral currency
AccountApiget_account_detailGET /account/detailRetrieve user account information
AccountApiget_account_rate_limitGET /account/rate_limitGet user transaction rate limit information
AccountApilist_stp_groupsGET /account/stp_groupsQuery STP user groups created by the user
AccountApicreate_stp_groupPOST /account/stp_groupsCreate STP user group
AccountApilist_stp_groups_usersGET /account/stp_groups/{stp_id}/usersQuery users in the STP user group
AccountApiadd_stp_group_usersPOST /account/stp_groups/{stp_id}/usersAdd users to the STP user group
AccountApidelete_stp_group_usersDELETE /account/stp_groups/{stp_id}/usersDelete users from the STP user group
AccountApiget_debit_feeGET /account/debit_feeQuery GT fee deduction configuration
AccountApiset_debit_feePOST /account/debit_feeConfigure GT fee deduction
CollateralLoanApilist_collateral_loan_ordersGET /loan/collateral/ordersQuery collateral loan order list
CollateralLoanApicreate_collateral_loanPOST /loan/collateral/ordersPlace collateral loan order
CollateralLoanApiget_collateral_loan_order_detailGET /loan/collateral/orders/{order_id}Query single order details
CollateralLoanApirepay_collateral_loanPOST /loan/collateral/repayCollateral loan repayment
CollateralLoanApilist_repay_recordsGET /loan/collateral/repay_recordsQuery collateral loan repayment records
CollateralLoanApilist_collateral_recordsGET /loan/collateral/collateralsQuery collateral adjustment records
CollateralLoanApioperate_collateralPOST /loan/collateral/collateralsIncrease or redeem collateral
CollateralLoanApiget_user_total_amountGET /loan/collateral/total_amountQuery user's total borrowing and collateral amount
CollateralLoanApiget_user_ltv_infoGET /loan/collateral/ltvQuery user's collateralization ratio and remaining borrowable currencies
CollateralLoanApilist_collateral_currenciesGET /loan/collateral/currenciesQuery supported borrowing and collateral currencies
DeliveryApilist_delivery_contractsGET /delivery/{settle}/contractsQuery all futures contracts
DeliveryApiget_delivery_contractGET /delivery/{settle}/contracts/{contract}Query single contract information
DeliveryApilist_delivery_order_bookGET /delivery/{settle}/order_bookQuery futures market depth information
DeliveryApilist_delivery_tradesGET /delivery/{settle}/tradesFutures market transaction records
DeliveryApilist_delivery_candlesticksGET /delivery/{settle}/candlesticksFutures market K-line chart
DeliveryApilist_delivery_tickersGET /delivery/{settle}/tickersGet all futures trading statistics
DeliveryApilist_delivery_insurance_ledgerGET /delivery/{settle}/insuranceFutures market insurance fund history
DeliveryApilist_delivery_accountsGET /delivery/{settle}/accountsGet futures account
DeliveryApilist_delivery_account_bookGET /delivery/{settle}/account_bookQuery futures account change history
DeliveryApilist_delivery_positionsGET /delivery/{settle}/positionsGet user position list
DeliveryApiget_delivery_positionGET /delivery/{settle}/positions/{contract}Get single position information
DeliveryApiupdate_delivery_position_marginPOST /delivery/{settle}/positions/{contract}/marginUpdate position margin
DeliveryApiupdate_delivery_position_leveragePOST /delivery/{settle}/positions/{contract}/leverageUpdate position leverage
DeliveryApiupdate_delivery_position_risk_limitPOST /delivery/{settle}/positions/{contract}/risk_limitUpdate position risk limit
DeliveryApilist_delivery_ordersGET /delivery/{settle}/ordersQuery futures order list
DeliveryApicreate_delivery_orderPOST /delivery/{settle}/ordersPlace futures order
DeliveryApicancel_delivery_ordersDELETE /delivery/{settle}/ordersCancel all orders with 'open' status
DeliveryApiget_delivery_orderGET /delivery/{settle}/orders/{order_id}Query single order details
DeliveryApicancel_delivery_orderDELETE /delivery/{settle}/orders/{order_id}Cancel single order
DeliveryApiget_my_delivery_tradesGET /delivery/{settle}/my_tradesQuery personal trading records
DeliveryApilist_delivery_position_closeGET /delivery/{settle}/position_closeQuery position close history
DeliveryApilist_delivery_liquidatesGET /delivery/{settle}/liquidatesQuery liquidation history
DeliveryApilist_delivery_settlementsGET /delivery/{settle}/settlementsQuery settlement records
DeliveryApilist_delivery_risk_limit_tiersGET /delivery/{settle}/risk_limit_tiersQuery risk limit tiers
DeliveryApilist_price_triggered_delivery_ordersGET /delivery/{settle}/price_ordersQuery auto order list
DeliveryApicreate_price_triggered_delivery_orderPOST /delivery/{settle}/price_ordersCreate price-triggered order
DeliveryApicancel_price_triggered_delivery_order_listDELETE /delivery/{settle}/price_ordersCancel all auto orders
DeliveryApiget_price_triggered_delivery_orderGET /delivery/{settle}/price_orders/{order_id}Query single auto order details
DeliveryApicancel_price_triggered_delivery_orderDELETE /delivery/{settle}/price_orders/{order_id}Cancel single auto order
EarnApiswap_eth2POST /earn/staking/eth2/swapETH2 swap
EarnApirate_list_eth2GET /earn/staking/eth2/rate_recordsETH2 historical return rate query
EarnApilist_dual_investment_plansGET /earn/dual/investment_planDual Investment product list
EarnApilist_dual_ordersGET /earn/dual/ordersDual Investment order list
EarnApiplace_dual_orderPOST /earn/dual/ordersPlace Dual Investment order
EarnApilist_structured_productsGET /earn/structured/productsStructured Product List
EarnApilist_structured_ordersGET /earn/structured/ordersStructured Product Order List
EarnApiplace_structured_orderPOST /earn/structured/ordersPlace Structured Product Order
EarnApifind_coinGET /earn/staking/coinsStaking coins
EarnApiswap_staking_coinPOST /earn/staking/swapOn-chain token swap for earned coins
FlashSwapApilist_flash_swap_currency_pairGET /flash_swap/currency_pairsList All Supported Currency Pairs In Flash Swap
FlashSwapApilist_flash_swap_ordersGET /flash_swap/ordersQuery flash swap order list
FlashSwapApicreate_flash_swap_orderPOST /flash_swap/ordersCreate a flash swap order
FlashSwapApiget_flash_swap_orderGET /flash_swap/orders/{order_id}Query single flash swap order
FlashSwapApipreview_flash_swap_orderPOST /flash_swap/orders/previewFlash swap order preview
FuturesApilist_futures_contractsGET /futures/{settle}/contractsQuery all futures contracts
FuturesApiget_futures_contractGET /futures/{settle}/contracts/{contract}Query single contract information
FuturesApilist_futures_order_bookGET /futures/{settle}/order_bookQuery futures market depth information
FuturesApilist_futures_tradesGET /futures/{settle}/tradesFutures market transaction records
FuturesApilist_futures_candlesticksGET /futures/{settle}/candlesticksFutures market K-line chart
FuturesApilist_futures_premium_indexGET /futures/{settle}/premium_indexPremium Index K-line chart
FuturesApilist_futures_tickersGET /futures/{settle}/tickersGet all futures trading statistics
FuturesApilist_futures_funding_rate_historyGET /futures/{settle}/funding_rateFutures market historical funding rate
FuturesApilist_futures_insurance_ledgerGET /futures/{settle}/insuranceFutures market insurance fund history
FuturesApilist_contract_statsGET /futures/{settle}/contract_statsFutures statistics
FuturesApiget_index_constituentsGET /futures/{settle}/index_constituents/{index}Query index constituents
FuturesApilist_liquidated_ordersGET /futures/{settle}/liq_ordersQuery liquidation order history
FuturesApilist_futures_risk_limit_tiersGET /futures/{settle}/risk_limit_tiersQuery risk limit tiers
FuturesApilist_futures_accountsGET /futures/{settle}/accountsGet futures account
FuturesApilist_futures_account_bookGET /futures/{settle}/account_bookQuery futures account change history
FuturesApilist_positionsGET /futures/{settle}/positionsGet user position list
FuturesApiget_positionGET /futures/{settle}/positions/{contract}Get single position information
FuturesApiupdate_position_marginPOST /futures/{settle}/positions/{contract}/marginUpdate position margin
FuturesApiupdate_position_leveragePOST /futures/{settle}/positions/{contract}/leverageUpdate position leverage
FuturesApiupdate_position_cross_modePOST /futures/{settle}/positions/cross_modeSwitch Position Margin Mode
FuturesApiupdate_dual_comp_position_cross_modePOST /futures/{settle}/dual_comp/positions/cross_modeSwitch Between Cross and Isolated Margin Modes Under Hedge Mode
FuturesApiupdate_position_risk_limitPOST /futures/{settle}/positions/{contract}/risk_limitUpdate position risk limit
FuturesApiset_dual_modePOST /futures/{settle}/dual_modeSet position mode
FuturesApiget_dual_mode_positionGET /futures/{settle}/dual_comp/positions/{contract}Get position information in dual mode
FuturesApiupdate_dual_mode_position_marginPOST /futures/{settle}/dual_comp/positions/{contract}/marginUpdate position margin in dual mode
FuturesApiupdate_dual_mode_position_leveragePOST /futures/{settle}/dual_comp/positions/{contract}/leverageUpdate position leverage in dual mode
FuturesApiupdate_dual_mode_position_risk_limitPOST /futures/{settle}/dual_comp/positions/{contract}/risk_limitUpdate position risk limit in dual mode
FuturesApilist_futures_ordersGET /futures/{settle}/ordersQuery futures order list
FuturesApicreate_futures_orderPOST /futures/{settle}/ordersPlace futures order
FuturesApicancel_futures_ordersDELETE /futures/{settle}/ordersCancel all orders with 'open' status
FuturesApiget_orders_with_time_rangeGET /futures/{settle}/orders_timerangeQuery futures order list by time range
FuturesApicreate_batch_futures_orderPOST /futures/{settle}/batch_ordersPlace batch futures orders
FuturesApiget_futures_orderGET /futures/{settle}/orders/{order_id}Query single order details
FuturesApiamend_futures_orderPUT /futures/{settle}/orders/{order_id}Amend single order
FuturesApicancel_futures_orderDELETE /futures/{settle}/orders/{order_id}Cancel single order
FuturesApiget_my_tradesGET /futures/{settle}/my_tradesQuery personal trading records
FuturesApiget_my_trades_with_time_rangeGET /futures/{settle}/my_trades_timerangeQuery personal trading records by time range
FuturesApilist_position_closeGET /futures/{settle}/position_closeQuery position close history
FuturesApilist_liquidatesGET /futures/{settle}/liquidatesQuery liquidation history
FuturesApilist_auto_deleveragesGET /futures/{settle}/auto_deleveragesQuery ADL auto-deleveraging order information
FuturesApicountdown_cancel_all_futuresPOST /futures/{settle}/countdown_cancel_allCountdown cancel orders
FuturesApiget_futures_feeGET /futures/{settle}/feeQuery futures market trading fee rates
FuturesApicancel_batch_future_ordersPOST /futures/{settle}/batch_cancel_ordersCancel batch orders by specified ID list
FuturesApiamend_batch_future_ordersPOST /futures/{settle}/batch_amend_ordersBatch modify orders by specified IDs
FuturesApiget_futures_risk_limit_tableGET /futures/{settle}/risk_limit_tableQuery risk limit table by table_id
FuturesApilist_price_triggered_ordersGET /futures/{settle}/price_ordersQuery auto order list
FuturesApicreate_price_triggered_orderPOST /futures/{settle}/price_ordersCreate price-triggered order
FuturesApicancel_price_triggered_order_listDELETE /futures/{settle}/price_ordersCancel all auto orders
FuturesApiget_price_triggered_orderGET /futures/{settle}/price_orders/{order_id}Query single auto order details
FuturesApicancel_price_triggered_orderDELETE /futures/{settle}/price_orders/{order_id}Cancel single auto order
MarginApilist_margin_accountsGET /margin/accountsMargin account list
MarginApilist_margin_account_bookGET /margin/account_bookQuery margin account balance change history
MarginApilist_funding_accountsGET /margin/funding_accountsFunding account list
MarginApiget_auto_repay_statusGET /margin/auto_repayQuery user auto repayment settings
MarginApiset_auto_repayPOST /margin/auto_repayUpdate user auto repayment settings
MarginApiget_margin_transferableGET /margin/transferableGet maximum transferable amount for isolated margin
MarginApiget_user_margin_tierGET /margin/user/loan_margin_tiersQuery user's own leverage lending tiers in current market
MarginApiget_market_margin_tierGET /margin/loan_margin_tiersQuery current market leverage lending tiers
MarginApiset_user_market_leveragePOST /margin/leverage/user_market_settingSet user market leverage multiplier
MarginApilist_margin_user_accountGET /margin/user/accountQuery user's isolated margin account list
MarginApilist_cross_margin_loansGET /margin/cross/loansQuery cross margin borrow history (deprecated)
MarginApilist_cross_margin_repaymentsGET /margin/cross/repaymentsRetrieve cross margin repayments. (deprecated)
MultiCollateralLoanApilist_multi_collateral_ordersGET /loan/multi_collateral/ordersQuery multi-currency collateral order list
MultiCollateralLoanApicreate_multi_collateralPOST /loan/multi_collateral/ordersPlace multi-currency collateral order
MultiCollateralLoanApiget_multi_collateral_order_detailGET /loan/multi_collateral/orders/{order_id}Query order details
MultiCollateralLoanApilist_multi_repay_recordsGET /loan/multi_collateral/repayQuery multi-currency collateral repayment records
MultiCollateralLoanApirepay_multi_collateral_loanPOST /loan/multi_collateral/repayMulti-currency collateral repayment
MultiCollateralLoanApilist_multi_collateral_recordsGET /loan/multi_collateral/mortgageQuery collateral adjustment records
MultiCollateralLoanApioperate_multi_collateralPOST /loan/multi_collateral/mortgageAdd or withdraw collateral
MultiCollateralLoanApilist_user_currency_quotaGET /loan/multi_collateral/currency_quotaQuery user's collateral and borrowing currency quota information
MultiCollateralLoanApilist_multi_collateral_currenciesGET /loan/multi_collateral/currenciesQuery supported borrowing and collateral currencies for multi-currency collateral
MultiCollateralLoanApiget_multi_collateral_ltvGET /loan/multi_collateral/ltvQuery collateralization ratio information
MultiCollateralLoanApiget_multi_collateral_fix_rateGET /loan/multi_collateral/fixed_rateQuery currency's 7-day and 30-day fixed interest rates
MultiCollateralLoanApiget_multi_collateral_current_rateGET /loan/multi_collateral/current_rateQuery currency's current interest rate
OptionsApilist_options_underlyingsGET /options/underlyingsList all underlying assets
OptionsApilist_options_expirationsGET /options/expirationsList all expiration dates
OptionsApilist_options_contractsGET /options/contractsList all contracts for specified underlying and expiration date
OptionsApiget_options_contractGET /options/contracts/{contract}Query specified contract details
OptionsApilist_options_settlementsGET /options/settlementsList settlement history
OptionsApiget_options_settlementGET /options/settlements/{contract}Get specified contract settlement information
OptionsApilist_my_options_settlementsGET /options/my_settlementsQuery personal settlement records
OptionsApilist_options_order_bookGET /options/order_bookQuery options contract order book
OptionsApilist_options_tickersGET /options/tickersQuery options market ticker information
OptionsApilist_options_underlying_tickersGET /options/underlying/tickers/{underlying}Query underlying ticker information
OptionsApilist_options_candlesticksGET /options/candlesticksOptions contract market candlestick chart
OptionsApilist_options_underlying_candlesticksGET /options/underlying/candlesticksUnderlying index price candlestick chart
OptionsApilist_options_tradesGET /options/tradesMarket trade records
OptionsApilist_options_accountGET /options/accountsQuery account information
OptionsApilist_options_account_bookGET /options/account_bookQuery account change history
OptionsApilist_options_positionsGET /options/positionsList user's positions of specified underlying
OptionsApiget_options_positionGET /options/positions/{contract}Get specified contract position
OptionsApilist_options_position_closeGET /options/position_closeList user's liquidation history of specified underlying
OptionsApilist_options_ordersGET /options/ordersList options orders
OptionsApicreate_options_orderPOST /options/ordersCreate an options order
OptionsApicancel_options_ordersDELETE /options/ordersCancel all orders with 'open' status
OptionsApiget_options_orderGET /options/orders/{order_id}Query single order details
OptionsApicancel_options_orderDELETE /options/orders/{order_id}Cancel single order
OptionsApicountdown_cancel_all_optionsPOST /options/countdown_cancel_allCountdown cancel orders
OptionsApilist_my_options_tradesGET /options/my_tradesQuery personal trading records
OptionsApiget_options_mmpGET /options/mmpMMP Query.
OptionsApiset_options_mmpPOST /options/mmpMMP Settings
OptionsApireset_options_mmpPOST /options/mmp/resetMMP Reset
RebateApiagency_transaction_historyGET /rebate/agency/transaction_historyBroker obtains transaction history of recommended users
RebateApiagency_commissions_historyGET /rebate/agency/commission_historyBroker obtains rebate history of recommended users
RebateApipartner_transaction_historyGET /rebate/partner/transaction_historyPartner obtains transaction history of recommended users
RebateApipartner_commissions_historyGET /rebate/partner/commission_historyPartner obtains rebate records of recommended users
RebateApipartner_sub_listGET /rebate/partner/sub_listPartner subordinate list
RebateApirebate_broker_commission_historyGET /rebate/broker/commission_historyBroker obtains user's rebate records
RebateApirebate_broker_transaction_historyGET /rebate/broker/transaction_historyBroker obtains user's trading history
RebateApirebate_user_infoGET /rebate/user/infoUser obtains rebate information
RebateApiuser_sub_relationGET /rebate/user/sub_relationUser subordinate relationship
SpotApilist_currenciesGET /spot/currenciesQuery all currency information
SpotApiget_currencyGET /spot/currencies/{currency}Query single currency information
SpotApilist_currency_pairsGET /spot/currency_pairsQuery all supported currency pairs
SpotApiget_currency_pairGET /spot/currency_pairs/{currency_pair}Query single currency pair details
SpotApilist_tickersGET /spot/tickersGet currency pair ticker information
SpotApilist_order_bookGET /spot/order_bookGet market depth information
SpotApilist_tradesGET /spot/tradesQuery market transaction records
SpotApilist_candlesticksGET /spot/candlesticksMarket K-line chart
SpotApiget_feeGET /spot/feeQuery account fee rates
SpotApiget_batch_spot_feeGET /spot/batch_feeBatch query account fee rates
SpotApilist_spot_accountsGET /spot/accountsList spot trading accounts
SpotApilist_spot_account_bookGET /spot/account_bookQuery spot account transaction history
SpotApicreate_batch_ordersPOST /spot/batch_ordersBatch place orders
SpotApilist_all_open_ordersGET /spot/open_ordersList all open orders
SpotApicreate_cross_liquidate_orderPOST /spot/cross_liquidate_ordersClose position when cross-currency is disabled
SpotApilist_ordersGET /spot/ordersList orders
SpotApicreate_orderPOST /spot/ordersCreate an order
SpotApicancel_ordersDELETE /spot/ordersCancel all `open` orders in specified currency pair
SpotApicancel_batch_ordersPOST /spot/cancel_batch_ordersCancel batch orders by specified ID list
SpotApiget_orderGET /spot/orders/{order_id}Query single order details
SpotApicancel_orderDELETE /spot/orders/{order_id}Cancel single order
SpotApiamend_orderPATCH /spot/orders/{order_id}Amend single order
SpotApilist_my_tradesGET /spot/my_tradesQuery personal trading records
SpotApiget_system_timeGET /spot/timeGet server current time
SpotApicountdown_cancel_all_spotPOST /spot/countdown_cancel_allCountdown cancel orders
SpotApiamend_batch_ordersPOST /spot/amend_batch_ordersBatch modification of orders
SpotApiget_spot_insurance_historyGET /spot/insurance_historyQuery spot insurance fund historical data
SpotApilist_spot_price_triggered_ordersGET /spot/price_ordersQuery running auto order list
SpotApicreate_spot_price_triggered_orderPOST /spot/price_ordersCreate price-triggered order
SpotApicancel_spot_price_triggered_order_listDELETE /spot/price_ordersCancel all auto orders
SpotApiget_spot_price_triggered_orderGET /spot/price_orders/{order_id}Query single auto order details
SpotApicancel_spot_price_triggered_orderDELETE /spot/price_orders/{order_id}Cancel single auto order
WalletApilist_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
WalletApiget_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
WalletApilist_withdrawalsGET /wallet/withdrawalsGet withdrawal records
WalletApilist_depositsGET /wallet/depositsGet deposit records
WalletApitransferPOST /wallet/transfersTransfer between trading accounts
WalletApilist_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
WalletApitransfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
WalletApisub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
WalletApiget_transfer_order_statusGET /wallet/order_statusTransfer status query
WalletApilist_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
WalletApilist_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
WalletApilist_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
WalletApilist_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
WalletApilist_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
WalletApilist_saved_addressGET /wallet/saved_addressQuery withdrawal address whitelist
WalletApiget_trade_feeGET /wallet/feeQuery personal trading fees
WalletApiget_total_balanceGET /wallet/total_balanceQuery personal account totals
WalletApilist_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
WalletApiconvert_small_balancePOST /wallet/small_balanceConvert small balance currency
WalletApilist_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
WalletApilist_push_ordersGET /wallet/pushGet UID transfer history
WithdrawalApiwithdrawPOST /withdrawalsWithdraw
WithdrawalApiwithdraw_push_orderPOST /withdrawals/pushUID transfer
WithdrawalApicancel_withdrawalDELETE /withdrawals/{withdrawal_id}Cancel withdrawal with specified ID

Documentation For Models

Documentation For Authorization

apiv4

Authentication with APIv4 key and secret

For details, refer to: APIv4 signed request requirements

Author

support@mail.gate.com

About

No description, website, or topics provided.

Resources

Stars

344 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Auto-enable theater mode on YouTube (function() { function tryTheater() { var btn = document.querySelector('button[aria-label="Theater mode"], ytd-player #player button[title="Theater mode"]'); if (btn && !btn.classList.contains('activated')) { btn.click(); } } // Try immediately tryTheater(); // Try after navigation (SPA) var lastUrl = location.href; setInterval(function() { if (location.href !== lastUrl) { lastUrl = location.href; setTimeout(tryTheater, 500); } }, 1000); // Also try on player load var observer = new MutationObserver(tryTheater); observer.observe(document.body, { childList: true, subtree: true }); })(); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + ' GitHub - gateio/gateapi-python · GitHub
Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Repository files navigation

Important

This repository has been archived and is no longer maintained. The project has moved to gate/gateapi-python. Please use the new repository for updates, issues, and pull requests.

gate-api

Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v4.105.8
  • Package version: 7.1.8
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.gate.com/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

You can install directly using:

pip install --user gate-api

Then import the package:

importgate_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importgate_api

Getting Started

Please follow the installation procedure and then run the following:

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.EarnUniApi(api_client)
try:
# Query lending currency listapi_response=api_instance.list_uni_currencies()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n"%e)

For a more complete API usage example, refer to the demo application in example directory

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
EarnUniApilist_uni_currenciesGET /earn/uni/currenciesQuery lending currency list
EarnUniApiget_uni_currencyGET /earn/uni/currencies/{currency}Query single lending currency details
EarnUniApilist_user_uni_lendsGET /earn/uni/lendsQuery user's lending order list
EarnUniApicreate_uni_lendPOST /earn/uni/lendsCreate lending or redemption
EarnUniApichange_uni_lendPATCH /earn/uni/lendsAmend user lending information
EarnUniApilist_uni_lend_recordsGET /earn/uni/lend_recordsQuery lending transaction records
EarnUniApiget_uni_interestGET /earn/uni/interests/{currency}Query user's total interest income for specified currency
EarnUniApilist_uni_interest_recordsGET /earn/uni/interest_recordsQuery user dividend records
EarnUniApiget_uni_interest_statusGET /earn/uni/interest_status/{currency}Query currency interest compounding status
EarnUniApilist_uni_chartGET /earn/uni/chartUniLoan currency annualized trend chart
EarnUniApilist_uni_rateGET /earn/uni/rateCurrency estimated annualized interest rate
MarginUniApilist_uni_currency_pairsGET /margin/uni/currency_pairsList lending markets
MarginUniApiget_uni_currency_pairGET /margin/uni/currency_pairs/{currency_pair}Get lending market details
MarginUniApiget_margin_uni_estimate_rateGET /margin/uni/estimate_rateEstimate interest rate for isolated margin currencies
MarginUniApilist_uni_loansGET /margin/uni/loansQuery loans
MarginUniApicreate_uni_loanPOST /margin/uni/loansBorrow or repay
MarginUniApilist_uni_loan_recordsGET /margin/uni/loan_recordsQuery loan records
MarginUniApilist_uni_loan_interest_recordsGET /margin/uni/interest_recordsQuery interest deduction records
MarginUniApiget_uni_borrowableGET /margin/uni/borrowableQuery maximum borrowable amount by currency
SubAccountApilist_sub_accountsGET /sub_accountsList sub-accounts
SubAccountApicreate_sub_accountsPOST /sub_accountsCreate a new sub-account
SubAccountApiget_sub_accountGET /sub_accounts/{user_id}Get sub-account
SubAccountApilist_sub_account_keysGET /sub_accounts/{user_id}/keysList all API key pairs of the sub-account
SubAccountApicreate_sub_account_keysPOST /sub_accounts/{user_id}/keysCreate new sub-account API key pair
SubAccountApiget_sub_account_keyGET /sub_accounts/{user_id}/keys/{key}Get specific API key pair of the sub-account
SubAccountApiupdate_sub_account_keysPUT /sub_accounts/{user_id}/keys/{key}Update sub-account API key pair
SubAccountApidelete_sub_account_keysDELETE /sub_accounts/{user_id}/keys/{key}Delete sub-account API key pair
SubAccountApilock_sub_accountPOST /sub_accounts/{user_id}/lockLock sub-account
SubAccountApiunlock_sub_accountPOST /sub_accounts/{user_id}/unlockUnlock sub-account
SubAccountApilist_unified_modeGET /sub_accounts/unified_modeGet sub-account mode
UnifiedApilist_unified_accountsGET /unified/accountsGet unified account information
UnifiedApiget_unified_borrowableGET /unified/borrowableQuery maximum borrowable amount for unified account
UnifiedApiget_unified_transferableGET /unified/transferableQuery maximum transferable amount for unified account
UnifiedApiget_unified_transferablesGET /unified/transferablesBatch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
UnifiedApiget_unified_borrowable_listGET /unified/batch_borrowableBatch query unified account maximum borrowable amount
UnifiedApilist_unified_loansGET /unified/loansQuery loans
UnifiedApicreate_unified_loanPOST /unified/loansBorrow or repay
UnifiedApilist_unified_loan_recordsGET /unified/loan_recordsQuery loan records
UnifiedApilist_unified_loan_interest_recordsGET /unified/interest_recordsQuery interest deduction records
UnifiedApiget_unified_risk_unitsGET /unified/risk_unitsGet user risk unit details
UnifiedApiget_unified_modeGET /unified/unified_modeQuery mode of the unified account
UnifiedApiset_unified_modePUT /unified/unified_modeSet unified account mode
UnifiedApiget_unified_estimate_rateGET /unified/estimate_rateQuery unified account estimated interest rate
UnifiedApilist_currency_discount_tiersGET /unified/currency_discount_tiersQuery unified account tiered
UnifiedApilist_loan_margin_tiersGET /unified/loan_margin_tiersQuery unified account tiered loan margin
UnifiedApicalculate_portfolio_marginPOST /unified/portfolio_calculatorPortfolio margin calculator
UnifiedApiget_user_leverage_currency_configGET /unified/leverage/user_currency_configMaximum and minimum currency leverage that can be set
UnifiedApiget_user_leverage_currency_settingGET /unified/leverage/user_currency_settingGet user currency leverage
UnifiedApiset_user_leverage_currency_settingPOST /unified/leverage/user_currency_settingSet loan currency leverage
UnifiedApilist_unified_currenciesGET /unified/currenciesList of loan currencies supported by unified account
UnifiedApiget_history_loan_rateGET /unified/history_loan_rateGet historical lending rates
UnifiedApiset_unified_collateralPOST /unified/collateral_currenciesSet collateral currency
AccountApiget_account_detailGET /account/detailRetrieve user account information
AccountApiget_account_rate_limitGET /account/rate_limitGet user transaction rate limit information
AccountApilist_stp_groupsGET /account/stp_groupsQuery STP user groups created by the user
AccountApicreate_stp_groupPOST /account/stp_groupsCreate STP user group
AccountApilist_stp_groups_usersGET /account/stp_groups/{stp_id}/usersQuery users in the STP user group
AccountApiadd_stp_group_usersPOST /account/stp_groups/{stp_id}/usersAdd users to the STP user group
AccountApidelete_stp_group_usersDELETE /account/stp_groups/{stp_id}/usersDelete users from the STP user group
AccountApiget_debit_feeGET /account/debit_feeQuery GT fee deduction configuration
AccountApiset_debit_feePOST /account/debit_feeConfigure GT fee deduction
CollateralLoanApilist_collateral_loan_ordersGET /loan/collateral/ordersQuery collateral loan order list
CollateralLoanApicreate_collateral_loanPOST /loan/collateral/ordersPlace collateral loan order
CollateralLoanApiget_collateral_loan_order_detailGET /loan/collateral/orders/{order_id}Query single order details
CollateralLoanApirepay_collateral_loanPOST /loan/collateral/repayCollateral loan repayment
CollateralLoanApilist_repay_recordsGET /loan/collateral/repay_recordsQuery collateral loan repayment records
CollateralLoanApilist_collateral_recordsGET /loan/collateral/collateralsQuery collateral adjustment records
CollateralLoanApioperate_collateralPOST /loan/collateral/collateralsIncrease or redeem collateral
CollateralLoanApiget_user_total_amountGET /loan/collateral/total_amountQuery user's total borrowing and collateral amount
CollateralLoanApiget_user_ltv_infoGET /loan/collateral/ltvQuery user's collateralization ratio and remaining borrowable currencies
CollateralLoanApilist_collateral_currenciesGET /loan/collateral/currenciesQuery supported borrowing and collateral currencies
DeliveryApilist_delivery_contractsGET /delivery/{settle}/contractsQuery all futures contracts
DeliveryApiget_delivery_contractGET /delivery/{settle}/contracts/{contract}Query single contract information
DeliveryApilist_delivery_order_bookGET /delivery/{settle}/order_bookQuery futures market depth information
DeliveryApilist_delivery_tradesGET /delivery/{settle}/tradesFutures market transaction records
DeliveryApilist_delivery_candlesticksGET /delivery/{settle}/candlesticksFutures market K-line chart
DeliveryApilist_delivery_tickersGET /delivery/{settle}/tickersGet all futures trading statistics
DeliveryApilist_delivery_insurance_ledgerGET /delivery/{settle}/insuranceFutures market insurance fund history
DeliveryApilist_delivery_accountsGET /delivery/{settle}/accountsGet futures account
DeliveryApilist_delivery_account_bookGET /delivery/{settle}/account_bookQuery futures account change history
DeliveryApilist_delivery_positionsGET /delivery/{settle}/positionsGet user position list
DeliveryApiget_delivery_positionGET /delivery/{settle}/positions/{contract}Get single position information
DeliveryApiupdate_delivery_position_marginPOST /delivery/{settle}/positions/{contract}/marginUpdate position margin
DeliveryApiupdate_delivery_position_leveragePOST /delivery/{settle}/positions/{contract}/leverageUpdate position leverage
DeliveryApiupdate_delivery_position_risk_limitPOST /delivery/{settle}/positions/{contract}/risk_limitUpdate position risk limit
DeliveryApilist_delivery_ordersGET /delivery/{settle}/ordersQuery futures order list
DeliveryApicreate_delivery_orderPOST /delivery/{settle}/ordersPlace futures order
DeliveryApicancel_delivery_ordersDELETE /delivery/{settle}/ordersCancel all orders with 'open' status
DeliveryApiget_delivery_orderGET /delivery/{settle}/orders/{order_id}Query single order details
DeliveryApicancel_delivery_orderDELETE /delivery/{settle}/orders/{order_id}Cancel single order
DeliveryApiget_my_delivery_tradesGET /delivery/{settle}/my_tradesQuery personal trading records
DeliveryApilist_delivery_position_closeGET /delivery/{settle}/position_closeQuery position close history
DeliveryApilist_delivery_liquidatesGET /delivery/{settle}/liquidatesQuery liquidation history
DeliveryApilist_delivery_settlementsGET /delivery/{settle}/settlementsQuery settlement records
DeliveryApilist_delivery_risk_limit_tiersGET /delivery/{settle}/risk_limit_tiersQuery risk limit tiers
DeliveryApilist_price_triggered_delivery_ordersGET /delivery/{settle}/price_ordersQuery auto order list
DeliveryApicreate_price_triggered_delivery_orderPOST /delivery/{settle}/price_ordersCreate price-triggered order
DeliveryApicancel_price_triggered_delivery_order_listDELETE /delivery/{settle}/price_ordersCancel all auto orders
DeliveryApiget_price_triggered_delivery_orderGET /delivery/{settle}/price_orders/{order_id}Query single auto order details
DeliveryApicancel_price_triggered_delivery_orderDELETE /delivery/{settle}/price_orders/{order_id}Cancel single auto order
EarnApiswap_eth2POST /earn/staking/eth2/swapETH2 swap
EarnApirate_list_eth2GET /earn/staking/eth2/rate_recordsETH2 historical return rate query
EarnApilist_dual_investment_plansGET /earn/dual/investment_planDual Investment product list
EarnApilist_dual_ordersGET /earn/dual/ordersDual Investment order list
EarnApiplace_dual_orderPOST /earn/dual/ordersPlace Dual Investment order
EarnApilist_structured_productsGET /earn/structured/productsStructured Product List
EarnApilist_structured_ordersGET /earn/structured/ordersStructured Product Order List
EarnApiplace_structured_orderPOST /earn/structured/ordersPlace Structured Product Order
EarnApifind_coinGET /earn/staking/coinsStaking coins
EarnApiswap_staking_coinPOST /earn/staking/swapOn-chain token swap for earned coins
FlashSwapApilist_flash_swap_currency_pairGET /flash_swap/currency_pairsList All Supported Currency Pairs In Flash Swap
FlashSwapApilist_flash_swap_ordersGET /flash_swap/ordersQuery flash swap order list
FlashSwapApicreate_flash_swap_orderPOST /flash_swap/ordersCreate a flash swap order
FlashSwapApiget_flash_swap_orderGET /flash_swap/orders/{order_id}Query single flash swap order
FlashSwapApipreview_flash_swap_orderPOST /flash_swap/orders/previewFlash swap order preview
FuturesApilist_futures_contractsGET /futures/{settle}/contractsQuery all futures contracts
FuturesApiget_futures_contractGET /futures/{settle}/contracts/{contract}Query single contract information
FuturesApilist_futures_order_bookGET /futures/{settle}/order_bookQuery futures market depth information
FuturesApilist_futures_tradesGET /futures/{settle}/tradesFutures market transaction records
FuturesApilist_futures_candlesticksGET /futures/{settle}/candlesticksFutures market K-line chart
FuturesApilist_futures_premium_indexGET /futures/{settle}/premium_indexPremium Index K-line chart
FuturesApilist_futures_tickersGET /futures/{settle}/tickersGet all futures trading statistics
FuturesApilist_futures_funding_rate_historyGET /futures/{settle}/funding_rateFutures market historical funding rate
FuturesApilist_futures_insurance_ledgerGET /futures/{settle}/insuranceFutures market insurance fund history
FuturesApilist_contract_statsGET /futures/{settle}/contract_statsFutures statistics
FuturesApiget_index_constituentsGET /futures/{settle}/index_constituents/{index}Query index constituents
FuturesApilist_liquidated_ordersGET /futures/{settle}/liq_ordersQuery liquidation order history
FuturesApilist_futures_risk_limit_tiersGET /futures/{settle}/risk_limit_tiersQuery risk limit tiers
FuturesApilist_futures_accountsGET /futures/{settle}/accountsGet futures account
FuturesApilist_futures_account_bookGET /futures/{settle}/account_bookQuery futures account change history
FuturesApilist_positionsGET /futures/{settle}/positionsGet user position list
FuturesApiget_positionGET /futures/{settle}/positions/{contract}Get single position information
FuturesApiupdate_position_marginPOST /futures/{settle}/positions/{contract}/marginUpdate position margin
FuturesApiupdate_position_leveragePOST /futures/{settle}/positions/{contract}/leverageUpdate position leverage
FuturesApiupdate_position_cross_modePOST /futures/{settle}/positions/cross_modeSwitch Position Margin Mode
FuturesApiupdate_dual_comp_position_cross_modePOST /futures/{settle}/dual_comp/positions/cross_modeSwitch Between Cross and Isolated Margin Modes Under Hedge Mode
FuturesApiupdate_position_risk_limitPOST /futures/{settle}/positions/{contract}/risk_limitUpdate position risk limit
FuturesApiset_dual_modePOST /futures/{settle}/dual_modeSet position mode
FuturesApiget_dual_mode_positionGET /futures/{settle}/dual_comp/positions/{contract}Get position information in dual mode
FuturesApiupdate_dual_mode_position_marginPOST /futures/{settle}/dual_comp/positions/{contract}/marginUpdate position margin in dual mode
FuturesApiupdate_dual_mode_position_leveragePOST /futures/{settle}/dual_comp/positions/{contract}/leverageUpdate position leverage in dual mode
FuturesApiupdate_dual_mode_position_risk_limitPOST /futures/{settle}/dual_comp/positions/{contract}/risk_limitUpdate position risk limit in dual mode
FuturesApilist_futures_ordersGET /futures/{settle}/ordersQuery futures order list
FuturesApicreate_futures_orderPOST /futures/{settle}/ordersPlace futures order
FuturesApicancel_futures_ordersDELETE /futures/{settle}/ordersCancel all orders with 'open' status
FuturesApiget_orders_with_time_rangeGET /futures/{settle}/orders_timerangeQuery futures order list by time range
FuturesApicreate_batch_futures_orderPOST /futures/{settle}/batch_ordersPlace batch futures orders
FuturesApiget_futures_orderGET /futures/{settle}/orders/{order_id}Query single order details
FuturesApiamend_futures_orderPUT /futures/{settle}/orders/{order_id}Amend single order
FuturesApicancel_futures_orderDELETE /futures/{settle}/orders/{order_id}Cancel single order
FuturesApiget_my_tradesGET /futures/{settle}/my_tradesQuery personal trading records
FuturesApiget_my_trades_with_time_rangeGET /futures/{settle}/my_trades_timerangeQuery personal trading records by time range
FuturesApilist_position_closeGET /futures/{settle}/position_closeQuery position close history
FuturesApilist_liquidatesGET /futures/{settle}/liquidatesQuery liquidation history
FuturesApilist_auto_deleveragesGET /futures/{settle}/auto_deleveragesQuery ADL auto-deleveraging order information
FuturesApicountdown_cancel_all_futuresPOST /futures/{settle}/countdown_cancel_allCountdown cancel orders
FuturesApiget_futures_feeGET /futures/{settle}/feeQuery futures market trading fee rates
FuturesApicancel_batch_future_ordersPOST /futures/{settle}/batch_cancel_ordersCancel batch orders by specified ID list
FuturesApiamend_batch_future_ordersPOST /futures/{settle}/batch_amend_ordersBatch modify orders by specified IDs
FuturesApiget_futures_risk_limit_tableGET /futures/{settle}/risk_limit_tableQuery risk limit table by table_id
FuturesApilist_price_triggered_ordersGET /futures/{settle}/price_ordersQuery auto order list
FuturesApicreate_price_triggered_orderPOST /futures/{settle}/price_ordersCreate price-triggered order
FuturesApicancel_price_triggered_order_listDELETE /futures/{settle}/price_ordersCancel all auto orders
FuturesApiget_price_triggered_orderGET /futures/{settle}/price_orders/{order_id}Query single auto order details
FuturesApicancel_price_triggered_orderDELETE /futures/{settle}/price_orders/{order_id}Cancel single auto order
MarginApilist_margin_accountsGET /margin/accountsMargin account list
MarginApilist_margin_account_bookGET /margin/account_bookQuery margin account balance change history
MarginApilist_funding_accountsGET /margin/funding_accountsFunding account list
MarginApiget_auto_repay_statusGET /margin/auto_repayQuery user auto repayment settings
MarginApiset_auto_repayPOST /margin/auto_repayUpdate user auto repayment settings
MarginApiget_margin_transferableGET /margin/transferableGet maximum transferable amount for isolated margin
MarginApiget_user_margin_tierGET /margin/user/loan_margin_tiersQuery user's own leverage lending tiers in current market
MarginApiget_market_margin_tierGET /margin/loan_margin_tiersQuery current market leverage lending tiers
MarginApiset_user_market_leveragePOST /margin/leverage/user_market_settingSet user market leverage multiplier
MarginApilist_margin_user_accountGET /margin/user/accountQuery user's isolated margin account list
MarginApilist_cross_margin_loansGET /margin/cross/loansQuery cross margin borrow history (deprecated)
MarginApilist_cross_margin_repaymentsGET /margin/cross/repaymentsRetrieve cross margin repayments. (deprecated)
MultiCollateralLoanApilist_multi_collateral_ordersGET /loan/multi_collateral/ordersQuery multi-currency collateral order list
MultiCollateralLoanApicreate_multi_collateralPOST /loan/multi_collateral/ordersPlace multi-currency collateral order
MultiCollateralLoanApiget_multi_collateral_order_detailGET /loan/multi_collateral/orders/{order_id}Query order details
MultiCollateralLoanApilist_multi_repay_recordsGET /loan/multi_collateral/repayQuery multi-currency collateral repayment records
MultiCollateralLoanApirepay_multi_collateral_loanPOST /loan/multi_collateral/repayMulti-currency collateral repayment
MultiCollateralLoanApilist_multi_collateral_recordsGET /loan/multi_collateral/mortgageQuery collateral adjustment records
MultiCollateralLoanApioperate_multi_collateralPOST /loan/multi_collateral/mortgageAdd or withdraw collateral
MultiCollateralLoanApilist_user_currency_quotaGET /loan/multi_collateral/currency_quotaQuery user's collateral and borrowing currency quota information
MultiCollateralLoanApilist_multi_collateral_currenciesGET /loan/multi_collateral/currenciesQuery supported borrowing and collateral currencies for multi-currency collateral
MultiCollateralLoanApiget_multi_collateral_ltvGET /loan/multi_collateral/ltvQuery collateralization ratio information
MultiCollateralLoanApiget_multi_collateral_fix_rateGET /loan/multi_collateral/fixed_rateQuery currency's 7-day and 30-day fixed interest rates
MultiCollateralLoanApiget_multi_collateral_current_rateGET /loan/multi_collateral/current_rateQuery currency's current interest rate
OptionsApilist_options_underlyingsGET /options/underlyingsList all underlying assets
OptionsApilist_options_expirationsGET /options/expirationsList all expiration dates
OptionsApilist_options_contractsGET /options/contractsList all contracts for specified underlying and expiration date
OptionsApiget_options_contractGET /options/contracts/{contract}Query specified contract details
OptionsApilist_options_settlementsGET /options/settlementsList settlement history
OptionsApiget_options_settlementGET /options/settlements/{contract}Get specified contract settlement information
OptionsApilist_my_options_settlementsGET /options/my_settlementsQuery personal settlement records
OptionsApilist_options_order_bookGET /options/order_bookQuery options contract order book
OptionsApilist_options_tickersGET /options/tickersQuery options market ticker information
OptionsApilist_options_underlying_tickersGET /options/underlying/tickers/{underlying}Query underlying ticker information
OptionsApilist_options_candlesticksGET /options/candlesticksOptions contract market candlestick chart
OptionsApilist_options_underlying_candlesticksGET /options/underlying/candlesticksUnderlying index price candlestick chart
OptionsApilist_options_tradesGET /options/tradesMarket trade records
OptionsApilist_options_accountGET /options/accountsQuery account information
OptionsApilist_options_account_bookGET /options/account_bookQuery account change history
OptionsApilist_options_positionsGET /options/positionsList user's positions of specified underlying
OptionsApiget_options_positionGET /options/positions/{contract}Get specified contract position
OptionsApilist_options_position_closeGET /options/position_closeList user's liquidation history of specified underlying
OptionsApilist_options_ordersGET /options/ordersList options orders
OptionsApicreate_options_orderPOST /options/ordersCreate an options order
OptionsApicancel_options_ordersDELETE /options/ordersCancel all orders with 'open' status
OptionsApiget_options_orderGET /options/orders/{order_id}Query single order details
OptionsApicancel_options_orderDELETE /options/orders/{order_id}Cancel single order
OptionsApicountdown_cancel_all_optionsPOST /options/countdown_cancel_allCountdown cancel orders
OptionsApilist_my_options_tradesGET /options/my_tradesQuery personal trading records
OptionsApiget_options_mmpGET /options/mmpMMP Query.
OptionsApiset_options_mmpPOST /options/mmpMMP Settings
OptionsApireset_options_mmpPOST /options/mmp/resetMMP Reset
RebateApiagency_transaction_historyGET /rebate/agency/transaction_historyBroker obtains transaction history of recommended users
RebateApiagency_commissions_historyGET /rebate/agency/commission_historyBroker obtains rebate history of recommended users
RebateApipartner_transaction_historyGET /rebate/partner/transaction_historyPartner obtains transaction history of recommended users
RebateApipartner_commissions_historyGET /rebate/partner/commission_historyPartner obtains rebate records of recommended users
RebateApipartner_sub_listGET /rebate/partner/sub_listPartner subordinate list
RebateApirebate_broker_commission_historyGET /rebate/broker/commission_historyBroker obtains user's rebate records
RebateApirebate_broker_transaction_historyGET /rebate/broker/transaction_historyBroker obtains user's trading history
RebateApirebate_user_infoGET /rebate/user/infoUser obtains rebate information
RebateApiuser_sub_relationGET /rebate/user/sub_relationUser subordinate relationship
SpotApilist_currenciesGET /spot/currenciesQuery all currency information
SpotApiget_currencyGET /spot/currencies/{currency}Query single currency information
SpotApilist_currency_pairsGET /spot/currency_pairsQuery all supported currency pairs
SpotApiget_currency_pairGET /spot/currency_pairs/{currency_pair}Query single currency pair details
SpotApilist_tickersGET /spot/tickersGet currency pair ticker information
SpotApilist_order_bookGET /spot/order_bookGet market depth information
SpotApilist_tradesGET /spot/tradesQuery market transaction records
SpotApilist_candlesticksGET /spot/candlesticksMarket K-line chart
SpotApiget_feeGET /spot/feeQuery account fee rates
SpotApiget_batch_spot_feeGET /spot/batch_feeBatch query account fee rates
SpotApilist_spot_accountsGET /spot/accountsList spot trading accounts
SpotApilist_spot_account_bookGET /spot/account_bookQuery spot account transaction history
SpotApicreate_batch_ordersPOST /spot/batch_ordersBatch place orders
SpotApilist_all_open_ordersGET /spot/open_ordersList all open orders
SpotApicreate_cross_liquidate_orderPOST /spot/cross_liquidate_ordersClose position when cross-currency is disabled
SpotApilist_ordersGET /spot/ordersList orders
SpotApicreate_orderPOST /spot/ordersCreate an order
SpotApicancel_ordersDELETE /spot/ordersCancel all `open` orders in specified currency pair
SpotApicancel_batch_ordersPOST /spot/cancel_batch_ordersCancel batch orders by specified ID list
SpotApiget_orderGET /spot/orders/{order_id}Query single order details
SpotApicancel_orderDELETE /spot/orders/{order_id}Cancel single order
SpotApiamend_orderPATCH /spot/orders/{order_id}Amend single order
SpotApilist_my_tradesGET /spot/my_tradesQuery personal trading records
SpotApiget_system_timeGET /spot/timeGet server current time
SpotApicountdown_cancel_all_spotPOST /spot/countdown_cancel_allCountdown cancel orders
SpotApiamend_batch_ordersPOST /spot/amend_batch_ordersBatch modification of orders
SpotApiget_spot_insurance_historyGET /spot/insurance_historyQuery spot insurance fund historical data
SpotApilist_spot_price_triggered_ordersGET /spot/price_ordersQuery running auto order list
SpotApicreate_spot_price_triggered_orderPOST /spot/price_ordersCreate price-triggered order
SpotApicancel_spot_price_triggered_order_listDELETE /spot/price_ordersCancel all auto orders
SpotApiget_spot_price_triggered_orderGET /spot/price_orders/{order_id}Query single auto order details
SpotApicancel_spot_price_triggered_orderDELETE /spot/price_orders/{order_id}Cancel single auto order
WalletApilist_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
WalletApiget_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
WalletApilist_withdrawalsGET /wallet/withdrawalsGet withdrawal records
WalletApilist_depositsGET /wallet/depositsGet deposit records
WalletApitransferPOST /wallet/transfersTransfer between trading accounts
WalletApilist_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
WalletApitransfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
WalletApisub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
WalletApiget_transfer_order_statusGET /wallet/order_statusTransfer status query
WalletApilist_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
WalletApilist_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
WalletApilist_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
WalletApilist_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
WalletApilist_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
WalletApilist_saved_addressGET /wallet/saved_addressQuery withdrawal address whitelist
WalletApiget_trade_feeGET /wallet/feeQuery personal trading fees
WalletApiget_total_balanceGET /wallet/total_balanceQuery personal account totals
WalletApilist_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
WalletApiconvert_small_balancePOST /wallet/small_balanceConvert small balance currency
WalletApilist_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
WalletApilist_push_ordersGET /wallet/pushGet UID transfer history
WithdrawalApiwithdrawPOST /withdrawalsWithdraw
WithdrawalApiwithdraw_push_orderPOST /withdrawals/pushUID transfer
WithdrawalApicancel_withdrawalDELETE /withdrawals/{withdrawal_id}Cancel withdrawal with specified ID

Documentation For Models

Documentation For Authorization

apiv4

Authentication with APIv4 key and secret

For details, refer to: APIv4 signed request requirements

Author

support@mail.gate.com

About

No description, website, or topics provided.

Resources

Stars

344 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { // Remove or un-stick sticky/fixed headers that block content (function() { function unstick() { document.querySelectorAll('header, nav, [role="banner"], .header, .navbar, .sticky, .fixed-top, [style*="position: fixed"], [style*="position:sticky"]').forEach(function(el) { if (el.style.position === 'fixed' || el.style.position === 'sticky' || getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') { el.style.position = 'static'; el.style.top = 'auto'; el.style.zIndex = 'auto'; } }); } unstick(); var observer = new MutationObserver(unstick); observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] }); })(); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); })(); GitHub - gateio/gateapi-python · GitHub
Skip to content
This repository was archived by the owner on Jul 16, 2026. It is now read-only.

Repository files navigation

Important

This repository has been archived and is no longer maintained. The project has moved to gate/gateapi-python. Please use the new repository for updates, issues, and pull requests.

gate-api

Welcome to Gate API APIv4 provides operations related to spot, margin, and contract trading, including public interfaces for querying market data and authenticated private interfaces for implementing API-based automated trading.

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: v4.105.8
  • Package version: 7.1.8
  • Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit https://www.gate.com/page/contacts

Versioning

Trying our best to follow the semantic versioning, while enjoying recent features provided by programming language and libraries, from 4.15.2, one major versioning difference will be introduced:

If extra code rewrite is required when you upgrade the SDK, such as:

  • some outdated programming language version support is dropped
  • API method signature has breaking changes.

the MAJOR version will be incremented, but the MINOR and PATCH version are still following REST API's instead of resetting to 0, so that you can recognize it has some breaking changes, but still getting the idea of from which REST API version the change is introduced.

For example, the previous REST API and SDK version are both 4.14.0. But if we decide to introduce some breaking changes in SDK along with REST API 4.15.2 upgrade, then the version of next SDK release will be 5.15.2(the MAJOR version is incremented to denote breaking changes, but the MINOR and PATCH version are identical to REST API's instead of resetting them to 0)

If MAJOR version is incremented, make sure you read the release note on Releases page

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

You can install directly using:

pip install --user gate-api

Then import the package:

importgate_api

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

importgate_api

Getting Started

Please follow the installation procedure and then run the following:

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.EarnUniApi(api_client)
try:
# Query lending currency listapi_response=api_instance.list_uni_currencies()
print(api_response)
exceptGateApiExceptionasex:
print("Gate api exception, label: %s, message: %s\n"% (ex.label, ex.message))
exceptApiExceptionase:
print("Exception when calling EarnUniApi->list_uni_currencies: %s\n"%e)

For a more complete API usage example, refer to the demo application in example directory

Documentation for API Endpoints

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

ClassMethodHTTP requestDescription
EarnUniApilist_uni_currenciesGET /earn/uni/currenciesQuery lending currency list
EarnUniApiget_uni_currencyGET /earn/uni/currencies/{currency}Query single lending currency details
EarnUniApilist_user_uni_lendsGET /earn/uni/lendsQuery user's lending order list
EarnUniApicreate_uni_lendPOST /earn/uni/lendsCreate lending or redemption
EarnUniApichange_uni_lendPATCH /earn/uni/lendsAmend user lending information
EarnUniApilist_uni_lend_recordsGET /earn/uni/lend_recordsQuery lending transaction records
EarnUniApiget_uni_interestGET /earn/uni/interests/{currency}Query user's total interest income for specified currency
EarnUniApilist_uni_interest_recordsGET /earn/uni/interest_recordsQuery user dividend records
EarnUniApiget_uni_interest_statusGET /earn/uni/interest_status/{currency}Query currency interest compounding status
EarnUniApilist_uni_chartGET /earn/uni/chartUniLoan currency annualized trend chart
EarnUniApilist_uni_rateGET /earn/uni/rateCurrency estimated annualized interest rate
MarginUniApilist_uni_currency_pairsGET /margin/uni/currency_pairsList lending markets
MarginUniApiget_uni_currency_pairGET /margin/uni/currency_pairs/{currency_pair}Get lending market details
MarginUniApiget_margin_uni_estimate_rateGET /margin/uni/estimate_rateEstimate interest rate for isolated margin currencies
MarginUniApilist_uni_loansGET /margin/uni/loansQuery loans
MarginUniApicreate_uni_loanPOST /margin/uni/loansBorrow or repay
MarginUniApilist_uni_loan_recordsGET /margin/uni/loan_recordsQuery loan records
MarginUniApilist_uni_loan_interest_recordsGET /margin/uni/interest_recordsQuery interest deduction records
MarginUniApiget_uni_borrowableGET /margin/uni/borrowableQuery maximum borrowable amount by currency
SubAccountApilist_sub_accountsGET /sub_accountsList sub-accounts
SubAccountApicreate_sub_accountsPOST /sub_accountsCreate a new sub-account
SubAccountApiget_sub_accountGET /sub_accounts/{user_id}Get sub-account
SubAccountApilist_sub_account_keysGET /sub_accounts/{user_id}/keysList all API key pairs of the sub-account
SubAccountApicreate_sub_account_keysPOST /sub_accounts/{user_id}/keysCreate new sub-account API key pair
SubAccountApiget_sub_account_keyGET /sub_accounts/{user_id}/keys/{key}Get specific API key pair of the sub-account
SubAccountApiupdate_sub_account_keysPUT /sub_accounts/{user_id}/keys/{key}Update sub-account API key pair
SubAccountApidelete_sub_account_keysDELETE /sub_accounts/{user_id}/keys/{key}Delete sub-account API key pair
SubAccountApilock_sub_accountPOST /sub_accounts/{user_id}/lockLock sub-account
SubAccountApiunlock_sub_accountPOST /sub_accounts/{user_id}/unlockUnlock sub-account
SubAccountApilist_unified_modeGET /sub_accounts/unified_modeGet sub-account mode
UnifiedApilist_unified_accountsGET /unified/accountsGet unified account information
UnifiedApiget_unified_borrowableGET /unified/borrowableQuery maximum borrowable amount for unified account
UnifiedApiget_unified_transferableGET /unified/transferableQuery maximum transferable amount for unified account
UnifiedApiget_unified_transferablesGET /unified/transferablesBatch query maximum transferable amount for unified accounts. Each currency shows the maximum value. After user withdrawal, the transferable amount for all currencies will change
UnifiedApiget_unified_borrowable_listGET /unified/batch_borrowableBatch query unified account maximum borrowable amount
UnifiedApilist_unified_loansGET /unified/loansQuery loans
UnifiedApicreate_unified_loanPOST /unified/loansBorrow or repay
UnifiedApilist_unified_loan_recordsGET /unified/loan_recordsQuery loan records
UnifiedApilist_unified_loan_interest_recordsGET /unified/interest_recordsQuery interest deduction records
UnifiedApiget_unified_risk_unitsGET /unified/risk_unitsGet user risk unit details
UnifiedApiget_unified_modeGET /unified/unified_modeQuery mode of the unified account
UnifiedApiset_unified_modePUT /unified/unified_modeSet unified account mode
UnifiedApiget_unified_estimate_rateGET /unified/estimate_rateQuery unified account estimated interest rate
UnifiedApilist_currency_discount_tiersGET /unified/currency_discount_tiersQuery unified account tiered
UnifiedApilist_loan_margin_tiersGET /unified/loan_margin_tiersQuery unified account tiered loan margin
UnifiedApicalculate_portfolio_marginPOST /unified/portfolio_calculatorPortfolio margin calculator
UnifiedApiget_user_leverage_currency_configGET /unified/leverage/user_currency_configMaximum and minimum currency leverage that can be set
UnifiedApiget_user_leverage_currency_settingGET /unified/leverage/user_currency_settingGet user currency leverage
UnifiedApiset_user_leverage_currency_settingPOST /unified/leverage/user_currency_settingSet loan currency leverage
UnifiedApilist_unified_currenciesGET /unified/currenciesList of loan currencies supported by unified account
UnifiedApiget_history_loan_rateGET /unified/history_loan_rateGet historical lending rates
UnifiedApiset_unified_collateralPOST /unified/collateral_currenciesSet collateral currency
AccountApiget_account_detailGET /account/detailRetrieve user account information
AccountApiget_account_rate_limitGET /account/rate_limitGet user transaction rate limit information
AccountApilist_stp_groupsGET /account/stp_groupsQuery STP user groups created by the user
AccountApicreate_stp_groupPOST /account/stp_groupsCreate STP user group
AccountApilist_stp_groups_usersGET /account/stp_groups/{stp_id}/usersQuery users in the STP user group
AccountApiadd_stp_group_usersPOST /account/stp_groups/{stp_id}/usersAdd users to the STP user group
AccountApidelete_stp_group_usersDELETE /account/stp_groups/{stp_id}/usersDelete users from the STP user group
AccountApiget_debit_feeGET /account/debit_feeQuery GT fee deduction configuration
AccountApiset_debit_feePOST /account/debit_feeConfigure GT fee deduction
CollateralLoanApilist_collateral_loan_ordersGET /loan/collateral/ordersQuery collateral loan order list
CollateralLoanApicreate_collateral_loanPOST /loan/collateral/ordersPlace collateral loan order
CollateralLoanApiget_collateral_loan_order_detailGET /loan/collateral/orders/{order_id}Query single order details
CollateralLoanApirepay_collateral_loanPOST /loan/collateral/repayCollateral loan repayment
CollateralLoanApilist_repay_recordsGET /loan/collateral/repay_recordsQuery collateral loan repayment records
CollateralLoanApilist_collateral_recordsGET /loan/collateral/collateralsQuery collateral adjustment records
CollateralLoanApioperate_collateralPOST /loan/collateral/collateralsIncrease or redeem collateral
CollateralLoanApiget_user_total_amountGET /loan/collateral/total_amountQuery user's total borrowing and collateral amount
CollateralLoanApiget_user_ltv_infoGET /loan/collateral/ltvQuery user's collateralization ratio and remaining borrowable currencies
CollateralLoanApilist_collateral_currenciesGET /loan/collateral/currenciesQuery supported borrowing and collateral currencies
DeliveryApilist_delivery_contractsGET /delivery/{settle}/contractsQuery all futures contracts
DeliveryApiget_delivery_contractGET /delivery/{settle}/contracts/{contract}Query single contract information
DeliveryApilist_delivery_order_bookGET /delivery/{settle}/order_bookQuery futures market depth information
DeliveryApilist_delivery_tradesGET /delivery/{settle}/tradesFutures market transaction records
DeliveryApilist_delivery_candlesticksGET /delivery/{settle}/candlesticksFutures market K-line chart
DeliveryApilist_delivery_tickersGET /delivery/{settle}/tickersGet all futures trading statistics
DeliveryApilist_delivery_insurance_ledgerGET /delivery/{settle}/insuranceFutures market insurance fund history
DeliveryApilist_delivery_accountsGET /delivery/{settle}/accountsGet futures account
DeliveryApilist_delivery_account_bookGET /delivery/{settle}/account_bookQuery futures account change history
DeliveryApilist_delivery_positionsGET /delivery/{settle}/positionsGet user position list
DeliveryApiget_delivery_positionGET /delivery/{settle}/positions/{contract}Get single position information
DeliveryApiupdate_delivery_position_marginPOST /delivery/{settle}/positions/{contract}/marginUpdate position margin
DeliveryApiupdate_delivery_position_leveragePOST /delivery/{settle}/positions/{contract}/leverageUpdate position leverage
DeliveryApiupdate_delivery_position_risk_limitPOST /delivery/{settle}/positions/{contract}/risk_limitUpdate position risk limit
DeliveryApilist_delivery_ordersGET /delivery/{settle}/ordersQuery futures order list
DeliveryApicreate_delivery_orderPOST /delivery/{settle}/ordersPlace futures order
DeliveryApicancel_delivery_ordersDELETE /delivery/{settle}/ordersCancel all orders with 'open' status
DeliveryApiget_delivery_orderGET /delivery/{settle}/orders/{order_id}Query single order details
DeliveryApicancel_delivery_orderDELETE /delivery/{settle}/orders/{order_id}Cancel single order
DeliveryApiget_my_delivery_tradesGET /delivery/{settle}/my_tradesQuery personal trading records
DeliveryApilist_delivery_position_closeGET /delivery/{settle}/position_closeQuery position close history
DeliveryApilist_delivery_liquidatesGET /delivery/{settle}/liquidatesQuery liquidation history
DeliveryApilist_delivery_settlementsGET /delivery/{settle}/settlementsQuery settlement records
DeliveryApilist_delivery_risk_limit_tiersGET /delivery/{settle}/risk_limit_tiersQuery risk limit tiers
DeliveryApilist_price_triggered_delivery_ordersGET /delivery/{settle}/price_ordersQuery auto order list
DeliveryApicreate_price_triggered_delivery_orderPOST /delivery/{settle}/price_ordersCreate price-triggered order
DeliveryApicancel_price_triggered_delivery_order_listDELETE /delivery/{settle}/price_ordersCancel all auto orders
DeliveryApiget_price_triggered_delivery_orderGET /delivery/{settle}/price_orders/{order_id}Query single auto order details
DeliveryApicancel_price_triggered_delivery_orderDELETE /delivery/{settle}/price_orders/{order_id}Cancel single auto order
EarnApiswap_eth2POST /earn/staking/eth2/swapETH2 swap
EarnApirate_list_eth2GET /earn/staking/eth2/rate_recordsETH2 historical return rate query
EarnApilist_dual_investment_plansGET /earn/dual/investment_planDual Investment product list
EarnApilist_dual_ordersGET /earn/dual/ordersDual Investment order list
EarnApiplace_dual_orderPOST /earn/dual/ordersPlace Dual Investment order
EarnApilist_structured_productsGET /earn/structured/productsStructured Product List
EarnApilist_structured_ordersGET /earn/structured/ordersStructured Product Order List
EarnApiplace_structured_orderPOST /earn/structured/ordersPlace Structured Product Order
EarnApifind_coinGET /earn/staking/coinsStaking coins
EarnApiswap_staking_coinPOST /earn/staking/swapOn-chain token swap for earned coins
FlashSwapApilist_flash_swap_currency_pairGET /flash_swap/currency_pairsList All Supported Currency Pairs In Flash Swap
FlashSwapApilist_flash_swap_ordersGET /flash_swap/ordersQuery flash swap order list
FlashSwapApicreate_flash_swap_orderPOST /flash_swap/ordersCreate a flash swap order
FlashSwapApiget_flash_swap_orderGET /flash_swap/orders/{order_id}Query single flash swap order
FlashSwapApipreview_flash_swap_orderPOST /flash_swap/orders/previewFlash swap order preview
FuturesApilist_futures_contractsGET /futures/{settle}/contractsQuery all futures contracts
FuturesApiget_futures_contractGET /futures/{settle}/contracts/{contract}Query single contract information
FuturesApilist_futures_order_bookGET /futures/{settle}/order_bookQuery futures market depth information
FuturesApilist_futures_tradesGET /futures/{settle}/tradesFutures market transaction records
FuturesApilist_futures_candlesticksGET /futures/{settle}/candlesticksFutures market K-line chart
FuturesApilist_futures_premium_indexGET /futures/{settle}/premium_indexPremium Index K-line chart
FuturesApilist_futures_tickersGET /futures/{settle}/tickersGet all futures trading statistics
FuturesApilist_futures_funding_rate_historyGET /futures/{settle}/funding_rateFutures market historical funding rate
FuturesApilist_futures_insurance_ledgerGET /futures/{settle}/insuranceFutures market insurance fund history
FuturesApilist_contract_statsGET /futures/{settle}/contract_statsFutures statistics
FuturesApiget_index_constituentsGET /futures/{settle}/index_constituents/{index}Query index constituents
FuturesApilist_liquidated_ordersGET /futures/{settle}/liq_ordersQuery liquidation order history
FuturesApilist_futures_risk_limit_tiersGET /futures/{settle}/risk_limit_tiersQuery risk limit tiers
FuturesApilist_futures_accountsGET /futures/{settle}/accountsGet futures account
FuturesApilist_futures_account_bookGET /futures/{settle}/account_bookQuery futures account change history
FuturesApilist_positionsGET /futures/{settle}/positionsGet user position list
FuturesApiget_positionGET /futures/{settle}/positions/{contract}Get single position information
FuturesApiupdate_position_marginPOST /futures/{settle}/positions/{contract}/marginUpdate position margin
FuturesApiupdate_position_leveragePOST /futures/{settle}/positions/{contract}/leverageUpdate position leverage
FuturesApiupdate_position_cross_modePOST /futures/{settle}/positions/cross_modeSwitch Position Margin Mode
FuturesApiupdate_dual_comp_position_cross_modePOST /futures/{settle}/dual_comp/positions/cross_modeSwitch Between Cross and Isolated Margin Modes Under Hedge Mode
FuturesApiupdate_position_risk_limitPOST /futures/{settle}/positions/{contract}/risk_limitUpdate position risk limit
FuturesApiset_dual_modePOST /futures/{settle}/dual_modeSet position mode
FuturesApiget_dual_mode_positionGET /futures/{settle}/dual_comp/positions/{contract}Get position information in dual mode
FuturesApiupdate_dual_mode_position_marginPOST /futures/{settle}/dual_comp/positions/{contract}/marginUpdate position margin in dual mode
FuturesApiupdate_dual_mode_position_leveragePOST /futures/{settle}/dual_comp/positions/{contract}/leverageUpdate position leverage in dual mode
FuturesApiupdate_dual_mode_position_risk_limitPOST /futures/{settle}/dual_comp/positions/{contract}/risk_limitUpdate position risk limit in dual mode
FuturesApilist_futures_ordersGET /futures/{settle}/ordersQuery futures order list
FuturesApicreate_futures_orderPOST /futures/{settle}/ordersPlace futures order
FuturesApicancel_futures_ordersDELETE /futures/{settle}/ordersCancel all orders with 'open' status
FuturesApiget_orders_with_time_rangeGET /futures/{settle}/orders_timerangeQuery futures order list by time range
FuturesApicreate_batch_futures_orderPOST /futures/{settle}/batch_ordersPlace batch futures orders
FuturesApiget_futures_orderGET /futures/{settle}/orders/{order_id}Query single order details
FuturesApiamend_futures_orderPUT /futures/{settle}/orders/{order_id}Amend single order
FuturesApicancel_futures_orderDELETE /futures/{settle}/orders/{order_id}Cancel single order
FuturesApiget_my_tradesGET /futures/{settle}/my_tradesQuery personal trading records
FuturesApiget_my_trades_with_time_rangeGET /futures/{settle}/my_trades_timerangeQuery personal trading records by time range
FuturesApilist_position_closeGET /futures/{settle}/position_closeQuery position close history
FuturesApilist_liquidatesGET /futures/{settle}/liquidatesQuery liquidation history
FuturesApilist_auto_deleveragesGET /futures/{settle}/auto_deleveragesQuery ADL auto-deleveraging order information
FuturesApicountdown_cancel_all_futuresPOST /futures/{settle}/countdown_cancel_allCountdown cancel orders
FuturesApiget_futures_feeGET /futures/{settle}/feeQuery futures market trading fee rates
FuturesApicancel_batch_future_ordersPOST /futures/{settle}/batch_cancel_ordersCancel batch orders by specified ID list
FuturesApiamend_batch_future_ordersPOST /futures/{settle}/batch_amend_ordersBatch modify orders by specified IDs
FuturesApiget_futures_risk_limit_tableGET /futures/{settle}/risk_limit_tableQuery risk limit table by table_id
FuturesApilist_price_triggered_ordersGET /futures/{settle}/price_ordersQuery auto order list
FuturesApicreate_price_triggered_orderPOST /futures/{settle}/price_ordersCreate price-triggered order
FuturesApicancel_price_triggered_order_listDELETE /futures/{settle}/price_ordersCancel all auto orders
FuturesApiget_price_triggered_orderGET /futures/{settle}/price_orders/{order_id}Query single auto order details
FuturesApicancel_price_triggered_orderDELETE /futures/{settle}/price_orders/{order_id}Cancel single auto order
MarginApilist_margin_accountsGET /margin/accountsMargin account list
MarginApilist_margin_account_bookGET /margin/account_bookQuery margin account balance change history
MarginApilist_funding_accountsGET /margin/funding_accountsFunding account list
MarginApiget_auto_repay_statusGET /margin/auto_repayQuery user auto repayment settings
MarginApiset_auto_repayPOST /margin/auto_repayUpdate user auto repayment settings
MarginApiget_margin_transferableGET /margin/transferableGet maximum transferable amount for isolated margin
MarginApiget_user_margin_tierGET /margin/user/loan_margin_tiersQuery user's own leverage lending tiers in current market
MarginApiget_market_margin_tierGET /margin/loan_margin_tiersQuery current market leverage lending tiers
MarginApiset_user_market_leveragePOST /margin/leverage/user_market_settingSet user market leverage multiplier
MarginApilist_margin_user_accountGET /margin/user/accountQuery user's isolated margin account list
MarginApilist_cross_margin_loansGET /margin/cross/loansQuery cross margin borrow history (deprecated)
MarginApilist_cross_margin_repaymentsGET /margin/cross/repaymentsRetrieve cross margin repayments. (deprecated)
MultiCollateralLoanApilist_multi_collateral_ordersGET /loan/multi_collateral/ordersQuery multi-currency collateral order list
MultiCollateralLoanApicreate_multi_collateralPOST /loan/multi_collateral/ordersPlace multi-currency collateral order
MultiCollateralLoanApiget_multi_collateral_order_detailGET /loan/multi_collateral/orders/{order_id}Query order details
MultiCollateralLoanApilist_multi_repay_recordsGET /loan/multi_collateral/repayQuery multi-currency collateral repayment records
MultiCollateralLoanApirepay_multi_collateral_loanPOST /loan/multi_collateral/repayMulti-currency collateral repayment
MultiCollateralLoanApilist_multi_collateral_recordsGET /loan/multi_collateral/mortgageQuery collateral adjustment records
MultiCollateralLoanApioperate_multi_collateralPOST /loan/multi_collateral/mortgageAdd or withdraw collateral
MultiCollateralLoanApilist_user_currency_quotaGET /loan/multi_collateral/currency_quotaQuery user's collateral and borrowing currency quota information
MultiCollateralLoanApilist_multi_collateral_currenciesGET /loan/multi_collateral/currenciesQuery supported borrowing and collateral currencies for multi-currency collateral
MultiCollateralLoanApiget_multi_collateral_ltvGET /loan/multi_collateral/ltvQuery collateralization ratio information
MultiCollateralLoanApiget_multi_collateral_fix_rateGET /loan/multi_collateral/fixed_rateQuery currency's 7-day and 30-day fixed interest rates
MultiCollateralLoanApiget_multi_collateral_current_rateGET /loan/multi_collateral/current_rateQuery currency's current interest rate
OptionsApilist_options_underlyingsGET /options/underlyingsList all underlying assets
OptionsApilist_options_expirationsGET /options/expirationsList all expiration dates
OptionsApilist_options_contractsGET /options/contractsList all contracts for specified underlying and expiration date
OptionsApiget_options_contractGET /options/contracts/{contract}Query specified contract details
OptionsApilist_options_settlementsGET /options/settlementsList settlement history
OptionsApiget_options_settlementGET /options/settlements/{contract}Get specified contract settlement information
OptionsApilist_my_options_settlementsGET /options/my_settlementsQuery personal settlement records
OptionsApilist_options_order_bookGET /options/order_bookQuery options contract order book
OptionsApilist_options_tickersGET /options/tickersQuery options market ticker information
OptionsApilist_options_underlying_tickersGET /options/underlying/tickers/{underlying}Query underlying ticker information
OptionsApilist_options_candlesticksGET /options/candlesticksOptions contract market candlestick chart
OptionsApilist_options_underlying_candlesticksGET /options/underlying/candlesticksUnderlying index price candlestick chart
OptionsApilist_options_tradesGET /options/tradesMarket trade records
OptionsApilist_options_accountGET /options/accountsQuery account information
OptionsApilist_options_account_bookGET /options/account_bookQuery account change history
OptionsApilist_options_positionsGET /options/positionsList user's positions of specified underlying
OptionsApiget_options_positionGET /options/positions/{contract}Get specified contract position
OptionsApilist_options_position_closeGET /options/position_closeList user's liquidation history of specified underlying
OptionsApilist_options_ordersGET /options/ordersList options orders
OptionsApicreate_options_orderPOST /options/ordersCreate an options order
OptionsApicancel_options_ordersDELETE /options/ordersCancel all orders with 'open' status
OptionsApiget_options_orderGET /options/orders/{order_id}Query single order details
OptionsApicancel_options_orderDELETE /options/orders/{order_id}Cancel single order
OptionsApicountdown_cancel_all_optionsPOST /options/countdown_cancel_allCountdown cancel orders
OptionsApilist_my_options_tradesGET /options/my_tradesQuery personal trading records
OptionsApiget_options_mmpGET /options/mmpMMP Query.
OptionsApiset_options_mmpPOST /options/mmpMMP Settings
OptionsApireset_options_mmpPOST /options/mmp/resetMMP Reset
RebateApiagency_transaction_historyGET /rebate/agency/transaction_historyBroker obtains transaction history of recommended users
RebateApiagency_commissions_historyGET /rebate/agency/commission_historyBroker obtains rebate history of recommended users
RebateApipartner_transaction_historyGET /rebate/partner/transaction_historyPartner obtains transaction history of recommended users
RebateApipartner_commissions_historyGET /rebate/partner/commission_historyPartner obtains rebate records of recommended users
RebateApipartner_sub_listGET /rebate/partner/sub_listPartner subordinate list
RebateApirebate_broker_commission_historyGET /rebate/broker/commission_historyBroker obtains user's rebate records
RebateApirebate_broker_transaction_historyGET /rebate/broker/transaction_historyBroker obtains user's trading history
RebateApirebate_user_infoGET /rebate/user/infoUser obtains rebate information
RebateApiuser_sub_relationGET /rebate/user/sub_relationUser subordinate relationship
SpotApilist_currenciesGET /spot/currenciesQuery all currency information
SpotApiget_currencyGET /spot/currencies/{currency}Query single currency information
SpotApilist_currency_pairsGET /spot/currency_pairsQuery all supported currency pairs
SpotApiget_currency_pairGET /spot/currency_pairs/{currency_pair}Query single currency pair details
SpotApilist_tickersGET /spot/tickersGet currency pair ticker information
SpotApilist_order_bookGET /spot/order_bookGet market depth information
SpotApilist_tradesGET /spot/tradesQuery market transaction records
SpotApilist_candlesticksGET /spot/candlesticksMarket K-line chart
SpotApiget_feeGET /spot/feeQuery account fee rates
SpotApiget_batch_spot_feeGET /spot/batch_feeBatch query account fee rates
SpotApilist_spot_accountsGET /spot/accountsList spot trading accounts
SpotApilist_spot_account_bookGET /spot/account_bookQuery spot account transaction history
SpotApicreate_batch_ordersPOST /spot/batch_ordersBatch place orders
SpotApilist_all_open_ordersGET /spot/open_ordersList all open orders
SpotApicreate_cross_liquidate_orderPOST /spot/cross_liquidate_ordersClose position when cross-currency is disabled
SpotApilist_ordersGET /spot/ordersList orders
SpotApicreate_orderPOST /spot/ordersCreate an order
SpotApicancel_ordersDELETE /spot/ordersCancel all `open` orders in specified currency pair
SpotApicancel_batch_ordersPOST /spot/cancel_batch_ordersCancel batch orders by specified ID list
SpotApiget_orderGET /spot/orders/{order_id}Query single order details
SpotApicancel_orderDELETE /spot/orders/{order_id}Cancel single order
SpotApiamend_orderPATCH /spot/orders/{order_id}Amend single order
SpotApilist_my_tradesGET /spot/my_tradesQuery personal trading records
SpotApiget_system_timeGET /spot/timeGet server current time
SpotApicountdown_cancel_all_spotPOST /spot/countdown_cancel_allCountdown cancel orders
SpotApiamend_batch_ordersPOST /spot/amend_batch_ordersBatch modification of orders
SpotApiget_spot_insurance_historyGET /spot/insurance_historyQuery spot insurance fund historical data
SpotApilist_spot_price_triggered_ordersGET /spot/price_ordersQuery running auto order list
SpotApicreate_spot_price_triggered_orderPOST /spot/price_ordersCreate price-triggered order
SpotApicancel_spot_price_triggered_order_listDELETE /spot/price_ordersCancel all auto orders
SpotApiget_spot_price_triggered_orderGET /spot/price_orders/{order_id}Query single auto order details
SpotApicancel_spot_price_triggered_orderDELETE /spot/price_orders/{order_id}Cancel single auto order
WalletApilist_currency_chainsGET /wallet/currency_chainsQuery chains supported for specified currency
WalletApiget_deposit_addressGET /wallet/deposit_addressGenerate currency deposit address
WalletApilist_withdrawalsGET /wallet/withdrawalsGet withdrawal records
WalletApilist_depositsGET /wallet/depositsGet deposit records
WalletApitransferPOST /wallet/transfersTransfer between trading accounts
WalletApilist_sub_account_transfersGET /wallet/sub_account_transfersGet transfer records between main and sub accounts
WalletApitransfer_with_sub_accountPOST /wallet/sub_account_transfersTransfer between main and sub accounts
WalletApisub_account_to_sub_accountPOST /wallet/sub_account_to_sub_accountTransfer between sub-accounts
WalletApiget_transfer_order_statusGET /wallet/order_statusTransfer status query
WalletApilist_withdraw_statusGET /wallet/withdraw_statusQuery withdrawal status
WalletApilist_sub_account_balancesGET /wallet/sub_account_balancesQuery sub-account balance information
WalletApilist_sub_account_margin_balancesGET /wallet/sub_account_margin_balancesQuery sub-account isolated margin account balance information
WalletApilist_sub_account_futures_balancesGET /wallet/sub_account_futures_balancesQuery sub-account perpetual futures account balance information
WalletApilist_sub_account_cross_margin_balancesGET /wallet/sub_account_cross_margin_balancesQuery sub-account cross margin account balance information
WalletApilist_saved_addressGET /wallet/saved_addressQuery withdrawal address whitelist
WalletApiget_trade_feeGET /wallet/feeQuery personal trading fees
WalletApiget_total_balanceGET /wallet/total_balanceQuery personal account totals
WalletApilist_small_balanceGET /wallet/small_balanceGet list of convertible small balance currencies
WalletApiconvert_small_balancePOST /wallet/small_balanceConvert small balance currency
WalletApilist_small_balance_historyGET /wallet/small_balance_historyGet convertible small balance currency history
WalletApilist_push_ordersGET /wallet/pushGet UID transfer history
WithdrawalApiwithdrawPOST /withdrawalsWithdraw
WithdrawalApiwithdraw_push_orderPOST /withdrawals/pushUID transfer
WithdrawalApicancel_withdrawalDELETE /withdrawals/{withdrawal_id}Cancel withdrawal with specified ID

Documentation For Models

Documentation For Authorization

apiv4

Authentication with APIv4 key and secret

For details, refer to: APIv4 signed request requirements

Author

support@mail.gate.com

About

No description, website, or topics provided.

Resources

Stars

344 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages