GateIO

GateIO

GateIo API Information

GateIo API Link: https://www.gate.io/docs/developers/apiv4/en/#gate-api-v4-v4-90-1

Base Endpoints

  • Base Endpoint: https://api.gateio.ws/api/v4
  • Futures TestNet trading: https://fx-api-testnet.gateio.ws/api/v4
  • Futures live trading alternative (futures only): https://fx-api.gateio.ws/api/v4

HTTP convention

  • All read endpoints use the GET method and only accept request parameters. Request body is not read.
  • DELETE methods remove resources (e.g., orders) but not all deletion operations use DELETE, because DELETE does not read the request body. For complex deletion, POST method with parameters in the body is used.
  • Update operations use POST, PUT, or PATCH. Parameters may be in request body or query depending on the endpoint. Refer to endpoint details for request format.
  • All endpoints return HTTP status code 2xx on success. Authentication errors return 401. Other 4xx codes indicate malformed requests. 5xx codes indicate server-side errors.

Times

All time fields, unless noted otherwise, are in seconds unix timestamp, but formats may vary (int64, number, or string):

  • 1596531048
  • “1596531048”
  • 1596531048.285
  • “1596531048.285”

Pagination

Pagination can be done using one of the following methods:

  • page-limit
  • limit-offset

Both methods limit the maximum number of records returned per request. If unspecified, default is 100 and maximum is 1000.

  • page starts from 1, mimicking typical web page pagination. To loop through all records, keep limit constant and increment page by 1 until fewer records than limit are returned.
  • offset starts from 0, similar to DB search logic. Increase offset by limit to loop through all records.

Example with page-limit (total orders 201):

  • page=1&limit=100
  • page=2&limit=100
  • page=3&limit=100

Example with limit-offset:

  • limit=100&offset=0
  • limit=100&offset=100
  • limit=100&offset=200

Some endpoints may return additional pagination metadata in headers, e.g., for GET /futures/{settle}/orders:

  • X-Pagination-Limit: request limit
  • X-Pagination-Offset: request offset
  • X-Pagination-Total: total number of records satisfying the request

Frequency limit rule

GateIo API Link: https://www.gate.io/docs/developers/apiv4/en/#frequency-limit-rule

Markets Endpoints Limits Based On Content
All public endpoints Public endpoints 200r/10s per endpoint IP Orderbook, Candlestick, Ticker, etc.
Wallet Private endpoints Withdraw (POST /withdrawals): 1r/3s. Transfer between trading accounts (POST /wallet/transfers): 80r/10s. Transfer between main and subaccounts (POST /wallet/sub_account_transfers): 80r/10s. Transfer from one subaccount to another (POST /wallet/sub_account_to_sub_account): 80r/10s. Total balance (GET /wallet/total_balance): 80r/10s. Subaccount balances (GET /wallet/sub_account_balances): 80r/10s. Subaccount margin balances (GET /wallet/sub_account_margin_balances): 80r/10s. Subaccount futures balances (GET /wallet/sub_account_futures_balances): 80r/10s. Subaccount cross_margin balances (GET /wallet/sub_account_cross_margin_balances): 80r/10s. Others: 200r/10s per endpoint. UID Withdrawal. Query personal account balance. Query subaccount balance.
Spot Private endpoints Rate limit for bulk/single order placement and modifying an order: total 10r/s (UID + Market). Rate limit for bulk/single order cancellation: total 200r/s. Others: 200r/10s per endpoint. UID Spot order placement and cancellation. Trade history and fee rates.
Perpetual Futures Private endpoints After 2024-11-07 (UTC+8), refer to Trade Ratio Rate Limiting. Rate limit for bulk/single order placement and modification: total 100r/s. Maximum order cancellation (bulk/single): 200r/s. Others: 200r/10s per endpoint. UID Futures order placement and cancellation. Trade history and fee rates.
Delivery Private endpoints Maximum order placement limit (bulk/single): 500r/10s. Maximum order cancellation (bulk/single): 500r/10s. Others: 200r/10s per endpoint. UID Order placement and cancellation.
Options Private endpoints Maximum order placement limit (bulk/single): 200r/s. Maximum order cancellation (bulk/single): 200r/s. Others: 200r/10s per endpoint. UID Order placement and cancellation.
Subaccount Private endpoints 80r/10s per endpoint UID Create a sub-account. Retrieve the list of sub-accounts. Disable or enable API key for a sub-account.
Unified Private endpoints Borrow or repay: 15/10s UID Borrow or repay (POST /unified/loans)
Other Private endpoints Private endpoints 150r/10s per endpoint UID Earning, collateral, etc.

