Getting Started with Gate.io

← Gate.io API

When to use this API

When you need current cryptocurrency market data — prices, trading volumes, order books, or currency status. Gate.io is surprisingly good at edge cases like delisted tokens, cross-chain assets, and trading pairs with unusual precision requirements. It covers thousands of trading pairs and hundreds of currencies. For historical OHLCV data, the API is your only option; for real-time price feeds with millisecond latency, look elsewhere.

Getting the current price of a trading pair

"What's NMR (Numeraire) trading at right now? The /spot/tickers endpoint returns 24-hour rolling window data for all pairs. Filter by currency_pair to get a specific market.

curl "https://api.gateio.ws/api/v4/spot/tickers?currency_pair=NMR_USDT" | head -c 10000
{
  "currency_pair": "NMR_USDT",
  "last": "7.43",
  "lowest_ask": "7.421",
  "highest_bid": "7.42",
  "change_percentage": "0.26",
  "base_volume": "70991.34",
  "quote_volume": "571909.68925",
  "high_24h": "9.298",
  "low_24h": "7.297"
}

Numeraire is trading at $7.43, up 0.26% in the last 24 hours. The spread between bid and ask is tight at about one cent, which is typical for liquid pairs. Notice change_percentage is a string — you'll want to parse it as a float and handle the sign yourself. The 24-hour range shows significant volatility: it touched $9.298 high and $7.297 low, a swing of over 25%.

NMR is trading at $7.43, up 0.26% in the last 24 hours. The price has been volatile today, ranging from $7.30 to $9.30.

Checking a currency's deposit and withdrawal status

"Can I deposit Scroll (SCR) to Gate.io? The /spot/currencies/{currency} endpoint reveals more than just names and symbols — it shows whether deposits, withdrawals, and trading are currently enabled, plus cross-chain support details.

curl "https://api.gateio.ws/api/v4/spot/currencies/SCR" | head -c 10000
{
  "currency": "SCR",
  "name": "Scroll",
  "delisted": false,
  "withdraw_disabled": false,
  "withdraw_delayed": false,
  "deposit_disabled": false,
  "trade_disabled": false,
  "chain": "SCROLLETH",
  "chains": [
    {
      "name": "SCROLLETH",
      "addr": "0xd29687c813d741e2f938f4ac377128810e217b1b",
      "withdraw_disabled": false,
      "withdraw_delayed": false,
      "deposit_disabled": false
    }
  ],
  "total_supply": "1000000000",
  "market_cap": "8466400.0"
}

Scroll is active on Gate.io with deposits, withdrawals, and trading all enabled. The chains array is the key field here — it shows this token exists on Scroll's Ethereum L2 (SCROLLETH). Some currencies exist on multiple chains; Gate.io surfaces per-chain status in that array. The market_cap of $8.4 million places it firmly in micro-cap territory, which explains why total_supply is provided — useful context when a user asks about tokenomics.

Yes, Scroll (SCR) deposits are currently enabled on Gate.io. It's a Layer 2 token on the SCROLLETH chain with a market cap of about $8.4 million.

Viewing the order book depth

"What's the bid-ask spread for Bitcoin? The /spot/order_book endpoint returns the current order book with top bids and asks. This is where you see real market depth, not just the last traded price.

curl "https://api.gateio.ws/api/v4/spot/order_book?currency_pair=BTC_USDT&limit=5" | head -c 10000
{
  "current": 1775441528349,
  "update": 1775441528348,
  "asks": [
    ["69180.8", "0.640863"],
    ["69181.9", "0.00005"],
    ["69182.8", "0.31802"],
    ["69185.3", "0.00005"],
    ["69186", "0.145297"]
  ],
  "bids": [
    ["69180.7", "0.071504"],
    ["69180.2", "0.116222"],
    ["69173.9", "0.032779"],
    ["69173.8", "0.04"],
    ["69173.2", "0.000825"]
  ]
}

The spread is razor-thin at $0.10 ($69,180.80 ask vs $69,180.70 bid), but look at the size disparity: there's over 0.64 BTC offered at the ask versus only 0.07 BTC bid at the top level. The current and update timestamps are in milliseconds since epoch — this snapshot is from a specific moment, and the API returns what it had at that update ID. For context, the next bid level down is at $69,180.20, creating a gap of $0.50 in the depth.

Bitcoin is trading with a $0.10 spread — $69,180.70 bid versus $69,180.80 ask. There's significantly more sell pressure at the ask (0.64 BTC) than buy pressure at the bid (0.07 BTC).

Pitfalls

One-line summary for the user

I can fetch cryptocurrency market data — current prices, trading volumes, order books, and currency status — from Gate.io's public API with no authentication required.