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

# Markets

> Market definitions, odds data, delta feeds, price history, and participants

## Overview

Markets are the core data model in V2. Each market represents a type of bet (moneyline, spread, total, player props, etc.) with participants, lines, and prices from each sportsbook.

### Default Market IDs

When you call event endpoints without specifying `market_ids`, the API defaults to `1,2,3`:

| Market ID | Name | Description |
| - | - | - |
| **1** | Moneyline | Winner of the game. Two-way for most sports, three-way (includes draw) for soccer. |
| **2** | Point Spread | Handicap/spread betting. The favorite must win by more than the spread. |
| **3** | Total (Over/Under) | Combined score of both teams. Bet over or under the posted number. |

<Note>
  To get player props, team totals, or other market types, you must explicitly pass their IDs. For example, `market_ids=29` for Player Points or `market_ids=94` for Team Totals. See the [full Market IDs reference](/reference/markets).
</Note>

<Info>
  For a visual breakdown of how markets, participants, lines, and prices nest together, see the [Data Model](/reference/data-model). For the complete list of market IDs and sport availability, see [Market IDs](/reference/markets). For delta-based polling of market prices, see the [Efficient Polling guide](/guides/efficient-polling).
</Info>

***

## Endpoints

<Accordion title="GET /api/v2/markets — List all market definitions">
  Returns every canonical market definition with its ID, name, period info, and whether the line value represents a participant name.

  This is a reference endpoint -- it returns the market catalog, not live prices. Use it to build a mapping of market IDs to display names.

  <CodeGroup>
    ```bash cURL theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/markets"
    ```

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

    resp = requests.get(
        "https://therundown.io/api/v2/markets",
        headers={"X-TheRundown-Key": os.environ["THERUNDOWN_API_KEY"]}
    )
    markets = resp.json()
    ```

    ```javascript Node.js 22+ (server) theme={null}
    const API_KEY = process.env.THERUNDOWN_API_KEY;
    if (!API_KEY) throw new Error("Set THERUNDOWN_API_KEY in the Node.js server environment");
    const resp = await fetch(
      "https://therundown.io/api/v2/markets",
      { headers: { "X-TheRundown-Key": API_KEY } }
    );
    const markets = await resp.json();
    ```
  </CodeGroup>

  ### Response fields

  | Field | Description |
  | - | - |
  | `id` | Numeric market identifier |
  | `name` | Display name (e.g., "Money Line", "Player Points") |
  | `description` | Longer description of the market |
  | `short_description` | Abbreviated description |
  | `line_value_is_participant` | When `true`, the participant carries the selection and the line `value` may be a placeholder or label. When `false`, display the line value when present. |
  | `proposition` | Whether this is a proposition/player prop market |
  | `period_id` | Period this market applies to (see [Period IDs](/reference/periods)) |
  | `live_variant_id` | Market ID of the corresponding live/in-play variant, if any |
  | `updated_at` | When the market definition was last updated |

  ### Example Response

  ```json theme={null}
  [
    {
      "id": 1,
      "name": "Money Line",
      "description": "Pick the winner of the game",
      "short_description": "Winner",
      "line_value_is_participant": false,
      "proposition": false,
      "period_id": 0,
      "live_variant_id": 41,
      "updated_at": "2025-01-15T12:00:00Z"
    },
    {
      "id": 2,
      "name": "Point Spread",
      "description": "Handicap betting on the margin of victory",
      "short_description": "Spread",
      "line_value_is_participant": false,
      "proposition": false,
      "period_id": 0,
      "live_variant_id": 42,
      "updated_at": "2025-01-15T12:00:00Z"
    },
    {
      "id": 3,
      "name": "Total Over/Under",
      "description": "Combined score of both teams",
      "short_description": "Total",
      "line_value_is_participant": false,
      "proposition": false,
      "period_id": 0,
      "live_variant_id": 43,
      "updated_at": "2025-01-15T12:00:00Z"
    },
    {
      "id": 29,
      "name": "Player Points",
      "description": "Player points scored in the game",
      "short_description": "Points",
      "line_value_is_participant": true,
      "proposition": true,
      "period_id": 0,
      "live_variant_id": 90,
      "updated_at": "2025-01-15T12:00:00Z"
    },
    {
      "id": 94,
      "name": "Team Total",
      "description": "Total points scored by a single team",
      "short_description": "Team Total",
      "line_value_is_participant": true,
      "proposition": false,
      "period_id": 0,
      "live_variant_id": 96,
      "updated_at": "2025-01-15T12:00:00Z"
    }
  ]
  ```
</Accordion>

<Accordion title="GET /api/v2/markets/delta — Market price delta feed">
  Returns market line price changes (new, updated, removed) since the specified `last_id`. This is the most efficient way to keep your odds data up to date via polling.

  ### Parameters

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `last_id` | query | Yes | Positive integer cursor from the prior response or a known-zero-delay events snapshot that explicitly reports `X-Data-Delay-Seconds: 0`. |
  | `sport_id` | query | No | Filter by sport ID |
  | `affiliate_ids` | query | No | Comma-separated sportsbook IDs |
  | `market_ids` | query | No | Literal market-ID filter. For full-game core live updates, include `1,2,3,41,42,43`. |
  | `event_id` | query | No | Filter by event ID |
  | `limit` | query | No | Max results (default 1000, max 5000) |

  Bootstrap only from a known-zero-delay events snapshot that explicitly reports `X-Data-Delay-Seconds: 0`, using its positive `meta.delta_last_id`; do not substitute `0` for a missing or invalid cursor. The event snapshot expands core `market_ids=1,2,3` to include the in-play IDs. This delta endpoint filters IDs literally, so include `41,42,43` when polling full-game core live updates. Delta rows retain their actual market IDs.

  <CodeGroup>
    ```bash First poll after a valid snapshot theme={null}
    curl --fail-with-body -sS --connect-timeout 5 --max-time 20 \
      -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" \
      "https://therundown.io/api/v2/markets/delta?last_id=SNAPSHOT_DELTA_LAST_ID&sport_id=4&market_ids=1,2,3,41,42,43"
    ```

    ```bash Subsequent poll theme={null}
    curl --fail-with-body -sS --connect-timeout 5 --max-time 20 \
      -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" \
      "https://therundown.io/api/v2/markets/delta?last_id=PREVIOUS_LAST_ID&sport_id=4&market_ids=1,2,3,41,42,43"
    ```

    The following single-poll examples read `THERUNDOWN_DELTA_LAST_ID` after validating a positive whole-integer cursor from the known-zero-delay snapshot. The response can encode that cursor as a number or numeric string. For eligibility checks, bounded pages, and rebootstrap behavior, use the [Efficient Polling guide](/guides/efficient-polling).

    ```python Python — one server-side market delta poll theme={null}
    import os
    import requests

    api_key = os.environ.get("THERUNDOWN_API_KEY")
    raw_last_id = os.environ.get("THERUNDOWN_DELTA_LAST_ID")
    if not api_key:
        raise RuntimeError("Set THERUNDOWN_API_KEY")
    if not raw_last_id or not raw_last_id.isdigit() or int(raw_last_id) <= 0:
        raise RuntimeError("Set THERUNDOWN_DELTA_LAST_ID to a positive cursor")

    resp = requests.get(
        "https://therundown.io/api/v2/markets/delta",
        headers={"X-TheRundown-Key": api_key},
        params={
            "last_id": str(int(raw_last_id)),
            "sport_id": 4,
            "market_ids": "1,2,3,41,42,43",
        },
        timeout=20,
    )
    resp.raise_for_status()
    for change in resp.json().get("deltas", []):
        print(f"Price change: market={change['market_id']} price={change['price']}")
    ```

    ```javascript Node.js 22+ (server) theme={null}
    const apiKey = process.env.THERUNDOWN_API_KEY;
    const rawLastId = process.env.THERUNDOWN_DELTA_LAST_ID;
    if (!apiKey) throw new Error("Set THERUNDOWN_API_KEY");
    if (!rawLastId || !/^\d+$/.test(rawLastId) || !/[1-9]/.test(rawLastId)) {
      throw new Error("Set THERUNDOWN_DELTA_LAST_ID to a positive cursor");
    }

    const lastId = rawLastId.replace(/^0+/, "");
    const response = await fetch(
      `https://therundown.io/api/v2/markets/delta?last_id=${lastId}&sport_id=4&market_ids=1,2,3,41,42,43`,
      { headers: { "X-TheRundown-Key": apiKey }, signal: AbortSignal.timeout(20_000) },
    );
    if (!response.ok) throw new Error(`Market delta request failed: ${response.status}`);
    for (const change of (await response.json()).deltas ?? []) {
      console.log(`Price change: market=${change.market_id} price=${change.price}`);
    }
    ```
  </CodeGroup>

  ### Example Response

  ```json theme={null}
  {
    "meta": {
      "delta_last_id": "584012",
      "count": 3,
      "has_more": false
    },
    "deltas": [
      {
        "id": 584010,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_id": 2,
        "market_name": "Point Spread",
        "participant_id": 51,
        "participant_type": "TYPE_TEAM",
        "participant_name": "Cleveland Cavaliers",
        "line": "-4.5",
        "price": "-110",
        "previous_price": "-105",
        "change_type": "price_change",
        "updated_at": "2026-02-26T18:45:30Z"
      },
      {
        "id": 584011,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_id": 1,
        "market_name": "Moneyline",
        "participant_id": 56,
        "participant_type": "TYPE_TEAM",
        "participant_name": "New York Knicks",
        "line": "",
        "price": "125",
        "previous_price": "120",
        "change_type": "price_change",
        "updated_at": "2026-02-26T18:45:32Z"
      },
      {
        "id": 584012,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_id": 3,
        "market_name": "Total Over/Under",
        "participant_id": 0,
        "participant_type": "TYPE_RESULT",
        "participant_name": "Over",
        "line": "224.5",
        "price": "-108",
        "previous_price": "-110",
        "change_type": "price_change",
        "updated_at": "2026-02-26T18:45:35Z"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="GET /api/v2/markets/history — Price history by market line price IDs">
  Returns the price history for specific market line prices. You need the `market_line_price_id` values from a prior event or delta response.

  ### Parameters

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `market_line_price_ids` | query | Yes | Comma-separated IDs (max 50) |
  | `from` | query | No | Start time (RFC3339 format) |
  | `to` | query | No | End time (RFC3339 format) |
  | `limit` | query | No | Max results (default 1000, max 5000) |
  | `main_line` | query | No | `true` returns only rows that were the main line when written (`is_main_line` = true) |

  <CodeGroup>
    ```bash cURL theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/markets/history?market_line_price_ids=12345,12346,67890&limit=500"
    ```

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

    resp = requests.get(
        "https://therundown.io/api/v2/markets/history",
        headers={"X-TheRundown-Key": os.environ["THERUNDOWN_API_KEY"]},
        params={"market_line_price_ids": "12345,12346,67890", "limit": 500}
    )
    history = resp.json()
    ```

    ```javascript Node.js 22+ (server) theme={null}
    const API_KEY = process.env.THERUNDOWN_API_KEY;
    if (!API_KEY) throw new Error("Set THERUNDOWN_API_KEY in the Node.js server environment");
    const resp = await fetch(
      "https://therundown.io/api/v2/markets/history?market_line_price_ids=12345,12346,67890&limit=500",
      { headers: { "X-TheRundown-Key": API_KEY } }
    );
    const history = await resp.json();
    ```
  </CodeGroup>

  ### Example Response

  A `market_line_price_id` identifies one sportsbook's price on one line value, so a line ID never changes its `line`. Rows `90003` and `90004` show the main spread moving from `-3.5` to `-4.5`: the `is_main_line` flag leaves line `12345` and arrives on line `12346` at the same timestamp.

  ```json theme={null}
  {
    "meta": {
      "count": 6
    },
    "history": [
      {
        "id": 90001,
        "market_line_price_id": 12345,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 51,
        "market_id": 2,
        "line": "-3.5",
        "price": "-110",
        "previous_price": "",
        "change_type": "open",
        "is_main_line": true,
        "updated_at": "2026-02-24T14:00:00Z"
      },
      {
        "id": 90002,
        "market_line_price_id": 12345,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 51,
        "market_id": 2,
        "line": "-3.5",
        "price": "-115",
        "previous_price": "-110",
        "change_type": "price",
        "is_main_line": true,
        "updated_at": "2026-02-25T18:30:00Z"
      },
      {
        "id": 90003,
        "market_line_price_id": 12345,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 51,
        "market_id": 2,
        "line": "-3.5",
        "price": "-115",
        "previous_price": "",
        "change_type": "main_line",
        "is_main_line": false,
        "updated_at": "2026-02-26T01:15:00Z"
      },
      {
        "id": 90004,
        "market_line_price_id": 12346,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 51,
        "market_id": 2,
        "line": "-4.5",
        "price": "-110",
        "previous_price": "",
        "change_type": "main_line",
        "is_main_line": true,
        "updated_at": "2026-02-26T01:15:00Z"
      },
      {
        "id": 90005,
        "market_line_price_id": 67890,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 56,
        "market_id": 1,
        "line": "",
        "price": "110",
        "previous_price": "",
        "change_type": "open",
        "is_main_line": true,
        "updated_at": "2026-02-24T14:00:00Z"
      },
      {
        "id": 90006,
        "market_line_price_id": 67890,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 56,
        "market_id": 1,
        "line": "",
        "price": "122",
        "previous_price": "110",
        "change_type": "price",
        "is_main_line": true,
        "updated_at": "2026-02-25T22:00:00Z"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="GET /api/v2/markets/participants — Get market participants">
  Lists teams, players, or result sides for the requested event and markets. Use `participant_id` from this response, rather than `id`, to filter a [participant-specific chart](/api-reference/generated/v2-markets/get-line-price-chart-data-for-a-specific-market).

  For totals (market `3`), request `participant_type=TYPE_RESULT` to discover the Over and Under sides. Markets `1` and `2` use `TYPE_TEAM` participants. When `market_ids` is omitted, it defaults to `1,2,3`.

  ### Parameters

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `event_id` | query | Yes | Canonical V2 event ID that scopes participant discovery. |
  | `market_ids` | query | No | Comma-separated market IDs; defaults to `1,2,3`. |
  | `participant_ids` | query | No | Comma-separated public canonical participant IDs to return. |
  | `participant_type` | query | No | `TYPE_TEAM`, `TYPE_PLAYER`, or `TYPE_RESULT`. |

  <CodeGroup>
    ```bash cURL — discover total sides theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/markets/participants?event_id=733a06aa4f4f2a3af7872c3667a60f22&market_ids=3&participant_type=TYPE_RESULT"
    ```

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

    resp = requests.get(
        "https://therundown.io/api/v2/markets/participants",
        headers={"X-TheRundown-Key": os.environ["THERUNDOWN_API_KEY"]},
        params={
            "event_id": "733a06aa4f4f2a3af7872c3667a60f22",
            "market_ids": "3",
            "participant_type": "TYPE_RESULT",
        },
    )
    participants = resp.json()["participants"]
    ```

    ```javascript Node.js 22+ (server) theme={null}
    const API_KEY = process.env.THERUNDOWN_API_KEY;
    if (!API_KEY) throw new Error("Set THERUNDOWN_API_KEY in the Node.js server environment");
    const params = new URLSearchParams({
      event_id: "733a06aa4f4f2a3af7872c3667a60f22",
      market_ids: "3",
      participant_type: "TYPE_RESULT",
    });
    const resp = await fetch(
      `https://therundown.io/api/v2/markets/participants?${params}`,
      { headers: { "X-TheRundown-Key": API_KEY } }
    );
    const { participants } = await resp.json();
    ```
  </CodeGroup>

  ### Example Response

  This is an illustrative response with example record IDs and timestamps; use `participant_id` for a chart request.

  ```json theme={null}
  {
    "participants": [
      {
        "id": 70001,
        "market_event_id": 28401,
        "participant_id": 9,
        "participant_type": "TYPE_RESULT",
        "participant_name": "Over",
        "updated_at": "2026-09-09T19:00:00Z"
      },
      {
        "id": 70002,
        "market_event_id": 28401,
        "participant_id": 10,
        "participant_type": "TYPE_RESULT",
        "participant_name": "Under",
        "updated_at": "2026-09-09T19:00:00Z"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="GET /api/v2/events/{eventID}/markets — Available markets for an event">
  Returns the list of market definitions (not prices) available for a specific event. Use this to discover which markets are offered before requesting prices.

  ### Parameters

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `eventID` | path | Yes | Canonical V2 event ID from the `event_id` field |
  | `participant_ids` | query | No | Filter by participant IDs |
  | `participant_type` | query | No | Filter by participant type |

  <CodeGroup>
    ```bash List all available markets for an event theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/events/EVENT_ID/markets"
    ```

    ```bash Filter to player markets only theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/events/EVENT_ID/markets?participant_type=player"
    ```

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

    resp = requests.get(
        "https://therundown.io/api/v2/events/EVENT_ID/markets",
        headers={"X-TheRundown-Key": os.environ["THERUNDOWN_API_KEY"]}
    )
    markets = resp.json()
    ```

    ```javascript Node.js 22+ (server) theme={null}
    const API_KEY = process.env.THERUNDOWN_API_KEY;
    if (!API_KEY) throw new Error("Set THERUNDOWN_API_KEY in the Node.js server environment");
    const resp = await fetch(
      "https://therundown.io/api/v2/events/EVENT_ID/markets",
      { headers: { "X-TheRundown-Key": API_KEY } }
    );
    const markets = await resp.json();
    ```
  </CodeGroup>

  ### Example Response

  Returns the same market definition schema as `GET /api/v2/markets`, filtered to the markets available for this event.

  ```json theme={null}
  [
    {
      "id": 1,
      "name": "Money Line",
      "description": "Pick the winner of the game",
      "short_description": "Winner",
      "line_value_is_participant": false,
      "proposition": false,
      "period_id": 0,
      "live_variant_id": 41,
      "updated_at": "2025-01-15T12:00:00Z"
    },
    {
      "id": 2,
      "name": "Point Spread",
      "description": "Handicap betting on the margin of victory",
      "short_description": "Spread",
      "line_value_is_participant": false,
      "proposition": false,
      "period_id": 0,
      "live_variant_id": 42,
      "updated_at": "2025-01-15T12:00:00Z"
    },
    {
      "id": 3,
      "name": "Total Over/Under",
      "description": "Combined score of both teams",
      "short_description": "Total",
      "line_value_is_participant": false,
      "proposition": false,
      "period_id": 0,
      "live_variant_id": 43,
      "updated_at": "2025-01-15T12:00:00Z"
    },
    {
      "id": 29,
      "name": "Player Points",
      "description": "Player points scored in the game",
      "short_description": "Points",
      "line_value_is_participant": true,
      "proposition": true,
      "period_id": 0,
      "live_variant_id": 90,
      "updated_at": "2025-01-15T12:00:00Z"
    }
  ]
  ```
</Accordion>

<Accordion title="GET /api/v2/events/{eventID}/markets/history — Market history for an event">
  Returns recorded price-history rows for an event. Results are newest first and are subject to the historical access included with your plan.

  ### Parameters

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `eventID` | path | Yes | Canonical V2 event ID from the `event_id` field |
  | `market_ids` | query | No | Comma-separated market IDs. Defaults to `1,2,3`; maximum 12. |
  | `affiliate_ids` | query | No | Comma-separated sportsbook IDs |
  | `from` | query | No | Inclusive start time (RFC3339) |
  | `to` | query | No | Inclusive end time (RFC3339) |
  | `limit` | query | No | Total rows across the request (default 1000, max 5000; invalid values use 1000) |
  | `main_line` | query | No | `true` returns only rows that were the main line when written (`is_main_line` = true) |

  There is no paging cursor or truncation flag. If a response reaches the limit, narrow the market, sportsbook, or time window; it is not guaranteed to contain every matching row.

  <CodeGroup>
    ```bash cURL theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/events/EVENT_ID/markets/history?market_ids=1,2,3&affiliate_ids=19"
    ```

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

    resp = requests.get(
        "https://therundown.io/api/v2/events/EVENT_ID/markets/history",
        headers={"X-TheRundown-Key": os.environ["THERUNDOWN_API_KEY"]},
        params={"market_ids": "1,2,3", "affiliate_ids": "19"}
    )
    history = resp.json()
    ```

    ```javascript Node.js 22+ (server) theme={null}
    const API_KEY = process.env.THERUNDOWN_API_KEY;
    if (!API_KEY) throw new Error("Set THERUNDOWN_API_KEY in the Node.js server environment");
    const resp = await fetch(
      "https://therundown.io/api/v2/events/EVENT_ID/markets/history?market_ids=1,2,3&affiliate_ids=19",
      { headers: { "X-TheRundown-Key": API_KEY } }
    );
    const history = await resp.json();
    ```
  </CodeGroup>

  ### Example Response

  ```json theme={null}
  {
    "meta": {
      "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
      "count": 3
    },
    "history": [
      {
        "id": 80003,
        "market_line_price_id": 12345,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 51,
        "market_id": 1,
        "line": "",
        "price": "-145",
        "previous_price": "-140",
        "change_type": "price",
        "is_main_line": true,
        "updated_at": "2026-02-26T16:20:00Z"
      },
      {
        "id": 80002,
        "market_line_price_id": 12345,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 51,
        "market_id": 1,
        "line": "",
        "price": "-140",
        "previous_price": "-130",
        "change_type": "price",
        "is_main_line": true,
        "updated_at": "2026-02-25T09:30:00Z"
      },
      {
        "id": 80001,
        "market_line_price_id": 12345,
        "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
        "sport_id": 4,
        "affiliate_id": 19,
        "market_participant_id": 51,
        "market_id": 1,
        "line": "",
        "price": "-130",
        "change_type": "open",
        "is_main_line": true,
        "updated_at": "2026-02-24T14:00:00Z"
      }
    ]
  }
  ```
</Accordion>

<Accordion title="GET /api/v2/events/{eventID}/markets/{marketID}/history — Line chart data for a specific market">
  Returns time-series price data suitable for charting line movement on a single market. More granular than the general history endpoint. To chart one side, first [discover participants](/api-reference/generated/v2-markets/get-market-participants) for the same event and market, then pass its public `participant_id`. For totals (market `3`), discover `TYPE_RESULT` Over/Under and request each side separately. The response is grouped by affiliate and can otherwise contain points for more than one participant; `main_line=true` keeps only points that were the main line when written.

  ### Parameters

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `eventID` | path | Yes | Canonical V2 event ID from the `event_id` field |
  | `marketID` | path | Yes | Market ID (e.g., `1` for Moneyline) |
  | `participant_id` | query | No | Public canonical ID from [participant discovery](/api-reference/generated/v2-markets/get-market-participants); for totals, use the discovered Over or Under `TYPE_RESULT` ID. |
  | `affiliate_ids` | query | No | Comma-separated sportsbook IDs |
  | `line` | query | No | Filter by line value |
  | `from` | query | No | Inclusive start time (RFC3339) |
  | `to` | query | No | Inclusive end time (RFC3339) |
  | `limit` | query | No | Total points across all returned sportsbooks (default 1000, max 5000; invalid values use 1000) |
  | `main_line` | query | No | `true` returns only points that were the main line when written (`m` = true) |

  <CodeGroup>
    ```bash Moneyline history from DraftKings theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/events/EVENT_ID/markets/1/history?affiliate_ids=19"
    ```

    ```bash Spread history for a specific participant theme={null}
    curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/events/EVENT_ID/markets/2/history?participant_id=12345"
    ```

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

    resp = requests.get(
        "https://therundown.io/api/v2/events/EVENT_ID/markets/1/history",
        headers={"X-TheRundown-Key": os.environ["THERUNDOWN_API_KEY"]},
        params={"affiliate_ids": "19"}
    )
    chart_data = resp.json()
    ```

    ```javascript Node.js 22+ (server) theme={null}
    const API_KEY = process.env.THERUNDOWN_API_KEY;
    if (!API_KEY) throw new Error("Set THERUNDOWN_API_KEY in the Node.js server environment");
    const resp = await fetch(
      "https://therundown.io/api/v2/events/EVENT_ID/markets/1/history?affiliate_ids=19",
      { headers: { "X-TheRundown-Key": API_KEY } }
    );
    const chartData = await resp.json();
    ```
  </CodeGroup>

  The response has no pagination cursor or truncation flag. Narrow the filters or time window when the total point count reaches `limit`.

  ### Example Response

  The chart-optimized response groups data points into `series` keyed by affiliate ID and orders points oldest first. Each point uses shorthand fields: `t` (timestamp), `l` (line value), `p` (price), `m` (main-line flag, always present), and optional `c` (closed-at timestamp). A series can include multiple participants and line values: use the public canonical `participant_id` to select a side, `line` to pin one value, or both. `main_line=true` alone does not isolate a participant side.

  ```json theme={null}
  {
    "meta": {
      "event_id": "401584701-d1f2-43e7-b5a6-9c8d7e6f5a4b",
      "market_id": 2,
      "market_name": "Point Spread"
    },
    "series": {
      "19": {
        "affiliate_name": "Affiliate 19",
        "data": [
          { "t": "2026-02-24T14:00:00Z", "l": "-3.5", "p": "-110", "m": true },
          { "t": "2026-02-25T09:15:00Z", "l": "-4.5", "p": "-110", "m": true },
          { "t": "2026-02-26T16:30:00Z", "l": "-4.5", "p": "-108", "m": true }
        ]
      }
    }
  }
  ```
</Accordion>

***

## Available Markets by Sport and Date

You can also discover which markets are available for a sport on a given date:

<CodeGroup>
  ```bash Markets across all sports for a date theme={null}
  curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/sports/markets/2026-02-26"
  ```

  ```bash Markets for NBA on a date (hide closed) theme={null}
  curl -H "X-TheRundown-Key: $THERUNDOWN_API_KEY" "https://therundown.io/api/v2/sports/4/markets/2026-02-26?hide_closed_markets=1"
  ```

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

  resp = requests.get(
      "https://therundown.io/api/v2/sports/4/markets/2026-02-26",
      headers={"X-TheRundown-Key": os.environ["THERUNDOWN_API_KEY"]},
      params={"hide_closed_markets": 1}
  )
  markets = resp.json()
  ```

  ```javascript Node.js 22+ (server) theme={null}
  const API_KEY = process.env.THERUNDOWN_API_KEY;
  if (!API_KEY) throw new Error("Set THERUNDOWN_API_KEY in the Node.js server environment");
  const resp = await fetch(
    "https://therundown.io/api/v2/sports/4/markets/2026-02-26?hide_closed_markets=1",
    { headers: { "X-TheRundown-Key": API_KEY } }
  );
  const markets = await resp.json();
  ```
</CodeGroup>

***

## Market Data Model

Each market in an event response follows this structure:

```json theme={null}
{
  "id": 28401,
  "market_id": 1,
  "period_id": 0,
  "name": "Moneyline",
  "market_description": "Pick the winner of the game",
  "participants": [
    {
      "id": 51,
      "type": "TYPE_TEAM",
      "name": "Cleveland Cavaliers",
      "lines": [
        {
          "id": "a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6",
          "value": "",
          "prices": {
            "19": { "id": "194920001", "price": -145, "is_main_line": true, "updated_at": "2026-02-26T18:30:00Z" }
          }
        }
      ]
    }
  ]
}
```

The `prices` object is keyed by `affiliate_id` (sportsbook). A price value of **0.0001** indicates the line is off the board.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.