CLI
Query market, order-level, and monitoring routes from the terminal and drop the same commands into scripts, cron, or CI.
Use the CLI when you need shell-native access to market, order-level, and monitoring routes in scripts, cron jobs, CI, or agent pipelines.
Install
Install the CLI once, or use npx for a one-off check.
Install globally
npm install -g @0xarchive/cliRun without installing
npx @0xarchive/cli auth testAuthentication
Set the API key as an environment variable or pass it with --api-key.
# Set your API keyexport OXA_API_KEY="0xa_your_api_key"
# Verify it worksoxa auth testCommands
Use --format json for scripts and --format pretty for readable terminal output.
| Command | What it returns |
|---|---|
| oxa auth test | Verify API key |
| oxa orderbook get | L2 orderbook snapshot |
| oxa orderbook history | Historical orderbook snapshots with pagination |
| oxa trades fetch | Trade history (with --cursor pagination) |
| oxa candles | OHLCV candle data (1m to 1w intervals) |
| oxa funding current | Current funding rate |
| oxa funding history | Funding rate history |
| oxa oi current | Current open interest |
| oxa oi history | Open interest history |
| oxa instruments | List available instruments/coins |
| oxa liquidations | Liquidation history (Hyperliquid only) |
| oxa summary | Multi-signal snapshot in one call |
| oxa prices | Mark/oracle/mid price history |
| oxa freshness | Data freshness per data type |
| oxa orders history | Order history with user attribution (Pro+ on Hyperliquid and HIP-3) |
| oxa orders flow | Order flow aggregation (Pro+ on Hyperliquid and HIP-3) |
| oxa orders tpsl | TP/SL order history (Pro+ on Hyperliquid and HIP-3) |
| oxa l4 get | L4 orderbook reconstruction (Pro+ on Hyperliquid and HIP-3) |
| oxa l4 diffs | L4 diff stream history (Pro+ on Hyperliquid and HIP-3) |
| oxa l4 history | L4 checkpoint history (Build+ on Hyperliquid and HIP-3) |
| oxa l3 get | Lighter L3 order-level snapshot (Pro+) |
| oxa l3 history | Lighter L3 order-level history (Pro+) |
Examples
Run one query, confirm the JSON shape, then drop the same command into a script or job runner for replay, checkpoints, or Pro order-level pulls.
Market summary (price, funding, OI, volume)
oxa summary --exchange hyperliquid --symbol BTCOHLCV candles for backtesting
oxa candles --exchange hyperliquid --symbol ETH --start 2026-02-01T00:00:00Z --end 2026-03-01T00:00:00Z --interval 4hCurrent funding rate
oxa funding current --exchange hyperliquid --symbol BTCCurrent open interest
oxa oi current --exchange hyperliquid --symbol BTCList all available coins
oxa instruments --exchange hyperliquidRecent trades
oxa trades fetch --exchange lighter --symbol BTC --limit 50Per-symbol freshness check before a larger pull or replay
oxa freshness --exchange hyperliquid --symbol BTCOrder flow aggregation for Pro workflows
oxa orders flow --exchange hyperliquid --symbol BTC --start 2026-03-01T00:00:00Z --end 2026-03-02T00:00:00Z --interval 1hCheckpoint history for Build or Pro orderbook reconstruction
oxa l4 history --exchange hyperliquid --symbol BTC --start 2026-03-01T00:00:00Z --end 2026-03-02T00:00:00ZLighter L3 order-level snapshot on Pro
oxa l3 get --symbol BTC --format prettyAutomation and agents
The CLI emits JSON on stdout, structured errors on stderr, and stable exit codes: 0 success, 2 validation, 3 auth, 4 network, 5 internal.
# Verify API accessoxa auth test 2>/dev/null && echo "ready"
# Get multi-signal snapshotoxa summary --exchange hyperliquid --symbol BTC \ | jq '{price: .markPrice, funding: .fundingRate, oi: .openInterest}'
# Scan all coinsoxa instruments --exchange hyperliquid | jq '.[].name'
# Fetch candles for backtestingoxa candles --exchange hyperliquid --symbol ETH \ --start 2026-01-01T00:00:00Z --end 2026-02-01T00:00:00Z \ --interval 4h --out candles.json
# Gate on data freshness before actingoxa freshness --exchange hyperliquid --symbol BTC \ | jq '.orderbook.lagMs < 5000'