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

# Explorer API Overview

> Public, anonymized analytics over the global LeoKit swap dataset

## Overview

The Explorer API exposes the public, anonymized swap dataset that powers [explorer.leokit.dev](https://explorer.leokit.dev). It provides aggregated stats, period analytics, transaction lookups, wallet activity, protocol pool TVL, NEAR-ecosystem fee tracking, and on-chain transaction lookups across EVM and UTXO networks.

These endpoints are **public** — they do not require an `Api-Key`. They are not scoped to any individual client; the data covers all swaps brokered through LeoKit globally.

## Endpoints

<CardGroup cols={2}>
  <Card title="Search" icon="magnifying-glass" href="/api-reference/explorer/search">
    Find swaps by tx hash, wallet address, or partial match
  </Card>

  <Card title="Stats" icon="chart-bar" href="/api-reference/explorer/stats">
    Top-level totals: 24h volume, total swaps, supported chains
  </Card>

  <Card title="Analytics" icon="chart-line" href="/api-reference/explorer/analytics">
    Period analytics: timelines, top pairs, protocol breakdown
  </Card>

  <Card title="Transactions" icon="list" href="/api-reference/explorer/transactions">
    Paginated swap feed with chain/protocol filters
  </Card>

  <Card title="Transaction Detail" icon="receipt" href="/api-reference/explorer/tx">
    Single-tx lookup with related-tx context
  </Card>

  <Card title="Wallet" icon="wallet" href="/api-reference/explorer/wallet">
    Per-wallet summary, top pairs, activity heatmap
  </Card>

  <Card title="Pools" icon="droplet" href="/api-reference/explorer/pools">
    Live TVL across MAYAChain, THORChain, Chainflip, LEO
  </Card>

  <Card title="NEAR Earnings" icon="coins" href="/api-reference/explorer/near-earnings">
    NEAR-ecosystem affiliate fees collected by leodex.near
  </Card>

  <Card title="Onchain Lookup" icon="link" href="/api-reference/explorer/onchain">
    Raw chain-state lookup by chain + tx hash
  </Card>
</CardGroup>

## Common Conventions

### Authentication

None. These endpoints are publicly accessible and intended to back analytics dashboards.

### Caching

Most endpoints have server-side cache with `X-Cache: HIT|MISS` response headers. TTLs vary:

| Endpoint                           | TTL    |
| ---------------------------------- | ------ |
| `/explorer/stats`                  | 60 s   |
| `/explorer/analytics`              | 5 min  |
| `/explorer/wallet/{addr}`          | 60 s   |
| `/explorer/pools`                  | 5 min  |
| `/explorer/near-earnings`          | 10 min |
| `/explorer/transactions`           | none   |
| `/explorer/search`                 | none   |
| `/explorer/tx/{id}`                | none   |
| `/explorer/onchain/{chain}/{hash}` | none   |

### Response Shape

All responses follow:

```json theme={null}
{ "data": { /* ... */ } }
```

or for arrays:

```json theme={null}
{ "data": [ /* ... */ ], "count": 42 }
```

Errors use HTTP status + `{ "error": "...", "message": "..." }`.

### `ExplorerTransaction` Shape

The shape used by `search`, `transactions`, `wallet.recent_txs`, and `tx`:

```json theme={null}
{
  "id": "01953c9a-...",
  "tx_hash": "0xabc...",
  "from_asset": "ETH.USDC-0xA0b...",
  "to_asset": "BTC.BTC",
  "from_address": "0x1234...",
  "to_address": "bc1q...",
  "volume_usd": 1234.56,
  "protocol": "thorchain",
  "swap_date": "2026-04-28T12:00:00.000Z",
  "from_symbol": "USDC",
  "to_symbol": "BTC",
  "from_chain": "ETH",
  "to_chain": "BTC"
}
```
