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

# Market Data

> Discover markets and read prices, order books, history and resolution data

Most market data is public and can be read without authentication.

## Discover Active Markets

Use `GET /events` to find active events and markets.

```bash theme={null}
curl 'https://hit.com/api/v1/events?eventStatus=ACTIVE&includeVolume=true&sortBy=liquidity&order=DESC&minLiquidity=100&limit=20'
```

Common filters:

| Query                          | Description                                                                                                                    |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------ |
| `eventStatus`                  | `DRAFT`, `ACTIVE`, `RESOLVED` or `ENDED`                                                                                       |
| `term`                         | Search event names, slugs and descriptions                                                                                     |
| `category`                     | Category UUID                                                                                                                  |
| `ends`                         | `TODAY`, `THIS_WEEK` or `THIS_MONTH`                                                                                           |
| `addedWithin`                  | `LAST_24H`, `LAST_7D` or `LAST_30D`                                                                                            |
| `minLiquidity`, `maxLiquidity` | Filter by USD liquidity                                                                                                        |
| `includeVolume`                | Include `tradeVolumeUsd` and `tradeVolumeUsd24h`                                                                               |
| `includeResolution`            | Include the market resolution timeline                                                                                         |
| `includeRewards`               | Include current-period reward opportunities as `market.reward`                                                                 |
| `tag`                          | Tag UUID; combines with `category` when both are supplied                                                                      |
| `sortBy`                       | `id`, `name`, `startDate`, `endDate`, `tradeVolumeUsd`, `tradeVolumeUsd24h`, `createdAt`, `eventStatus`, `slug` or `liquidity` |
| `order`                        | `ASC` or `DESC`                                                                                                                |
| `page`, `limit`, `total`       | Pagination controls                                                                                                            |

When sorting by `liquidity`, include `minLiquidity` or `maxLiquidity`.

## Discovery Examples

<Tabs sync={false}>
  <Tab title="TypeScript">
    ```typescript theme={null}
    type EventResponse = {
      data: Array<{
        id: string;
        name: string;
        markets: Array<{
          id: string;
          name: string;
          tokenId1: string;
          tokenId2: string;
          outcome1: string;
          outcome2: string;
          tickSize: string;
          orderFeeRateBps: number;
        }>;
      }>;
    };

    const response = await fetch(
      "https://hit.com/api/v1/events?eventStatus=ACTIVE&includeVolume=true&limit=5",
    );

    if (!response.ok) {
      throw new Error(`${response.status}: ${await response.text()}`);
    }

    const events = (await response.json()) as EventResponse;
    const firstMarket = events.data[0]?.markets[0];

    console.log(firstMarket?.id, firstMarket?.tokenId1, firstMarket?.tokenId2);
    ```
  </Tab>

  <Tab title="Python">
    ```python theme={null}
    import requests

    response = requests.get(
        "https://hit.com/api/v1/events",
        params={
            "eventStatus": "ACTIVE",
            "includeVolume": "true",
            "limit": 5,
        },
        timeout=10,
    )
    response.raise_for_status()

    events = response.json()["data"]
    first_market = events[0]["markets"][0]

    print(first_market["id"], first_market["tokenId1"], first_market["tokenId2"])
    ```
  </Tab>

  <Tab title="Rust">
    ```rust theme={null}
    use reqwest::blocking::Client;
    use serde_json::Value;

    fn main() -> Result<(), Box<dyn std::error::Error>> {
        let client = Client::new();
        let events: Value = client
            .get("https://hit.com/api/v1/events")
            .query(&[
                ("eventStatus", "ACTIVE"),
                ("includeVolume", "true"),
                ("limit", "5"),
            ])
            .send()?
            .error_for_status()?
            .json()?;

        let market = &events["data"][0]["markets"][0];
        println!(
            "{} {} {}",
            market["id"], market["tokenId1"], market["tokenId2"]
        );

        Ok(())
    }
    ```
  </Tab>
</Tabs>

## Single Event or Market

| Request                                                | Description                                           |
| ------------------------------------------------------ | ----------------------------------------------------- |
| `GET /events/{id_or_slug}`                             | Event with nested markets                             |
| `GET /events/{id_or_slug}?includeVolume=true`          | Event plus volume fields                              |
| `GET /events/{id_or_slug}?includeResolution=true`      | Event plus each market's resolution timeline          |
| `GET /events/{id_or_slug}/volume`                      | Total USD event volume                                |
| `GET /events/{id}/positions?users=USER_ID_1,USER_ID_2` | Public-safe positions in one event for up to 50 users |
| `GET /markets?ids=id1,id2,id3`                         | Markets by UUID                                       |
| `GET /markets/{id_or_slug}`                            | Single market                                         |
| `GET /markets/{id_or_slug}/holders`                    | Top holders for both outcome tokens                   |
| `GET /markets/{marketId}/volume`                       | Market volume                                         |

Use `includeRewards=true` on the event list when you need reward amount, `ACCRUING` or `SCHEDULED` status, accrual-window bounds, and current-period boost information inline with each market.

## Order Book

Read the current order book for an outcome token:

```bash theme={null}
curl 'https://hit.com/api/v1/order-book/book?token_id=TOKEN_ID'
```

Response:

```json theme={null}
{
  "market": "market-uuid",
  "asset_id": "TOKEN_ID",
  "timestamp": 1778748000000,
  "bids": [{ "price": "0.62", "size": "25", "numOrders": 2 }],
  "asks": [{ "price": "0.64", "size": "10", "numOrders": 1 }],
  "tick_size": "0.01"
}
```

## Last Trade Price

```bash theme={null}
curl 'https://hit.com/api/v1/order-book/last-trade-price?token_id=TOKEN_ID'
```

Response:

```json theme={null}
{
  "price": "0.63",
  "side": "buy"
}
```

## Price History

```bash theme={null}
curl 'https://hit.com/api/v1/price-history?token=TOKEN_ID&interval=1D&fidelity=5&limit=288'
```

| Query                    | Description                                                       |
| ------------------------ | ----------------------------------------------------------------- |
| `token`                  | Outcome token ID                                                  |
| `interval`               | `1H`, `6H`, `1D`, `1W`, `1M` or `ALL`                             |
| `fidelity`               | Minutes between points, from `1` to `1440`                        |
| `page`, `limit`, `total` | Pagination controls                                               |
| `strictFidelity`         | Reject fidelity above the interval maximum instead of clamping it |
| `sortBy`                 | `timestamp` or `price`                                            |
| `order`                  | `ASC` or `DESC`                                                   |

The maximum fidelity is `5` minutes for `1H`, `15` for `6H`, `60` for `1D`, `240` for `1W`, and `1440` for `1M` or `ALL`. Larger values are clamped unless `strictFidelity=true`. Large totals are capped; check `totalCapped` before treating `total` as exact.

## Resolution Data

```bash theme={null}
curl 'https://hit.com/api/v1/events/EVENT_ID?includeResolution=true'
```

Each returned market includes a `resolution` object with its current status, final or proposed outcome labels, dispute state and timestamp. Public event responses omit DRAFT markets.
