Skip to content

Hyperliquid API SDK ​

@siebly/hyperliquid-api provides JavaScript and TypeScript clients for Hyperliquid market data, account queries, signed trading actions and WebSocket subscriptions.

Start with a public price request, then add account access, orders or streaming updates as needed.

JavaScript & TypeScript · v1.0.5 · MIT license

Installation ​

TypeScript definitions are included.

Install the npm package with your preferred tool:

sh
npm install @siebly/hyperliquid-api
sh
pnpm add @siebly/hyperliquid-api
sh
yarn add @siebly/hyperliquid-api
sh
bun add @siebly/hyperliquid-api
sh
deno add npm:@siebly/hyperliquid-api
text
Package: @siebly/hyperliquid-api
npm: https://www.npmjs.com/package/@siebly/hyperliquid-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 compatibility for tested versions, required configuration and what the checks cover.

First request ​

Follow the Node.js quickstart to read a public BTC price. It includes the complete JavaScript program, run command and expected output. No credentials are needed.

Clients ​

ClientPurpose
RestClientQuery market data and account state, or submit signed actions over HTTP.
WebsocketClientSubscribe to market data and account updates.
WebsocketAPIClientCall the REST client's methods over a WebSocket connection.

See Clients for setup and cleanup, or the API reference for methods and types.

Common tasks ​

TaskGuide
Read prices, order books and candlesMarket data
Receive market updatesWebSocket subscriptions
Query accounts or configure a signerAuthentication
Choose a network and set timeoutsConfiguration

Using the SDK ​

Error handling covers failed requests and rejected orders. Production usage covers retries, recovery and shutdown. Start with Troubleshooting for a specific failure.

For a longer walkthrough, see the Hyperliquid JavaScript tutorial on Siebly.io.

Built by Siebly. Open source SDKs for exchange APIs.