Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/tiagosiebler/gateio-api/llms.txt

Use this file to discover all available pages before exploring further.

The Gate.io API SDK is a production-ready Node.js and TypeScript library for integrating with Gate.com’s (formerly Gate.io) full trading platform. A single RestClient covers every market — Spot, Margin, Perpetual Futures, Delivery Futures, Options, CrossEx, Alpha, and OTC — while WebsocketClient delivers real-time streaming with automatic reconnection and WebsocketAPIClient gives you a REST-like promise interface directly over WebSocket.

Quickstart

Install the SDK and make your first REST API call in under five minutes.

Authentication

Generate API credentials on Gate.com and pass them securely to any client.

REST API Overview

Explore the unified RestClient and all supported trading products.

WebSocket Streams

Subscribe to real-time market data and private account events.

What’s included

RestClient

Unified REST client for all Gate.com markets — 300+ typed methods.

WebsocketClient

Event-driven streaming with smart reconnection and heartbeat management.

WebsocketAPIClient

Promise-based WebSocket API — use it like a REST client.

Key features

  • Full TypeScript support — strongly-typed request and response objects for every endpoint
  • All Gate.com markets — Spot, Margin, Perpetual Futures, Delivery Futures, Options, CrossEx, Alpha, OTC
  • Smart WebSocket persistence — automatic reconnection, heartbeat monitoring, and resubscription
  • Dual WebSocket API interface — choose event-driven or promise-based patterns
  • Automatic authentication — HMAC signing handled internally for REST and WebSocket
  • Proxy support — pass any axios requestOptions for HTTP proxy configuration
  • Browser compatible — webpack bundle available for frontend usage

Get started

1

Install the package

npm install gateio-api
2

Create API credentials

Visit Gate.com API Key Management to generate your key and secret.
3

Make your first call

import { RestClient } from 'gateio-api';

const client = new RestClient({
  apiKey: 'YOUR_API_KEY',
  apiSecret: 'YOUR_API_SECRET',
});

const tickers = await client.getSpotTicker();
console.log(tickers);
4

Subscribe to real-time data

import { WebsocketClient } from 'gateio-api';

const ws = new WebsocketClient({ apiKey: 'YOUR_KEY', apiSecret: 'YOUR_SECRET' });

ws.subscribe('spot.tickers', 'spotV4');

ws.on('update', (data) => console.log(data));
Need help? Join the Node.js Algo Traders community on Telegram or open an issue on GitHub.

Build docs developers (and LLMs) love