This table contains the rate limits according to endpoint types.

Future Rate Limit Rule

Contract Frequency Limitation Rules

Tier Ratio Rate Limit (uid)
Tier 1 [0,1) 100r/s
Tier 2 [1,3) 150r/s
Tier 3 [3,5) 200r/s
Tier 4 [5,10) 250r/s
Tier 5 [10,20) 300r/s
Tier 6 [20,50) 350r/s
Tier 7 >= 50 400r/s

Return Format

GateIo API Link: https://www.gate.io/docs/developers/apiv4/en/#return-format

All API responses are in JSON format, and users are responsible for parsing and extracting the data themselves.

HTTP status code 2XX indicates that all operations were successful. 401 indicates an authentication issue. Other 4xx status codes indicate that the request is invalid. A 5xx error indicates that the server encountered an unknown critical error while processing the request. Please provide feedback as soon as possible.

Return Status

Status Code Description
200/201 Request succeeded
202 Request accepted by the server, but processing is not done yet
204 Request succeeded, but the server doesn’t return body
400 Invalid request
401 Authentication failed
404 Not found
429 Too many requests
5xx Server error

RCXT GateIo API Information

GateIo exchange has 1 Base Endpoint:

  • apiUrl: api.gateio.ws

Rate Limits

The rate limit for each endpoint on GateIo is defined as follows:

Limit (10 saniye) Spot Margin Usd Futures Coin Futures Earn
Fetch Balances 200 Request Weight 200 Request Weight 200 Request Weight 200 Request Weight 200 Request Weight
Fetch Trades 200 Request Weight 200 Request Weight 200 Request Weight 200 Request Weight
Fetch Orders 200 Request Weight 200 Request Weight 200 Request Weight 200 Request Weight 200 Request Weight
Limit (10 saniye) TransferIn TransferOut Ticker
Fetch DepositWithdrawals 200 Request Weight 200 Request Weight
Fetch Ticker 200 Request Weight

Fetch Balances

Spot Balance
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/spot/accounts
  • RCXT Endpoint: api/v1/gateio/balances

User sends a GET request to query the BingX wallet balances. Required header parameters:

  • apiKey and secretKey

  • Limiter:

    • Each API endpoint has a specific Request Weight. Spot Balance Request Weight: 200
Margin Balance
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/margin/accounts
  • RCXT Endpoint: api/v1/gateio/balances

User sends a GET request to query Binance wallet balances. Required header parameters:

  • apiKey and secretKey

  • Limiter:

    • Each API endpoint has a specific Request Weight. Margin Balance Request Weight: 200
Isolated Margin Balance
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/margin/accounts
  • RCXT Endpoint: api/v1/gateio/balances

User sends a GET request to query Binance wallet balances. Required header parameters:

  • apiKey and secretKey

  • Limiter:

    • Each API endpoint has a specific Request Weight. Isolated Margin Balance Request Weight: 200
USD Futures Balance
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/usdt/accounts
  • RCXT Endpoint: api/v1/gateio/balances

User sends a GET request to query Binance wallet balances. Required header parameters:

  • apiKey and secretKey

  • Limiter:

    • Each API endpoint has a specific Request Weight. USD Futures Balance Request Weight: 200
Coin Futures Balance
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/btc/accounts
  • RCXT Endpoint: api/v1/gateio/balances

User sends a GET request to query Binance wallet balances. Required header parameters:

  • apiKey and secretKey

  • Limiter:

    • Each API endpoint has a specific Request Weight. Coin Futures Balance Request Weight: 200
Earn Balance
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/earn/uni/lends
  • RCXT Endpoint: api/v1/gateio/balances

