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

# Price history

> Get historical price data for a prediction market event

## Authentication

No authentication required.

## Path parameters

<ParamField path="eventId" type="string" required>
  UUID of the event.
</ParamField>

## Query parameters

<ParamField query="timePeriod" type="string" default="24H">
  Time window for the history. One of: `12H`, `24H`, `1W`, `1M`, `1Y`.
</ParamField>

<ParamField query="marketId[]" type="array">
  Filter to specific market UUIDs (comma-separated). Omit to return all markets in the event.
</ParamField>

<ParamField query="outcome" type="string">
  Filter to a specific outcome: `YES` or `NO`.
</ParamField>

## Example request

<CodeGroup>
  ```bash cURL theme={null}
  curl "https://relay.bayse.markets/v1/pm/events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/price-history?timePeriod=1W&outcome=YES"
  ```

  ```javascript Node.js theme={null}
  const eventId = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890';
  const response = await fetch(
    `https://relay.bayse.markets/v1/pm/events/${eventId}/price-history?timePeriod=1W&outcome=YES`
  );
  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  event_id = 'a1b2c3d4-e5f6-7890-abcd-ef1234567890'
  resp = requests.get(
      f'https://relay.bayse.markets/v1/pm/events/{event_id}/price-history',
      params={'timePeriod': '1W', 'outcome': 'YES'},
  )
  data = resp.json()
  ```

  ```go Go theme={null}
  req, _ := http.NewRequest(
      "GET",
      "https://relay.bayse.markets/v1/pm/events/a1b2c3d4-e5f6-7890-abcd-ef1234567890/price-history",
      nil,
  )
  q := req.URL.Query()
  q.Add("timePeriod", "1W")
  q.Add("outcome", "YES")
  req.URL.RawQuery = q.Encode()
  resp, _ := http.DefaultClient.Do(req)
  ```
</CodeGroup>

## Response

Returns a map of market IDs to their price history arrays.

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "b2c3d4e5-f6a7-8901-bcde-f12345678901": [
      {
        "outcome": "YES",
        "price": 0.65,
        "timestamp": "2026-02-10T00:00:00Z"
      },
      {
        "outcome": "YES",
        "price": 0.68,
        "timestamp": "2026-02-11T00:00:00Z"
      },
      {
        "outcome": "YES",
        "price": 0.72,
        "timestamp": "2026-02-17T00:00:00Z"
      }
    ]
  }
  ```
</ResponseExample>
