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

# 主要赔率

> 获取多个赛事的当前主要赔率。

查询模式：必须提供以下其一：
- `tournamentId`（推荐）
- `fixtureIds`（快速路径）

如果提供 `since`，返回 `changedAt >= since` 的赔率更新。



## OpenAPI

````yaml /zh/api-reference/openapi.json get /fixtures/odds/main
openapi: 3.1.0
info:
  title: 赔率 API v5
  version: 5.0.0
  description: 高性能赔率API，由Valkey + Supabase RPC发现支持。
servers:
  - url: https://v5.oddspapi.io/zh
security:
  - ApiKeyAuth: []
tags:
  - name: common
  - name: fixtures
  - name: fixtures/odds
  - name: futures
  - name: futures/odds
  - name: mapping
  - name: media
  - name: settlement
paths:
  /fixtures/odds/main:
    get:
      tags:
        - fixtures/odds
      summary: 主要赔率
      description: |-
        获取多个赛事的当前主要赔率。

        查询模式：必须提供以下其一：
        - `tournamentId`（推荐）
        - `fixtureIds`（快速路径）

        如果提供 `since`，返回 `changedAt >= since` 的赔率更新。
      operationId: odds_main__lang__fixtures_odds_main_get
      parameters:
        - name: tournamentId
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
          description: Single tournamentId. Required if `fixtureIds` is not provided.
        - name: fixtureIds
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
          description: >-
            Comma/space-separated fixtureIds (fast path). Required if
            `tournamentId` is not provided.
        - name: bookmakers
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
          description: 'Comma/space-separated bookmaker slugs (default: all).'
        - name: since
          in: query
          required: false
          schema:
            anyOf:
              - type: integer
              - type: 'null'
          description: changedAt >= since (ms). If provided, returns also inactive odds.
      responses:
        '200':
          description: Returns an array of fixtures (fixture meta + odds + bookmaker meta).
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/FixtureOddsResponse'
              examples:
                example:
                  summary: Odds by tournament (fixtures list with odds)
                  value:
                    - fixtureId: id1400003160574217
                      status:
                        live: false
                        statusId: 0
                        statusName: Pre-Game
                      sport:
                        sportId: 14
                        sportName: American Football
                      tournament:
                        tournamentId: 31
                        tournamentName: NFL
                        categoryName: USA
                      season:
                        seasonId: null
                        seasonName: null
                        seasonRound: null
                      venue:
                        venueId: null
                        venueName: null
                        venueLocation: null
                      startTime: 1766698200
                      trueStartTime: null
                      trueEndTime: null
                      participants:
                        participant1Id: 4423
                        participant1RotNr: null
                        participant1Name: Minnesota Vikings
                        participant1ShortName: Vikings
                        participant1Abbr: null
                        participant2Id: 4419
                        participant2RotNr: null
                        participant2Name: Detroit Lions
                        participant2ShortName: Lions
                        participant2Abbr: null
                      scores: {}
                      clock:
                        currentPeriod: null
                        currentTime: null
                        remainingTime: null
                        remainingTimeInPeriod: null
                        stopped: null
                      expectedPeriods: 4
                      periodLength: 15
                      externalProviders:
                        betgeniusId: null
                        betradarId: 67432516
                        flashscoreId: hzkPCh9e
                        mollybetId: 2026-01-10,21618,79446
                        oddinId: null
                        opticoddsId: 2026011039A14E46
                        pinnacleId: 1621898317
                        sofascoreId: null
                        lsportsId: null
                        txoddsId: null
                      odds: {}
                      bookmakers:
                        stake:
                          bookmaker: stake
                          bookmakerFixtureId: 46173997-xx-yy
                          fixturePath: null
                          hasOdds: false
                          staleOdds: false
                          staleOddsResponseCode: null
                          suspended: false
                          participantsRotated: false
                          meta: null
                          updatedAt: '2026-01-05T05:16:44.746812+00:00'
        '400':
          $ref: '#/components/responses/ApiError'
        '401':
          $ref: '#/components/responses/ApiError'
        '403':
          $ref: '#/components/responses/ApiError'
        '404':
          $ref: '#/components/responses/ApiError'
        '422':
          $ref: '#/components/responses/ValidationError'
        '429':
          $ref: '#/components/responses/ApiError'
