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

# Markets & Events

> List, filter, and price Polymarket markets and events.

A **market** is a single tradable question with outcomes (usually `Yes`/`No`) and a price per outcome in `0..1`. An **event** groups related markets — for example a presidential election event holds one market per candidate.

## Markets

<CardGroup cols={2}>
  <Card title="List markets" icon="list" href="/docs/openapi/list-markets">
    Paginate and filter by `active`, `eventId`; sort by volume, liquidity, or end date.
  </Card>

  <Card title="Trending markets" icon="fire" href="/docs/openapi/trending-markets">
    Top markets by 24h volume.
  </Card>

  <Card title="Get a market" icon="circle-info" href="/docs/openapi/get-market">
    Full market detail by `slug`.
  </Card>

  <Card title="Current prices" icon="tag" href="/docs/openapi/market-prices">
    Best bid/ask, midpoint, and spread per outcome.
  </Card>

  <Card title="Order book" icon="layer-group" href="/docs/openapi/market-orderbook">
    Full CLOB depth for both outcomes, best-first, live from the venue.
  </Card>

  <Card title="Price history" icon="chart-line" href="/docs/openapi/market-price-history">
    Yes-price time series over `1h`…`max` intervals.
  </Card>

  <Card title="OHLC candles" icon="chart-candlestick" href="/docs/openapi/market-bars">
    OHLC bars for the Yes outcome at your chosen interval/fidelity.
  </Card>

  <Card title="Price at time" icon="clock" href="/docs/openapi/market-price-at">
    The last Yes price at or before a given timestamp (no interpolation).
  </Card>
</CardGroup>

```bash theme={null}
# Active markets, richest first
curl "https://api.polystats.ai/api/markets?active=true&sort=volume24hr&limit=20" \
  -H "X-API-KEY: YOUR_API_KEY"
```

## Events

<CardGroup cols={2}>
  <Card title="List events" icon="list" href="/docs/openapi/list-events">
    Filter by `active`, `closed`; sort by volume or end date.
  </Card>

  <Card title="Trending events" icon="fire" href="/docs/openapi/trending-events">
    Top events by 24h volume.
  </Card>

  <Card title="Get an event" icon="layer-group" href="/docs/openapi/get-event">
    Event detail including its child markets.
  </Card>
</CardGroup>

```bash theme={null}
# Top events right now
curl "https://api.polystats.ai/api/events/trending?limit=10" \
  -H "X-API-KEY: YOUR_API_KEY"
```
