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

# Use 0xArchive data in OpenBB

> Load Hyperliquid and Lighter order books, trades, candles, funding, open interest, liquidations and wallets into the OpenBB Platform and OpenBB Workspace with the openbb-0xarchive extension.

The [`openbb-0xarchive`](https://pypi.org/project/openbb-0xarchive/) extension adds 0xArchive to the [OpenBB Platform](https://docs.openbb.co). Every dataset comes back as an OpenBB result you can turn into a DataFrame, and every command also appears as a widget in OpenBB Workspace.

It covers Hyperliquid perps, HIP-3, HIP-4, Hyperliquid Spot, Lighter, and Lighter on Robinhood Chain. Requests go from your machine to our API with your own key.

## Set up

**1. Install the extension**

```bash theme={"theme":"github-dark"}
pip install openbb openbb-0xarchive
```

Add `openbb-derivatives` to also list our perps under `obb.derivatives.futures`.

**2. Add your 0xArchive key**

[Sign up](https://0xarchive.io/dashboard?utm_source=docs\&utm_medium=referral\&utm_campaign=docs_referral\&utm_content=openbb_create_key), open **API keys** in the dashboard and create one. Then set it in Python:

```python theme={"theme":"github-dark"}
from openbb import obb

obb.user.credentials.oxarchive_api_key = "your-key"
```

To keep it across sessions, add `"oxarchive_api_key"` to `credentials` in `~/.openbb_platform/user_settings.json`.

**3. Load a market**

```python theme={"theme":"github-dark"}
obb.crypto.search("nvda", provider="oxarchive").to_df()
obb.crypto.price.historical("BTC", provider="oxarchive", interval="1h").to_df()
obb.oxarchive.orderbook.snapshot(symbol="ETH", venue="lighter").to_df()
```

Without dates, history commands cover the last 24 hours and candles the last 29 days. On Free, keep the start and end inside the most recent 30 days.

## What you can load

| Group | Commands |
| - | - |
| Market data | `trades`, `trades_recent`, `candles`, `funding_rates`, `funding_current`, `open_interest`, `open_interest_current`, `prices`, `summary` |
| Order books | `snapshot`, `history`, `l2`, `l2_history`, `l2_diffs`, `l4`, `l4_history`, `l4_diffs`, `l3`, `l3_history` |
| Liquidations | `events`, `volume`, `levels`, `levels_history`, `by_wallet` |
| Order flow | `cvd`, `order_flow`, `orders`, `tpsl`, `trigger_levels`, `trigger_levels_history`, `twap`, `twap_by_wallet`, `trade_intent`, `positioning` |
| Market breadth | `above_vwap`, `above_vwap_current`, `above_ma`, `above_ma_current` |
| Positions | `market`, `long_short`, `all` |
| Wallets and accounts | `profile`, `screen`, `positions`, `positions_history`, `position_changes`, `account`, `account_history`, `funding`, `lighter_accounts`, `usdc_flows`, `usdc_flow_volume` |
| Reference | `instruments`, `spot_pairs`, `outcomes`, `questions`, `oracle_price`, `discovery_bounds` |

Call each one as `obb.oxarchive.<group>.<command>`, for example `obb.oxarchive.liquidations.levels(symbol="BTC")`. Candles, symbol search and perp listings also work through OpenBB's standard `obb.crypto` and `obb.derivatives.futures` commands with `provider="oxarchive"`.

Not every dataset exists on every venue. Pass `venue` to choose one; the command lists the venues it accepts. [Venue coverage](https://docs.0xarchive.io/venue-coverage.md) has the start date of each dataset.

## How results are shaped

* **Order books** come back as one row per price level, with `side` and `level`. `l4` and `l3` return one row per resting order, with the wallet or account that placed it. A full BTC L4 book is about 55,000 rows, so `l4_history` returns one snapshot by default and at most 10; use `l4_diffs` to follow the book over time.
* **Symbols** use the same form as the REST API: `BTC`, `xyz:NVDA`, `HYPE`, and `#<id>` for HIP-4 outcomes. `BTC-USD` and `BTC-PERP` map to `BTC`.
* **History** comes back oldest first and pages through the API for you. `limit` caps the rows returned, or the snapshots for order book history. For the latest trades, pass a recent `start_date`, or use `market.trades_recent` on venues that offer it.
* **Intervals:** funding, open interest and price series default to `1h`. Pass `interval="raw"` for every update.
* **Plan limits:** a request outside your plan stops with the reason and a link to [pricing](https://0xarchive.io/pricing).

## OpenBB Workspace

Run `openbb-api` on your machine and add it as a backend in OpenBB Workspace. The 0xArchive widgets appear under **Crypto**, grouped the same way as the commands above.

## Next step

> [card] [Venue coverage](https://docs.0xarchive.io/venue-coverage.md)
>
> Check how far back each dataset goes before you load a long window.

> [card] [Source code](https://github.com/0xArchiveIO/openbb-0xarchive)
>
> Read the extension, open an issue, or run its tests.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.