components:
  schemas:
    FixtureOddsResponse:
      allOf:
        - $ref: '#/components/schemas/Fixture'
        - type: object
          properties:
            odds:
              $ref: '#/components/schemas/OddsByBookmaker'
          required:
            - odds
          additionalProperties: true
    Fixture:
      type: object
      properties:
        fixtureId:
          type: string
        status:
          $ref: '#/components/schemas/Status'
        sport:
          $ref: '#/components/schemas/SportRef'
        tournament:
          $ref: '#/components/schemas/TournamentRef'
        season:
          $ref: '#/components/schemas/SeasonRef'
        venue:
          $ref: '#/components/schemas/VenueRef'
        startTime:
          type: integer
        trueStartTime:
          type:
            - string
            - 'null'
        trueEndTime:
          type:
            - string
            - 'null'
        participants:
          $ref: '#/components/schemas/ParticipantsRef'
        scores:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/ScorePeriod'
        clock:
          anyOf:
            - $ref: '#/components/schemas/Clock'
            - type: 'null'
        expectedPeriods:
          type:
            - integer
            - 'null'
        periodLength:
          type:
            - integer
            - 'null'
        externalProviders:
          $ref: '#/components/schemas/ExternalProviders'
        bookmakers:
          type: object
          additionalProperties:
            $ref: '#/components/schemas/BookmakerFixtureMeta'
      required:
        - fixtureId
        - status
        - sport
        - tournament
        - season
        - venue
        - startTime
        - participants
        - scores
        - clock
        - externalProviders
        - bookmakers
      additionalProperties: true
    OddsByBookmaker:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/OddsMap'
    Error:
      type: object
      description: Concrete error format returned by this API (no FastAPI detail wrapper).
      properties:
        error:
          type: integer
          description: HTTP status code
        message:
          type: string
          description: Human-readable error message
        code:
          type: string
          description: Machine-readable reason code
        details:
          description: Optional extra details (string/object/array depending on the error).
      required:
        - error
        - message
      additionalProperties: true
    HTTPValidationError:
      title: HTTPValidationError
      type: object
      properties:
        detail:
          title: Detail
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
    Status:
      type: object
      properties:
        live:
          type: boolean
        statusId:
          type: integer
        statusName:
          type: string
      required:
        - live
        - statusId
        - statusName
      additionalProperties: true
    SportRef:
      type: object
      properties:
        sportId:
          type: integer
        sportName:
          type: string
      required:
        - sportId
        - sportName
      additionalProperties: true
    TournamentRef:
      type: object
      properties:
        tournamentId:
          type: integer
        tournamentName:
          type: string
        categoryName:
          type:
            - string
            - 'null'
      required:
        - tournamentId
        - tournamentName
      additionalProperties: true
    SeasonRef:
      type: object
      properties:
        seasonId:
          type:
            - integer
            - 'null'
        seasonName:
          type:
            - string
            - 'null'
        seasonRound:
          type:
            - integer
            - 'null'
      additionalProperties: true
    VenueRef:
      type: object
      properties:
        venueId:
          type:
            - integer
            - 'null'
        venueName:
          type:
            - string
            - 'null'
        venueLocation:
          type:
            - string
            - 'null'
      additionalProperties: true
    ParticipantsRef:
      type: object
      properties:
        participant1Id:
          type: integer
        participant1RotNr:
          type:
            - integer
            - 'null'
        participant1Name:
          type:
            - string
            - 'null'
        participant1ShortName:
          type:
            - string
            - 'null'
        participant1Abbr:
          type:
            - string
            - 'null'
        participant2Id:
          type: integer
        participant2RotNr:
          type:
            - integer
            - 'null'
        participant2Name:
          type:
            - string
            - 'null'
        participant2ShortName:
          type:
            - string
            - 'null'
        participant2Abbr:
          type:
            - string
            - 'null'
      required:
        - participant1Id
        - participant2Id
      additionalProperties: true
    ScorePeriod:
      type: object
      properties:
        period:
          type: string
        participant1Score:
          type: integer
        participant2Score:
          type: integer
        updatedAt:
          type: string
      required:
        - period
        - participant1Score
        - participant2Score
        - updatedAt
      additionalProperties: true
    Clock:
      type: object
      properties:
        currentPeriod:
          type:
            - string
            - 'null'
        currentTime:
          type:
            - string
            - 'null'
        remainingTime:
          type:
            - string
            - 'null'
        remainingTimeInPeriod:
          type:
            - string
            - 'null'
        stopped:
          type:
            - boolean
            - 'null'
      additionalProperties: true
    ExternalProviders:
      type: object
      additionalProperties: true
    BookmakerFixtureMeta:
      type: object
      properties:
        bookmaker:
          type: string
        bookmakerFixtureId:
          type:
            - string
            - 'null'
        fixturePath:
          type:
            - string
            - 'null'
        hasOdds:
          type: boolean
        staleOdds:
          type: boolean
        staleOddsResponseCode:
          type:
            - integer
            - 'null'
        suspended:
          type: boolean
        participantsRotated:
          type: boolean
        meta:
          type:
            - object
            - 'null'
          additionalProperties: true
        updatedAt:
          type: string
      required:
        - bookmaker
        - hasOdds
        - staleOdds
        - suspended
        - participantsRotated
        - updatedAt
      additionalProperties: true
    OddsMap:
      type: object
      additionalProperties:
        $ref: '#/components/schemas/OddQuote'
    ValidationError:
      title: ValidationError
      type: object
      required:
        - loc
        - msg
        - type
      properties:
        loc:
          title: Location
          type: array
          items:
            anyOf:
              - type: string
              - type: integer
        msg:
          title: Message
          type: string
        type:
          title: Error Type
          type: string
    OddQuote:
      type: object
      properties:
        bookmaker:
          type: string
        outcomeId:
          type: integer
        playerId:
          type: integer
        price:
          type: number
        active:
          type: boolean
        marketActive:
          type:
            - boolean
            - 'null'
        mainLine:
          type:
            - boolean
            - 'null'
        marketId:
          type: integer
        bookmakerMarketId:
          type:
            - string
            - 'null'
        bookmakerOutcomeId:
          type:
            - string
            - 'null'
        bookmakerChangedAt:
          type:
            - int
            - 'null'
        priceFractional:
          type:
            - string
            - 'null'
        priceAmerican:
          type:
            - integer
            - 'null'
        meta:
          type:
            - json
            - 'null'
        limit:
          type:
            - number
            - 'null'
        betslip:
          type:
            - string
            - 'null'
        changedAt:
          type: int
      required:
        - bookmaker
        - outcomeId
        - playerId
        - price
        - active
        - changedAt
      additionalProperties: true
  responses:
    ApiError:
      description: API error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          examples:
            invalid_filters:
              summary: Invalid filters
              value:
                error: 400
                message: Invalid filters.
                reason: invalid_filters
            invalid_api_key:
              summary: Invalid apiKey
              value:
                error: 401
                message: invalid apiKey
                reason: invalid_api_key
            rate_limited:
              summary: Rate limited
              value:
                error: 429
                message: rate limit exceeded
                reason: rate_limited
                retryAfterSec: 1
    ValidationError:
      description: Validation Error (framework-level)
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/HTTPValidationError'
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: query
      name: apiKey
      description: Your API key (query-based auth for v5).

````