API reference
Client methods, parameters and response types exported by @siebly/hyperliquid-api. The same API works in JavaScript and TypeScript.
Clients
| Client | Use it for |
|---|---|
| RestClient | HTTP requests for market data, account state and Exchange actions |
| WebsocketClient | Streaming subscriptions, lifecycle events and raw WebSocket requests |
| WebsocketAPIClient | Awaitable SDK methods over WebSocket |
Common methods
| Task | Method |
|---|---|
| Get mid prices | getAllMids() |
| Get an order book | getOrderBook() |
| Get candles | getCandles() |
| Read positions and margin | getPerpAccountSummary() |
| Place orders | submitOrder() |
| Check an order by ID | getOrderStatus() |
| Subscribe to updates | subscribe() |
Signed actions require authentication. See Error handling for rejected requests and per-order results.
For retries, recovery and shutdown, see Production usage.
Types
Find a method or type
Search guides, methods and types with ⌘K / Ctrl+K.