> ## 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.

# V2: Get best prices by sport and date

> Get one best open price per event/market/period/participant group on a sport date, with optional ranked alternatives.

## Endpoint details

Get one best open price per event/market/period/participant group on a sport date, with optional ranked alternatives. Authenticate with X-TheRundown-Key (recommended) or key=. Returned books, player props, live periods and data delay respect the subscription. API Starter+ best-lines access is required; history-window restrictions also apply to dated reads. X-Datapoints is the number of returned result rows; repeated prices nested within a bulk best-line row are not counted again. limit caps grouped rows, while sample\_limit caps raw candidate prices read before grouping.

## Example response

Examples are shortened for readability; counts retain the source values.

```json 200 theme={null}
{
  "meta": {
    "source": "db",
    "as_of": "2026-12-05T01:04:00Z",
    "count": 2,
    "sport_id": 4,
    "date": "2026-12-05",
    "date_from": "2026-12-05T00:00:00Z",
    "date_to": "2026-12-05T23:59:59.999999999Z"
  },
  "best_lines": [
    {
      "event_id": "a2f69589bbb5da7ebccd57c2a5acae39",
      "sport_id": 4,
      "market_id": 1,
      "market_participant_id": 40539835,
      "participant_id": 26,
      "participant_type": 1,
      "period_id": 0,
      "line": "Dallas Mavericks",
      "best": {
        "id": 732500694,
        "event_id": "a2f69589bbb5da7ebccd57c2a5acae39",
        "sport_id": 4,
        "affiliate_id": 30,
        "affiliate_name": "Novig",
        "market_id": 1,
        "market_participant_id": 40539835,
        "participant_id": 26,
        "participant_type": 1,
        "period_id": 0,
        "line": "Dallas Mavericks",
        "price": "292.0000",
        "previous_price": "285.0000",
        "implied_probability": 0.25510204081632654,
        "move_bps": 46,
        "is_main_line": true,
        "updated_at": "2026-12-04T21:13:52Z",
        "indexed_at": "2026-12-04T21:13:52Z",
        "liquidity_usd": 188979.42
      },
      "book_count": 26,
      "price_count": 26
    },
    {
      "event_id": "a2f69589bbb5da7ebccd57c2a5acae39",
      "sport_id": 4,
      "market_id": 1,
      "market_participant_id": 40987995,
      "participant_id": 30,
      "participant_type": 1,
      "period_id": 0,
      "line": "San Antonio Spurs",
      "best": {
        "id": 735414042,
        "event_id": "a2f69589bbb5da7ebccd57c2a5acae39",
        "sport_id": 4,
        "affiliate_id": 16,
        "affiliate_name": "Matchbook",
        "market_id": 1,
        "market_participant_id": 40987995,
        "participant_id": 30,
        "participant_type": 1,
        "period_id": 0,
        "line": "San Antonio Spurs",
        "price": "-286.0000",
        "previous_price": "-294.0000",
        "implied_probability": 0.7409326424870466,
        "move_bps": 53,
        "is_main_line": true,
        "updated_at": "2026-12-05T01:02:43Z",
        "indexed_at": "2026-12-05T01:02:43Z"
      },
      "book_count": 26,
      "price_count": 26
    }
  ]
}
```

## Response fields

