Bitget API SDK
bitget-api provides JavaScript and TypeScript clients for Bitget Unified Trading Account (UTA) V3 and Classic V2 APIs. Read Spot and futures prices, subscribe to private account updates and manage orders with typed REST and WebSocket methods.
JavaScript & TypeScript · v3.2.8 · MIT license
Installation
TypeScript definitions are included.
Install the npm package with your preferred tool:
npm install bitget-apipnpm add bitget-apiyarn add bitget-apibun add bitget-apideno add npm:bitget-apiPackage: bitget-api
npm: https://www.npmjs.com/package/bitget-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
Start with the Node.js quickstart, which uses V3 to read a public Bitcoin ticker without credentials. The guides use UTA V3, with Classic V2 alternatives for existing Classic accounts. Examples use production services by default. To use simulated funds, configure demo trading.
Choose a client
- RestClientV3: UTA public market data, account reads and trading, plus the V3 product APIs exposed by the SDK.
- WebsocketClientV3: UTA V3 subscriptions and low-level WebSocket API requests.
- WebsocketAPIClient: promise-based UTA V3 order commands over WebSockets.
- RestClientV2: Classic Spot, futures, margin and related account/product REST APIs.
- WebsocketClientV2: Classic V2 public and private subscriptions.