# XahauIndex cookbook

Generated from `x-cookbook` in [`docs/openapi.yaml`](openapi.yaml). Do not edit this file by hand — run `npm run docs:sync`.

XahauIndex is an independent PuppyTools project. It is not affiliated with, endorsed by, or a product of the Xahau network or its operators. The XI mark is original artwork inspired by [Xahau/Graphics](https://github.com/Xahau/Graphics).

Project site: https://xahauindex.dev.

Base URL: `https://xahauindex.dev`. Wait until `/v1/status` reports `snapshot_status: complete` before expecting token, URIToken, issuer, or Hook lists.

## Wait for the snapshot

Token, URIToken, issuer, and Hook lists stay empty until `snapshot_status` is `complete`.

```bash
curl -s https://xahauindex.dev/v1/status
```

## List verified tokens

```bash
curl -s 'https://xahauindex.dev/v1/tokens?domain_verified=true&per_page=5'
```

## Token detail

```bash
curl -s https://xahauindex.dev/v1/tokens/USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh
```

## Token holders

```bash
curl -s 'https://xahauindex.dev/v1/tokens/USD/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh/holders?nonzero=true'
```

## URITokens for an owner

```bash
curl -s 'https://xahauindex.dev/v1/uritokens?owner=rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh&per_page=5'
```

## URIToken detail

`id` is the 64-character hex URITokenID. Packed on-chain URIs return `metadata.source: "onchain"`.

```bash
curl -s https://xahauindex.dev/v1/uritokens/CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
```

## Issuer profile

```bash
curl -s https://xahauindex.dev/v1/issuers/rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh
```

## OHLCV candles

```bash
curl -s 'https://xahauindex.dev/v1/prices/USD/XAH?base_issuer=rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh&period=1h&limit=24'
```

## DEX trade tape

```bash
curl -s 'https://xahauindex.dev/v1/trades/USD/XAH?base_issuer=rHb9CJAWyB4rj91VRWn96DkukG4bwdtyTh&per_page=5'
```

## Account hook state

```bash
curl -s https://xahauindex.dev/v1/hooks/rHktfGUbjqzU4GsYCMc1pDjdHXb5CJamto
```

## Hook definitions

```bash
curl -s 'https://xahauindex.dev/v1/hooks/definitions?per_page=5'
```

## WebSocket subscribe

Not a xahaud `ledger` / `transactions` subscribe. Those sockets emit raw protocol traffic. This one pushes the same enriched objects as REST (`tokens`, `uritokens`, `prices`, `hooks`) after this node has indexed them.


```bash
npx wscat -c wss://xahauindex.dev/v1/subscribe
# then send:
# {"command":"subscribe","streams":["tokens","uritokens","prices","hooks"]}
```