| Field | Type | Description |
| - | - | - |
| `meta` | object | Response source, freshness, result count and diagnostic metadata. |
| `meta.source` | string | Source used to serve the response. |
| `meta.as_of` | string | Latest included price-update time; the current UTC response time when no price rows contribute. This is not a guaranteed observation or delivery timestamp. |
| `meta.count` | integer | Number of rows returned. |
| `meta.sport_id` | integer | Sport scope for sport/date discovery endpoints. |
| `meta.date` | string | Event date scope. |
| `meta.date_from` | string | UTC lower bound used for the event date scope. |
| `meta.date_to` | string | UTC upper bound used for the event date scope. |
| `meta.window_minutes` | integer | Lookback window used for steamer detection. |
| `meta.stale` | boolean | True when the newest included price update is more than 15 minutes old; quiet books can still have valid unchanged prices. |
| `meta.warnings` | array | Diagnostic notices about fallback reads, unavailable data or the age of the returned prices. Empty results may be accompanied by a warning. |
| `best_lines` | array | One best-price row per matching event/market/period/participant group. |
| `best_lines[].event_id` | string | TheRundown event identifier. |
| `best_lines[].sport_id` | integer | TheRundown sport or league identifier; see the Sports reference. |
| `best_lines[].market_id` | integer | TheRundown market-definition identifier. |
| `best_lines[].market_participant_id` | integer | Identifier of the event-market participant row. |
| `best_lines[].participant_id` | integer | Identifier of the team, player or other selection participant. |
| `best_lines[].participant_type` | integer | Numeric participant-kind identifier, when supplied. |
| `best_lines[].period_id` | integer | Market period identifier; 0 is full game. |
| `best_lines[].line` | string | Best selected line for this event/market/participant selection. |
| `best_lines[].best` | object | Highest-ranked matching open price; omitted when no eligible price is available. |
| `best_lines[].all` | array | Ranked prices for this selection, returned only when include\_all=true. |
| `best_lines[].book_count` | integer | Number of distinct sportsbooks with matching prices. |
| `best_lines[].price_count` | integer | Number of matching price rows considered for this selection. |


## OpenAPI

````yaml openapi.yaml GET /api/v2/sports/{sportID}/odds/best-lines/{date}
openapi: 3.1.0
info:
  title: TheRundown Sports API
  version: 2.0.0
  description: >
    **Resolve the event first.** Ambiguous date, team, player, or timezone? The
    agent asks instead of guessing.


    **Every price carries evidence.** Event, market, affiliate ID, line, and the
    price update time. A fetch time is not freshness.


    **Missing stays missing.** No remembered odds, no synthetic prices, no
    filled gaps.


    **IDs come from the API.** Sports, markets, and affiliates are discovered at
    runtime. Retired affiliates stay out.


    Real-time and historical sports data API: odds, lines, scores and statistics
    across major North American and international sports leagues.


    ## Authentication

    Operations marked keyless do not require an API key. All other operations
    accept the `X-TheRundown-Key` header or the legacy `key` query parameter.
    Prefer a private server-side environment variable and the header; avoid
    exposing credentials in URLs or browser assets.


    ## RapidAPI compatibility

    `/api/v1/v2/*` is an alias of `/api/v2/*` for RapidAPI integrations. These
    aliases use the same V2 handlers and response representations; the canonical
    V2 paths are documented once here.


    ## Off-the-Board Sentinel Value

    The value **0.0001** indicates a line is "off the board": the sportsbook has
    temporarily removed pricing (e.g., pending injury news). This is NOT an
    error. Display as "Off Board" or "N/A" in your UI.


    ## Rate Limiting

    Requests are rate-limited per API key tier. Check response headers for
    current limits.


    ## Data Updates

    - Live odds update in real-time during games

    - Use delta endpoints for efficient polling of changes

    - WebSocket connections available for streaming updates


    ## V1 vs V2

    V2 endpoints use market-based data structures (market_id, participants, line
    prices). V1 endpoints use legacy line-based structures (moneyline, spread,
    total objects). V2 is recommended for new integrations.
  contact:
    name: TheRundown API Support
    url: https://therundown.io
    email: support@therundown.io
  termsOfService: https://therundown.io/terms
servers:
  - url: https://therundown.io
    description: Production
security:
  - ApiKeyHeader: []
