Quickstart
Live Hyperliquid trades on your terminal in about five minutes. You need an API key and grpcurl (brew install grpcurl). Reflection is enabled on the endpoint, so no proto files are required to start.
Get an API key
Create a key in the console. Both plans include every stream in this guide, against the production feeds. Every example below passes the key as
x-api-keymetadata.List the available services
# list available services (reflection is enabled)grpcurl -H 'x-api-key: YOUR_KEY' stream.hyperliquidrpc.com:443 listYou should see the four proto packages:
hyperliquid(StreamData, order books, blocks),hyperliquid_swaps.v1,hyperliquid_btc_price.v1, andhyperliquid_l1_gateway.v2. If this command fails, the key is missing or invalid; nothing else can be wrong yet.Stream live BTC trades
# live BTC trades (Solana-swap schema)grpcurl -H 'x-api-key: YOUR_KEY' -d '{"market_type":"ALL","coins":["BTC"]}' \ stream.hyperliquidrpc.com:443 hyperliquid_swaps.v1.SwapStreaming/StreamSwapsOne JSON message per executed fill, in block order, with the trader's wallet, realized PnL, and fee on every message:
{ "block_height": 612408133, "block_time": "2026-06-09T08:14:02.418Z", "coin": "BTC", "px": "67012.0", "sz": "0.14523", "notional": "9732.15", "side": "B", "crossed": true, "user": "0x7c4ee0c0c5d3ab91f7f0f3c2a3d6b18452e9a3f9", "dir": "Close Short", "start_position": "-0.42100", "closed_pnl": "182.337041", "fee": "2.433037", "is_rebate": false, "oid": 91834221107, "cloid": "0x00000000000000000000000000a1b2c3", "tid": 442191083327011, "twap_id": null, "liquidation": null}Prices, sizes, and PnL are byte-exact decimal strings, never floats.
coinsandwalletsfilter server-side, so you only receive (and pay bandwidth for) what you subscribe to.Read the top of the book
# BTC top-of-book pricegrpcurl -H 'x-api-key: YOUR_KEY' -d '{"coin":"BTC","n_levels":1}' \ stream.hyperliquidrpc.com:443 hyperliquid.OrderBookStreaming/StreamL2BookThe first message is a full snapshot, then one update per block. With
n_levels: 1this is a clean top-of-book ticker for any market; raise it (up to 100) for depth. The book is guaranteed never crossed.Generate a client
For production, swap grpcurl for a real client. Reflection means you can generate stubs straight from the endpoint, or use the proto files we provide. See SDKs & protos for the per-language generation commands.
import grpc channel = grpc.secure_channel( "stream.hyperliquidrpc.com:443", grpc.ssl_channel_credentials(), # Full book snapshots can be large. Raise the receive limit. options=[("grpc.max_receive_message_length", 256 * 1024 * 1024)],)metadata = (("x-api-key", "YOUR_KEY"),) # Stubs generated from our protos. See "SDKs & protos".stub = swaps_pb2_grpc.SwapStreamingStub(channel)request = swaps_pb2.StreamSwapsRequest(market_type="ALL", coins=["BTC"]) for swap in stub.StreamSwaps(request, metadata=metadata): # px / sz / closed_pnl are byte-exact decimal strings print(swap.coin, swap.px, swap.sz, swap.user)Next steps
You have live data. Before production: handle reconnects and
DATA_LOSS, raise your client's max receive size for book snapshots, and pick the stream that actually matches your need.AuthenticationKey handling, per-surface auth, and zero-downtime rotation.Choosing a streamMap what you need to the right stream before you build.OperationsReconnect with backoff, handle DATA_LOSS, set size limits.Rate limits & tiersWhat each tier includes and what happens at the limit.SDKs & protosProto files, reflection, and stub generation per language.API referenceEvery package, service, and method on one page.