CLI

Query market, order-level, and monitoring routes from the terminal and drop the same commands into scripts, cron, or CI.

Format
JSON-first CLI
For
Scripts, CI, automation
Coverage
Hyperliquid, Lighter.xyz, HIP-3

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

Bash
npm install -g @0xarchive/cli

Run without installing

Bash
npx @0xarchive/cli auth test

Authentication

Set the API key as an environment variable or pass it with --api-key.

Bash
# Set your API key
export OXA_API_KEY="0xa_your_api_key"
# Verify it works
oxa auth test

Commands

Use --format json for scripts and --format pretty for readable terminal output.

CommandWhat it returns
oxa auth testVerify API key
oxa orderbook getL2 orderbook snapshot
oxa orderbook historyHistorical orderbook snapshots with pagination
oxa trades fetchTrade history (with --cursor pagination)
oxa candlesOHLCV candle data (1m to 1w intervals)
oxa funding currentCurrent funding rate
oxa funding historyFunding rate history
oxa oi currentCurrent open interest
oxa oi historyOpen interest history
oxa instrumentsList available instruments/coins
oxa liquidationsLiquidation history (Hyperliquid only)
oxa summaryMulti-signal snapshot in one call
oxa pricesMark/oracle/mid price history
oxa freshnessData freshness per data type
oxa orders historyOrder history with user attribution (Pro+ on Hyperliquid and HIP-3)
oxa orders flowOrder flow aggregation (Pro+ on Hyperliquid and HIP-3)
oxa orders tpslTP/SL order history (Pro+ on Hyperliquid and HIP-3)
oxa l4 getL4 orderbook reconstruction (Pro+ on Hyperliquid and HIP-3)
oxa l4 diffsL4 diff stream history (Pro+ on Hyperliquid and HIP-3)
oxa l4 historyL4 checkpoint history (Build+ on Hyperliquid and HIP-3)
oxa l3 getLighter L3 order-level snapshot (Pro+)
oxa l3 historyLighter 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)

Bash
oxa summary --exchange hyperliquid --symbol BTC

OHLCV candles for backtesting

Bash
oxa candles --exchange hyperliquid --symbol ETH --start 2026-02-01T00:00:00Z --end 2026-03-01T00:00:00Z --interval 4h

Current funding rate

Bash
oxa funding current --exchange hyperliquid --symbol BTC

Current open interest

Bash
oxa oi current --exchange hyperliquid --symbol BTC

List all available coins

Bash
oxa instruments --exchange hyperliquid

Recent trades

Bash
oxa trades fetch --exchange lighter --symbol BTC --limit 50

Per-symbol freshness check before a larger pull or replay

Bash
oxa freshness --exchange hyperliquid --symbol BTC

Order flow aggregation for Pro workflows

Bash
oxa orders flow --exchange hyperliquid --symbol BTC --start 2026-03-01T00:00:00Z --end 2026-03-02T00:00:00Z --interval 1h

Checkpoint history for Build or Pro orderbook reconstruction

Bash
oxa l4 history --exchange hyperliquid --symbol BTC --start 2026-03-01T00:00:00Z --end 2026-03-02T00:00:00Z

Lighter L3 order-level snapshot on Pro

Bash
oxa l3 get --symbol BTC --format pretty

Automation 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.

Bash
# Verify API access
oxa auth test 2>/dev/null && echo "ready"
# Get multi-signal snapshot
oxa summary --exchange hyperliquid --symbol BTC \
| jq '{price: .markPrice, funding: .fundingRate, oi: .openInterest}'
# Scan all coins
oxa instruments --exchange hyperliquid | jq '.[].name'
# Fetch candles for backtesting
oxa 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 acting
oxa freshness --exchange hyperliquid --symbol BTC \
| jq '.orderbook.lagMs < 5000'

npm

Install from the npm registry.

GitHub

Source code and contribution guide.

Get an API key

Create an account and manage the keys your scripts will use.