tags:
  - name: V2 Sports
    description: Sport listings, dates, and teams (V2)
  - name: V2 Events
    description: Events with market-based odds (V2)
  - name: V2 Markets
    description: Market definitions, odds, deltas, and history (V2)
  - name: V2 Futures
    description: >-
      Futures/outright competition events: championship and tournament-winner
      boards (V2, early access)
  - name: V2 Teams
    description: Team data, players, and stats (V2)
  - name: V2 Players
    description: Player data (V2)
  - name: V2 Stats
    description: Team and player statistics (V2)
  - name: V2 WebSocket
    description: Real-time streaming via WebSocket (V2)
  - name: V2 Reference
    description: 'Reference data: affiliates, sportsbooks, season types (V2)'
  - name: V1 Events
    description: Events with line-based odds (V1 legacy)
  - name: V1 Lines
    description: Moneyline, spread, total, best-line endpoints (V1 legacy)
  - name: V1 Sports
    description: Sport listings, dates, events, schedules (V1 legacy)
  - name: V1 Delta
    description: Delta/change feeds (V1 legacy)
  - name: V1 Reference
    description: Reference data (V1 legacy)
  - name: V1 WebSocket
    description: Real-time streaming via WebSocket (V1 legacy)
  - name: V2 Odds
    description: Best prices, line movement, consensus and same-book parlay calculations.
  - name: V2 Promotions
    description: Source-reported sportsbook odds boosts and promotions.
  - name: V2 Public
    description: Allowlisted keyless delayed and cached public data.
externalDocs:
  description: Build with AI guide
  url: https://therundown.io/build-with-ai