User sends a GET request to query Binance wallet balances. Required header parameters:

  • apiKey and secretKey

  • Limiter:

    • Each API endpoint has a specific Request Weight. Earn Balance Request Weight: 200

Response Example:

{
  "spot": [
    {
      "coin": "BTTC",
      "total": "208850.4"
    }
  ],
  "margin": [
    {
      "coin": "DOGE",
      "total": "0.00399992"
    }
  ],
  "isolatedMargin": [
    {
      "coin": "DOGE",
      "total": "20.55645083"
    }
  ],
  "futures": [
    {
      "coin": "USDT",
      "total": "0.03733590"
    },
    {
      "coin": "DOGE",
      "total": "2000.00000000"
    }
  ],
  "earnings": [
    {
      "coin": "BNB",
      "total": "0.07886113"
    }
  ]
}

Fetch Trades

Spot Trades
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/spot/my_trades
  • RCXT Endpoint: api/v1/gateio/trades

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime: Start date to fetch data from.

  • type: Available: spot, margin, cFutures, uFutures. Use spot for Spot Trades.

  • offset: Number of records to skip (pagination).

  • page: Page number for pagination.

  • orderId: Filter by specific order ID.

  • symbol: Trading pair symbol (e.g., BTCUSDT).

  • Limiter:

    • Request Weight: 200
    • Max records per page: 1000
Margin Trades
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/spot/my_trades
  • RCXT Endpoint: api/v1/gateio/trades

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime: Start date to fetch data from.

  • type: Available: spot, margin, cFutures, uFutures. Use margin for Margin Trades.

  • offset: Number of records to skip (pagination).

  • page: Page number for pagination.

  • orderId: Filter by specific order ID.

  • symbol: Trading pair symbol (e.g., BTCUSDT).

  • Limiter:

    • Request Weight: 200
    • Max records per page: 1000
USD Futures Trades
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/usdt/my_trades_timerange
  • RCXT Endpoint: api/v1/gateio/trades

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime: Start date to fetch data from.

  • endTime: End date to fetch data to.

  • type: Available: spot, margin, uFutures, cFutures. Use uFutures for USD Futures Trades.

  • offset: Number of records to skip (pagination).

  • page: Page number for pagination.

  • orderId: Filter by specific order ID.

  • symbol: Trading pair symbol (e.g., BTCUSDT).

  • Limiter:

    • Request Weight: 200
    • Max records per page: 100
Coin Futures Trades
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/btc/my_trades_timerange
  • RCXT Endpoint: api/v1/gateio/trades

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime: Start date to fetch data from.

  • endTime: End date to fetch data to.

  • type: Available: spot, margin, uFutures, cFutures. Use cFutures for Coin Futures Trades.

  • offset: Number of records to skip (pagination).

  • page: Page number for pagination.

  • orderId: Filter by specific order ID.

  • symbol: Trading pair symbol (e.g., BTCUSDT).

  • Limiter:

    • Request Weight: 200
    • Max records per page: 100

Response Example:

{
  "trades": [
    {
      "orderId": "226664511",
      "tradeId": "27082209",
      "isBuyer": false,
      "isMaker": false,
      "price": "0.07610000",
      "quantity": "199.90000000",
      "symbol": "ACAUSDT",
      "time": 1737552748284,
      "commission": "0.01521239",
      "commissionCurrency": "USDT"
    }
  ],
  "cursor": ""
}

Fetch Orders

Spot Orders
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/spot/orders
  • RCXT Endpoint: api/v1/gateio/orders

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime: Start date to fetch data from.

  • endTime: End date to fetch data to.

  • type: Available: spot, cfutures, ufutures. Use spot for Spot Orders.

  • baseAsset

  • quoteAsset

  • offset: Number of records to skip (pagination).

  • orderId: Filter by specific order ID.

  • singleOrderId: Filter by single order ID.

  • page: Page number for pagination.

  • orderStatus: "open" for Open Orders, "closed" for Closed Orders.

  • symbol: Trading pair symbol (e.g., BTCUSDT).

  • Limiter:

    • Request Weight: 200
    • Max records per page: 100
