Gate.io API SDK
gateio-api provides JavaScript and TypeScript clients for Gate.io (Gate.com) Spot, margin and derivatives APIs. Read market data, follow account changes and manage orders through typed REST and WebSocket methods.
JavaScript & TypeScript · v1.6.8 · MIT license
Installation
TypeScript definitions are included.
Install the npm package with your preferred tool:
npm install gateio-apipnpm add gateio-apiyarn add gateio-apibun add gateio-apideno add npm:gateio-apiPackage: gateio-api
npm: https://www.npmjs.com/package/gateio-apiFor other npm-compatible tools, use the same package from npm. Runtime-specific setup is covered below.
Choose your setup
Follow the guide for your runtime or framework. Each includes a complete project with commands to install dependencies and run it.
| Setup | Guides |
|---|---|
| Node.js | JavaScript or TypeScript |
| Alternative runtimes | Bun or Deno |
| Browser apps | React with Vite or Vite with plain JavaScript |
| Next.js | Node.js server Route Handler |
| Cloudflare Workers | Public prices and authenticated orders |
| Mobile apps | React Native / Expo for iOS and Android |
Browser and Expo guides include SDK-specific bundler configuration and polyfills where needed. See Runtime setup for project recipes and required configuration.
First request
Follow the Node.js quickstart to read a public Bitcoin price without credentials. Examples use live services by default. For testing with simulated funds, configure TestNet.
Choose a client
- RestClient: public market data, authenticated account reads and order commands over REST.
- WebsocketClient: public and private subscriptions, connection events and low-level WebSocket API requests.
- WebsocketAPIClient: promise-based Spot and perpetual-futures order requests over WebSockets.