paths:
  /api/v2/sports/{sportID}/odds/best-lines/{date}:
    get:
      tags:
        - V2 Odds
      summary: Get best prices by sport and date
      description: >-
        Get one best open price per event/market/period/participant group on a
        sport date, with optional ranked alternatives. Authenticate with
        X-TheRundown-Key (recommended) or key=. Returned books, player props,
        live periods and data delay respect the subscription. API Starter+
        best-lines access is required; history-window restrictions also apply to
        dated reads. X-Datapoints is the number of returned result rows;
        repeated prices nested within a bulk best-line row are not counted
        again. limit caps grouped rows, while sample_limit caps raw candidate
        prices read before grouping.
      operationId: v2GetBestOddsBySportAndDate
      parameters:
        - name: odds_format
          in: query
          required: false
          description: >-
            Odds representation for REST prices. Absent or american preserves
            the existing response. Fractional odds are reduced ratio strings;
            decimal and probability retain each source field's number/string
            type. Probability is a 0..1 fraction. Off-board placeholders
            (including 0 and 0.0001), nulls and nonnumeric sentinel strings stay
            unchanged. Numeric values with absolute value below 100 are not
            converted. Price-delta fields retain American-point difference
            units. Empty, repeated or unsupported values return 400. WebSockets
            are unchanged.
          schema:
            type: string
            default: american
            enum:
              - american
              - decimal
              - fractional
              - probability
          example: decimal
        - name: sportID
          in: path
          required: true
          description: Sport ID.
          schema:
            type: integer
        - name: date
          in: path
          required: true
          description: Event date in YYYY-MM-DD format or Unix epoch timestamp.
          schema:
            type: string
          example: '2026-05-29'
        - name: market_id
          in: query
          required: true
          description: Market ID to price.
          schema:
            type: integer
        - name: period_id
          in: query
          description: Market period. Defaults to the full-game period.
          schema:
            type: integer
            default: 0
        - name: participant_id
          in: query
          description: Optional participant to price across all events on the date.
          schema:
            type: integer
        - name: participant_type
          in: query
          description: Participant type identifier.
          schema:
            type: integer
        - name: market_participant_id
          in: query
          description: Exact market participant row to price.
          schema:
            type: integer
            format: int64
        - name: side
          in: query
          description: >-
            Use over or under to rank total-style markets by bettor-favorable
            line before price.
          schema:
            type: string
            enum:
              - over
              - under
        - name: line
          in: query
          description: >-
            Exact line to match. Omit to rank main lines by bettor-favorable
            line, then price.
          schema:
            type: string
        - name: include_alternates
          in: query
          description: Include alternate and extended lines in the ranking pool.
          schema:
            type: boolean
            default: false
        - name: affiliate_ids
          in: query
          description: Comma-separated sportsbook affiliate IDs to include.
          schema:
            type: string
          example: 1,2,3
        - name: include_all
          in: query
          description: Include ranked matching prices under each best-line row.
          schema:
            type: boolean
            default: false
        - name: all_limit
          in: query
          description: Maximum ranked prices per best-line row when include_all=true.
          schema:
            type: integer
            minimum: 1
            maximum: 25
            default: 5
        - name: sample_limit
          in: query
          description: Maximum raw price rows to inspect before grouping.
          schema:
            type: integer
            minimum: 1
            maximum: 20000
            default: 10000
        - name: limit
          in: query
          description: Maximum best-line rows to return.
          schema:
            type: integer
            minimum: 1
            maximum: 1000
            default: 250
        - name: offset
          in: query
          required: false
          description: >-
            Minutes from UTC used to interpret the requested date; defaults to
            0.
          schema:
            type: integer
            default: 0
      responses:
        '200':
          description: >-
            Successful response. Arrays may be empty when no eligible records
            match.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestNewBulkBestLineResponse'
              example:
                meta:
                  source: db
                  as_of: '2026-12-05T01:04:00Z'
                  count: 2
                  sport_id: 4
                  date: '2026-12-05'
                  date_from: '2026-12-05T00:00:00Z'
                  date_to: '2026-12-05T23:59:59.999999999Z'
                best_lines:
                  - event_id: a2f69589bbb5da7ebccd57c2a5acae39
                    sport_id: 4
                    market_id: 1
                    market_participant_id: 40539835
                    participant_id: 26
                    participant_type: 1
                    period_id: 0
                    line: Dallas Mavericks
                    best:
                      id: 732500694
                      event_id: a2f69589bbb5da7ebccd57c2a5acae39
                      sport_id: 4
                      affiliate_id: 30
                      affiliate_name: Novig
                      market_id: 1
                      market_participant_id: 40539835
                      participant_id: 26
                      participant_type: 1
                      period_id: 0
                      line: Dallas Mavericks
                      price: '292.0000'
                      previous_price: '285.0000'
                      implied_probability: 0.25510204081632654
                      move_bps: 46
                      is_main_line: true
                      updated_at: '2026-12-04T21:13:52Z'
                      indexed_at: '2026-12-04T21:13:52Z'
                      liquidity_usd: 188979.42
                    book_count: 26
                    price_count: 26
                  - event_id: a2f69589bbb5da7ebccd57c2a5acae39
                    sport_id: 4
                    market_id: 1
                    market_participant_id: 40987995
                    participant_id: 30
                    participant_type: 1
                    period_id: 0
                    line: San Antonio Spurs
                    best:
                      id: 735414042
                      event_id: a2f69589bbb5da7ebccd57c2a5acae39
                      sport_id: 4
                      affiliate_id: 16
                      affiliate_name: Matchbook
                      market_id: 1
                      market_participant_id: 40987995
                      participant_id: 30
                      participant_type: 1
                      period_id: 0
                      line: San Antonio Spurs
                      price: '-286.0000'
                      previous_price: '-294.0000'
                      implied_probability: 0.7409326424870466
                      move_bps: 53
                      is_main_line: true
                      updated_at: '2026-12-05T01:02:43Z'
                      indexed_at: '2026-12-05T01:02:43Z'
                    book_count: 26
                    price_count: 26
          headers:
            X-Datapoints:
              description: Billable result count for this response, as described above.
              schema:
                type: integer
                minimum: 0
        '400':
          description: >-
            Invalid required parameter, malformed JSON or an unsupported
            odds_format.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestNewError'
              example:
                error: market_id is required
        '401':
          description: Missing, invalid or revoked API credential.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestNewUnauthorized'
              example:
                message: unauthorized
        '403':
          description: >-
            The plan does not include the requested feature/date, or account
            access is blocked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestNewForbidden'
              example:
                error: Best lines require Starter plan or higher
                upgrade_url: /pricing/api
        '429':
          description: >-
            Request-rate or data-point allowance exceeded. Error metadata
            depends on the exhausted allowance; Retry-After is supplied when
            applicable.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestNewRateLimit'
              example:
                error: Rate limit exceeded
                limit: 10
          headers:
            Retry-After:
              description: Seconds until the request may be retried.
              schema:
                type: integer
        '500':
          description: Unexpected JSON encoding error or failed requested odds conversion.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestNewError'
              example:
                error: json encoding error
        '503':
          description: >-
            Enabled-book membership changed repeatedly during this response;
            retry.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RestNewError'
              example:
                error: >-
                  affiliate visibility changed while reading response; retry
                  request
      security:
        - ApiKeyHeader: []
        - ApiKeyQuery: []
