Skip to main content
The okx-api package is a fully-featured, actively maintained Node.js and TypeScript SDK for interacting with the OKX exchange. It covers every endpoint in OKX’s REST API and provides a robust, auto-reconnecting WebSocket client for real-time market data and private account streams.

Quickstart

Install the package and make your first API call in minutes

Authentication

Learn how to create and configure your OKX API credentials

REST Client

Explore the full REST API — account, trading, funding and more

WebSocket Client

Subscribe to real-time streams with automatic reconnection

Installation

npm install okx-api

Key exports

import {
  RestClient,           // Full REST API client
  WebsocketClient,      // Real-time WebSocket streams
  WebsocketAPIClient,   // Promise-based WebSocket API (orders)
} from 'okx-api';

Community & support

Build docs developers (and LLMs) love