Skip to content

HTX API SDK ​

@siebly/htx-api provides JavaScript and TypeScript clients for HTX Spot and futures APIs. Read market data, access account balances, manage orders and subscribe to public and private WebSocket channels.

JavaScript & TypeScript · v1.0.8 · MIT license

Installation ​

TypeScript definitions are included.

Install the npm package with your preferred tool:

sh
npm install @siebly/htx-api
sh
pnpm add @siebly/htx-api
sh
yarn add @siebly/htx-api
sh
bun add @siebly/htx-api
sh
deno add npm:@siebly/htx-api
text
Package: @siebly/htx-api
npm: https://www.npmjs.com/package/@siebly/htx-api

For 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.

SetupGuides
Node.jsJavaScript or TypeScript
Alternative runtimesBun or Deno
Browser appsReact with Vite or Vite with plain JavaScript
Next.jsNode.js server Route Handler
Cloudflare WorkersPublic prices and authenticated orders
Mobile appsReact 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 to read a public Bitcoin/USDT Spot price without credentials. The guides begin with Spot and explain where futures clients and connection keys differ. Examples use production services. See Testing without orders before enabling trading.

Choose a client ​

  • SpotClient: Spot market data, balances, orders, margin and account operations.
  • FuturesClient: futures market data and trading, including linear swaps, coin-margined swaps, delivery contracts and V5 endpoints.
  • WebsocketClient: public market subscriptions and private account updates across HTX products.
  • WebsocketAPIClient: promise-based Spot and derivatives trading commands over WebSockets.

Next steps ​

Built by Siebly. Open source SDKs for exchange APIs.