components:
  schemas:
    RestNewBulkBestLineResponse:
      type: object
      properties:
        meta:
          $ref: '#/components/schemas/RestNewOddsDiscoveryMeta'
          description: Response source, freshness, result count and diagnostic metadata.
        best_lines:
          type: array
          items:
            $ref: '#/components/schemas/RestNewBulkBestLineRow'
          description: >-
            One best-price row per matching event/market/period/participant
            group.
      description: BulkBestLine response.
    RestNewError:
      type: object
      properties:
        error:
          type: string
          description: Human-readable explanation of why the request failed.
      description: Error.
    RestNewUnauthorized:
      type: object
      properties:
        message:
          type: string
          description: Human-readable authentication or request failure message.
      description: Unauthorized.
    RestNewForbidden:
      type: object
      properties:
        error:
          type: string
          description: Human-readable explanation of why the request failed.
        upgrade_url:
          type: string
          description: Relative URL of the appropriate plan or account upgrade page.
      description: Forbidden.
    RestNewRateLimit:
      type: object
      properties:
        error:
          type: string
          description: Human-readable explanation of why the request failed.
        limit:
          type: integer
          description: >-
            Maximum number of result rows requested or the allowance that was
            exceeded, as described by the containing response.
        used:
          type: integer
          description: Data points already used in the applicable allowance period.
        period:
          type: string
          description: Billing or allowance period identifier.
        required_tier:
          type: string
          description: Minimum suggested tier for the rejected request.
        upgrade_url:
          type: string
          description: Relative URL of the appropriate plan or account upgrade page.
        upgrade_message:
          type: string
          description: >-
            Human-readable description of the allowance or feature available on
            an upgraded plan.
      description: RateLimit.
    RestNewOddsDiscoveryMeta:
      type: object
      properties:
        source:
          type: string
          description: Source used to serve the response.
          example: redis
        as_of:
          type: string
          format: date-time
          description: >-
            Latest included price-update time; the current UTC response time
            when no price rows contribute. This is not a guaranteed observation
            or delivery timestamp.
        count:
          type: integer
          description: Number of rows returned.
        sport_id:
          type: integer
          description: Sport scope for sport/date discovery endpoints.
        date:
          type: string
          format: date
          description: Event date scope.
        date_from:
          type: string
          format: date-time
          description: UTC lower bound used for the event date scope.
        date_to:
          type: string
          format: date-time
          description: UTC upper bound used for the event date scope.
        window_minutes:
          type: integer
          description: Lookback window used for steamer detection.
        stale:
          type: boolean
          description: >-
            True when the newest included price update is more than 15 minutes
            old; quiet books can still have valid unchanged prices.
        warnings:
          type: array
          items:
            type: string
          description: >-
            Diagnostic notices about fallback reads, unavailable data or the age
            of the returned prices. Empty results may be accompanied by a
            warning.
      description: Response source, freshness, result count and diagnostic metadata.
    RestNewBulkBestLineRow:
      type: object
      properties:
        event_id:
          type: string
          description: TheRundown event identifier.
        sport_id:
          type: integer
          description: TheRundown sport or league identifier; see the Sports reference.
        market_id:
          type: integer
          description: TheRundown market-definition identifier.
        market_participant_id:
          type: integer
          format: int64
          description: Identifier of the event-market participant row.
        participant_id:
          type: integer
          description: Identifier of the team, player or other selection participant.
        participant_type:
          type: integer
          description: Numeric participant-kind identifier, when supplied.
        period_id:
          type: integer
          description: Market period identifier; 0 is full game.
        line:
          type: string
          description: Best selected line for this event/market/participant selection.
        best:
          $ref: '#/components/schemas/RestNewOddsPrice'
          description: >-
            Highest-ranked matching open price; omitted when no eligible price
            is available.
        all:
          type: array
          description: >-
            Ranked prices for this selection, returned only when
            include_all=true.
          items:
            $ref: '#/components/schemas/RestNewOddsPrice'
        book_count:
          type: integer
          description: Number of distinct sportsbooks with matching prices.
        price_count:
          type: integer
          description: Number of matching price rows considered for this selection.
      description: >-
        A selection group and its best current price, with optional ranked
        matches.
    RestNewOddsPrice:
      type: object
      properties:
        id:
          type: integer
          format: int64
          description: >-
            Identifier of this price record. Keep it unchanged when linking to
            the corresponding history resource.
        event_id:
          type: string
          description: TheRundown event identifier.
        sport_id:
          type: integer
          description: TheRundown sport or league identifier; see the Sports reference.
        affiliate_id:
          type: integer
          description: TheRundown sportsbook or exchange affiliate identifier.
        affiliate_name:
          type: string
          description: Display name of the sportsbook or exchange.
        market_id:
          type: integer
          description: TheRundown market-definition identifier.
        market_participant_id:
          type: integer
          format: int64
          description: Identifier of the event-market participant row.
        participant_id:
          type: integer
          description: Identifier of the team, player or other selection participant.
        participant_type:
          type: integer
          description: Numeric participant-kind identifier, when supplied.
        period_id:
          type: integer
          description: Market period identifier; 0 is full game.
        line:
          type: string
          description: >-
            Stored line value or selection label. Exact-line filters compare
            this string after trimming surrounding whitespace.
        price:
          type: string
          description: >-
            Current quoted odds, American by default; odds_format can return
            decimal, fractional or probability representations.
          example: '-110'
        previous_price:
          type: string
          description: >-
            Previous recorded price, when available; represented in the
            requested odds format.
        implied_probability:
          type: number
          format: double
          description: >-
            Raw implied win probability calculated from the price, as a fraction
            from 0 to 1.
        move_bps:
          type: integer
          format: int64
          description: Absolute implied-probability movement in basis points.
        is_main_line:
          type: boolean
          description: >-
            Whether this is the source book’s current main line for the
            selection.
        updated_at:
          type: string
          format: date-time
          description: UTC timestamp of the source price update.
        closed_at:
          type: string
          format: date-time
          description: Timestamp when closed. Omitted while open.
        indexed_at:
          type: string
          format: date-time
          description: >-
            UTC time the price document was indexed for odds discovery, when
            supplied.
        liquidity_usd:
          type: number
          description: >-
            Approximate USD resting-order depth reported by the venue
            (exchange-style sources only: Kalshi, Polymarket). Omitted entirely
            — never explicit null — when the venue does not report liquidity,
            which is every traditional sportsbook today.
          example: 4210.5
      description: >-
        One eligible sportsbook or exchange price with selection identity and
        timestamps.
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-TheRundown-Key
      description: Recommended API key request header for new integrations
    ApiKeyQuery:
      type: apiKey
      in: query
      name: key
      description: >-
        API key as query parameter. Deprecated for new integrations; retained
        for existing integrations.
      x-deprecated: true

````

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