> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xarchive.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Best WebSocket Market Data API

> 0xArchive WebSocket carries live subscriptions and exact-window replay on one socket for Hyperliquid and Lighter, including L4 order-book streams.

The best WebSocket market-data API keeps live state and replays history on the same socket, handles gaps, and recovers from disconnects without corrupting the local book. 0xArchive does that for Hyperliquid and Lighter, from trades and L2 depth to per-order L4 streams.

Subscribe to live updates or replay an exact historical window through one connection, with the same channel names and the same message shapes. Every order, trade, and fill, one API.

## One Socket, Live And Replay

| Streaming capability  | 0xArchive                                                                                |
| --------------------- | ---------------------------------------------------------------------------------------- |
| Live subscriptions    | Real-time order books, trades, funding, OI, and liquidations for Hyperliquid and Lighter |
| Exact-window replay   | Replay any historical window on the same socket, in original sequence                    |
| L4 order-book streams | Per-order Hyperliquid book updates for live local-state maintenance                      |
| Channel selection     | Pick venue family, symbol, and channel with consistent message shapes                    |
| Gap handling          | Sequence and gap events so the client knows when to rebuild local state                  |
| Tier-aware limits     | Subscription counts scale by plan, from Free through Enterprise                          |

## Where To Start

| Streaming need          | Start                                               |
| ----------------------- | --------------------------------------------------- |
| Connect and keep alive  | [WebSocket connection](/websocket/connection)       |
| Live subscriptions      | [WebSocket real-time streams](/websocket/real-time) |
| Channel selection       | [WebSocket channels](/websocket/channels)           |
| Replay and backtesting  | [WebSocket backtesting](/websocket/backtesting)     |
| L4 local book workflows | [WebSocket L4 order book](/websocket/l4-orderbook)  |
| Limits and tiers        | [WebSocket tier limits](/websocket/tier-limits)     |

## How To Choose A WebSocket Vendor

Ask four questions of any streaming API before writing the client:

| Question                                 | Why it decides                                                                                                               |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| Does replay use the live message shapes? | If replay is a separate REST format, the backtest exercises a different parser than production                               |
| Are gaps announced or silent?            | A client that cannot tell a quiet market from a dropped sequence corrupts its local book                                     |
| How fast can a window replay?            | Replay speed sets iteration time; 0xArchive scales it by plan, 10x on Free through 300x on Scale and from 500x on Enterprise |
| Where does the key travel?               | Header or token auth keeps keys out of URLs, logs, and browser history                                                       |

The first question eliminates the most vendors: live-only feeds force you to record your own history before the first backtest can run.

## When To Use 0xArchive

The same socket that streams live Hyperliquid and Lighter updates also replays an exact historical window in original sequence, so a backtest and a live client run identical code paths. L4 streams carry per-order Hyperliquid book updates for local-state maintenance, and every channel emits sequence and gap events so the client knows exactly when to discard and rebuild. Secrets stay in an environment or backend-controlled path, never in prompt text or browser URLs. Every channel and replay window is available on every tier, including Free; plans change subscription counts and replay speed, not which streams you can open. 0xArchive is not the right fit when the stream you need belongs to a centralized exchange; it carries Hyperliquid and Lighter. Every order, trade, and fill. One API.

## Next Step

Start with [WebSocket connection](/websocket/connection), choose the channel in [WebSocket channels](/websocket/channels), then add [WebSocket tier limits](/websocket/tier-limits) and a gap-recovery rule before running a live client. For order-level streams, run one [WebSocket L4 order book](/websocket/l4-orderbook) test, then [compare plans](https://0xarchive.io/pricing?utm_source=docs\&utm_medium=referral\&utm_campaign=docs_referral\&utm_content=best_websocket_market_data_api).