Spot Open Orders
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/spot/open_orders
  • RCXT Endpoint: api/v1/gateio/orders

Header parameters required:

  • apiKey and secretKey

Query parameters: Same as Spot Orders with type = spot for open orders.

  • Limiter:
    • Request Weight: 200
    • Max records per page: 100
USD Futures Orders
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/usdt/orders
  • RCXT Endpoint: api/v1/gateio/orders

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime, endTime, symbol, orderId, singleOrderId, type, orderStatus, baseAsset, quoteAsset, offset, page

  • Use type = ufutures for USD Futures Orders.

  • Limiter:

    • Request Weight: 200
    • Max records per page: 100
USD Futures Open Orders
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/usdt/orders
  • RCXT Endpoint: api/v1/gateio/orders

Header parameters required:

  • apiKey and secretKey

Query parameters: Same as USD Futures Orders with type = ufutures for open orders.

  • Limiter:
    • Request Weight: 200
    • Max records per page: 100
Coin Futures Orders
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/btc/orders
  • RCXT Endpoint: api/v1/gateio/orders

Header parameters required:

  • apiKey and secretKey

Query parameters: Same as USD Futures Orders with type = cfutures for Coin Futures Orders.

  • Limiter:
    • Request Weight: 200
    • Max records per page: 100
Coin Open Futures Orders
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/futures/btc/orders
  • RCXT Endpoint: api/v1/gateio/orders

Header parameters required:

  • apiKey and secretKey

Query parameters: Same as Coin Futures Orders with type = cfutures for open orders.

  • Limiter:
    • Request Weight: 200
    • Max records per page: 100

Response Example:

{
  "orders": [
    {
      "orderId": "226664511",
      "symbol": "ACAUSDT",
      "type": "MARKET",
      "price": "0",
      "side": "SELL",
      "time": 1737552748284,
      "status": "CLOSED",
      "executedQuantity": "199.90000000",
      "quantity": "199.90000000"
    }
  ],
  "cursor": ""
}

Fetch Deposits/Withdrawals

TransferIn
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/wallet/deposits
  • RCXT Endpoint: api/v1/gateio/deposit-withdraw-history

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime: Start date to fetch data from.

  • offset: Number of records to skip (pagination).

  • type: Available: transferIn, transferOut. Use transferIn for Transfer In.

  • Limiter:

    • Request Weight: 200
    • Max records per page: 500
TransferOut
  • Base Endpoint: apiUrl (api.gateio.ws)
  • Endpoint: /api/v4/wallet/withdrawals
  • RCXT Endpoint: api/v1/gateio/deposit-withdraw-history

Header parameters required:

  • apiKey and secretKey

Query parameters:

  • startTime: Start date to fetch data from.

  • offset: Number of records to skip (pagination).

  • type: Available: transferIn, transferOut. Use transferOut for Transfer Out.

  • Limiter:

    • Request Weight: 200
    • Max records per page: 500

Response Example:

{
  "depositWithdrawals": [
    {
      "fiatCurrency": "",
      "cryptoCurrency": "ACA",
      "fiatAmount": "",
      "cryptoAmount": "199.9",
      "price": "",
      "address": "21Pau9weZ19NtbojGKnjFUDd2RZ4mpMMFqfYeYHmHLxV9ncr",
      "orderId": "",
      "transactionId": "4355261931473846528",
      "fee": "",
      "network": "ACA",
      "status": "1",
      "time": 1737552240000
    }
  ],
  "cursor": ""
}

Fetch Ticker

Ticker
  • Base Endpoint is apiUrl(api.gateio.ws).

  • Endpoint is /api/v4/spot/tickers.

  • RCXT Endpoint is api/v1/gateio/ticker.

  • Only the symbol value is taken as a query parameter (e.g., BTCUSDT):

    • symbol: Specifies the symbol of the cryptocurrency pair.
  • Limiter:

    • A specific Request Weight value is assigned for each API endpoint. Request Weight for Ticker is 200.

Response Example:

{
  "symbol": "BTCUSDT",
  "price": "104562.53000000"
}