Getting Started
This guide gets you from installation to your first public and authenticated Hyperliquid requests.
Install The Package
Make A Public HTTP Request
Use Info for public reads:
from hyperliquid import Info
async with Info.http() as info:
mids = await info.all_mids()
book = await info.l2_book('BTC')
Open A Public Stream
Use Streams for subscriptions:
from hyperliquid import Streams
async with Streams.new() as streams:
trades = await streams.trades('BTC')
async for batch in trades:
print(batch[0]['px'])
Make An Authenticated Request
Set your wallet private key:
Then use the composite client or Exchange directly:
from hyperliquid import Hyperliquid
async with Hyperliquid.http() as client:
result = await client.exchange.noop()
Transport Choices
Use the surface that matches what you need:
Info.http()for public request-response over HTTPInfo.ws()for public request-response over WebSocketExchange.http()orExchange.ws()for signed actionsStreams.new()for subscriptionsHyperliquid.http()orHyperliquid.ws()for the full bundle
Important Nuance
Hyperliquid.http() and Hyperliquid.ws() always require a wallet, because they include exchange.
For public-only workflows, prefer Info or Streams directly.
Next Steps
- Read Wallet Setup before using
ExchangeorHyperliquid - Read API Overview to understand the split between
Info,Exchange,Streams, andHyperliquid - Browse Examples for practical workflows