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

# レース一覧

> 開催日や競馬場を指定してレース一覧を取得します。`include`パラメータで出走馬や払戻情報を一括取得可能です。



## OpenAPI

````yaml /reference/openapi.json get /races
openapi: 3.1.0
info:
  title: BeTerKEIBA Core API
  description: >-
    JV-Data をベースとした競馬データ配信プラットフォーム。Cloudflare Workers (Hono), D1,
    R2を組み合わせたモダンなアーキテクチャで構築されています。


    ### 特徴

    - **高速レスポンス**: Cloudflareのエッジネットワークによる低レイテンシ。

    - **完全なデータ構造**: 産駒から現役、オッズ、マイニングまで網羅。

    - **開発者フレンドリー**: MintlifyドキュメントとTypeScript SDKによる高い開発効率
  version: 1.0.0
servers:
  - url: https://api.beter-keiba.com/v1
    description: 本番環境
security:
  - bearerAuth: []
tags:
  - name: Races
    description: レースデータ。開催情報・出走表・結果など、レース単位で取得する正規データ
  - name: Odds
    description: オッズデータ。単勝・複勝・枠連・馬連・ワイド・馬単・3連複・3連単の確定オッズおよび最終オッズ
  - name: Masters
    description: マスタデータ。競走馬・騎手・調教師・生産者・馬主・繁殖牝馬といった静的な実体情報
  - name: Updates
    description: 更新データ。スケジュール・調教・WIN5・予想指数など、随時更新が発生する派生データ
paths:
  /races:
    get:
      tags:
        - Races
      summary: レース一覧
      description: 開催日や競馬場を指定してレース一覧を取得します。`include`パラメータで出走馬や払戻情報を一括取得可能です。
      operationId: listRaces
      parameters:
        - $ref: '#/components/parameters/date'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/to'
        - name: courseCode
          in: query
          schema:
            $ref: '#/components/schemas/CourseCode'
        - name: gradeCode
          in: query
          schema:
            $ref: '#/components/schemas/GradeCode'
        - name: typeCode
          in: query
          schema:
            $ref: '#/components/schemas/TypeCode'
        - name: signCode
          in: query
          schema:
            $ref: '#/components/schemas/SignCode'
        - name: trackCode
          in: query
          schema:
            $ref: '#/components/schemas/TrackCode'
        - name: distance
          in: query
          schema:
            type: string
            pattern: ^[0-9]{3,5}$
            maxLength: 5
          description: '距離 (例: 1800、3〜5 桁の数値文字列)'
        - $ref: '#/components/parameters/include'
        - $ref: '#/components/parameters/fields'
        - $ref: '#/components/parameters/limit'
        - $ref: '#/components/parameters/page'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Race'
              example:
                code: SUCCESS
                data:
                  - id: ra_2024052605021211
                    dataType: '2'
                    dataUpdatedAt: 1716715200
                    raceYear: 2024
                    raceDate: '0526'
                    courseCode: '05'
                    meetingNumber: 2
                    meetingDay: 12
                    raceNumber: 11
                    dayOfWeekCode: '1'
                    specialRaceNumber: '0000'
                    title: 東京優駿
                    subTitle: （日本ダービー）
                    titleAppendix: （ＧＩ）
                    titleEnglish: TOKYO YUSHUN
                    titleEnglishSub: JAPANESE DERBY
                    titleEnglishParen: G1
                    titleClassification: '1'
                    titleShort10: 日本ダービー
                    titleShort6: ダービー
                    titleShort3: ダービー
                    gradeCode: A
                    gradeChangedFrom: A
                    gradeCount: 91
                    typeCode: '14'
                    signCode: A41
                    weightTypeCode: '4'
                    condition2Yo: '000'
                    condition3Yo: '001'
                    condition4Yo: '000'
                    condition5YoUp: '000'
                    conditionYoungest: '001'
                    distance: 2400
                    distanceChangedFrom: 0
                    trackCode: '17'
                    trackChangedFrom: '17'
                    courseSubset: A
                    courseSubsetChangedFrom: ''
                    prizes:
                      - 300000000
                      - 120000000
                      - 75000000
                      - 45000000
                      - 30000000
                    prizesChangedFrom:
                      - 300000000
                      - 90000000
                      - 90000000
                      - 45000000
                      - 30000000
                    addedPrizes:
                      - 45122000
                      - 12892000
                      - 6446000
                    addedPrizesChangedFrom:
                      - 40000000
                      - 12000000
                      - 6000000
                    postTime: '1540'
                    postTimeChangedFrom: '1540'
                    entryCount: 18
                    starterCount: 18
                    finisherCount: 18
                    weatherCode: '1'
                    turfConditionCode: '1'
                    dirtConditionCode: '1'
                    lapTimes:
                      - 12.2
                      - 10.8
                      - 11.3
                      - 12.1
                      - 12.6
                      - 12.7
                      - 12.5
                      - 11.7
                      - 11.3
                      - 11.1
                      - 11.2
                      - 11.5
                    first3FTime: 34.3
                    first4FTime: 46.4
                    last3FTime: 33.8
                    last4FTime: 45
                    cornerPassingOrder:
                      - corner: 1
                        lap: 1
                        order: 15-2,5(3,7,12)(1,8,11,14)(4,13,17)-6,16,18-9-10
                    isRecordBreak: 0
                    payout:
                      raceId: ra_2024052605021211
                      dataType: '2'
                      dataUpdatedAt: 1716715200
                      entryCount: 18
                      starterCount: 18
                      flags:
                        failed:
                          win: false
                          place: false
                          bracketQuinella: false
                          quinella: false
                          wide: false
                          exacta: false
                          trio: false
                          trifecta: false
                        special:
                          win: false
                          place: false
                          bracketQuinella: false
                          quinella: false
                          wide: false
                          exacta: false
                          trio: false
                          trifecta: false
                        refund:
                          win: false
                          place: false
                          bracketQuinella: false
                          quinella: false
                          wide: false
                          exacta: false
                          trio: false
                          trifecta: false
                      refundHorseNumbers: []
                      refundBracketNumbers: []
                      refundSameBracketNumbers: []
                      win:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      place:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      bracketQuinella:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      quinella:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      wide:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      exacta:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      trio:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      trifecta:
                        - numbers: '5'
                          payout: 4660
                          popularity: 9
                      createdAt: 1716716000
                      updatedAt: 1716716000
                    createdAt: 1716716000
                    updatedAt: 1716716000
                extensions:
                  totalCount: 1
                  limit: 50
                  page: 1
                  totalPages: 1
                  dataUpdatedAt: 1716715200
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '500':
          $ref: '#/components/responses/InternalServerError'
components:
  parameters:
    date:
      name: date
      in: query
      schema:
        type: string
        format: date
      description: 指定した日で絞り込み
      example: '2026-04-18'
    from:
      name: from
      in: query
      schema:
        type: string
        format: date
      description: 期間指定（開始）
      example: '2026-04-01'
    to:
      name: to
      in: query
      schema:
        type: string
        format: date
      description: 期間指定（終了）
      example: '2026-04-30'
    include:
      name: include
      in: query
      schema:
        type: string
        maxLength: 200
      description: |-
        関連データをネストして取得します（カンマ区切り）。

        **利用可能なリレーション:**
        - **Race**: `payout` 
        - **RaceEntry**: `jockey`, `trainer`, `owner`, `foal`, `training` 
        - **Horse**: `trainer`, `owner`, `breeder`, `foal`, `form`, `training` 
      example: jockey,trainer
    fields:
      name: fields
      in: query
      schema:
        type: string
        maxLength: 500
      description: 取得するフィールドの絞り込み（カンマ区切り）
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 100
        minimum: 1
        maximum: 1000
      description: 1リクエストあたりの最大取得件数 (1 以上 1000 以下)
    page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
        minimum: 1
        maximum: 10000
      description: ページ番号 (1 以上 10000 以下)
  schemas:
    CourseCode:
      type: string
      description: |-
        競馬場および国コード。JRA、地方競馬(NAR)、海外を網羅します。

        ### 主要なコード一覧

        | コード | 競馬場・国名 | 略称 | 英語 |
        | :--- | :--- | :--- | :--- |
        | 01 | 札幌競馬場 | 札幌 | SAPPORO |
        | 02 | 函館競馬場 | 函館 | HAKODATE |
        | 03 | 福島競馬場 | 福島 | FUKUSHIMA |
        | 04 | 新潟競馬場 | 新潟 | NIIGATA |
        | 05 | 東京競馬場 | 東京 | TOKYO |
        | 06 | 中山競馬場 | 中山 | NAKAYAMA |
        | 07 | 中京競馬場 | 中京 | CHUKYO |
        | 08 | 京都競馬場 | 京都 | KYOTO |
        | 09 | 阪神競馬場 | 阪神 | HANSHIN |
        | 10 | 小倉競馬場 | 小倉 | KOKURA |
        | 30〜57 | 地方競馬場 | - | - |
        | 58〜61 | 地方競馬場（中央併設） | - | - |
        | A0〜N6 | 海外の国・地域 | - | - |

        **海外主要国例:**
        - `A2`: 日本 (Japan)
        - `A4`: アメリカ (USA)
        - `A6`: イギリス (GB)
        - `A8`: フランス (FR)
        - `G0`: 香港 (HK)
        - `C7`: UAE (UAE)

        ※全コードの詳細はJV-Data仕様に準拠します。未設定時は `00` が返ります。
      enum:
        - '00'
        - '01'
        - '02'
        - '03'
        - '04'
        - '05'
        - '06'
        - '07'
        - '08'
        - '09'
        - '10'
        - '30'
        - '31'
        - '32'
        - '33'
        - '34'
        - '35'
        - '36'
        - '37'
        - '38'
        - '39'
        - '40'
        - '41'
        - '42'
        - '43'
        - '44'
        - '45'
        - '46'
        - '47'
        - '48'
        - '49'
        - '50'
        - '51'
        - '52'
        - '53'
        - '54'
        - '55'
        - '56'
        - '57'
        - '58'
        - '59'
        - '60'
        - '61'
        - A0
        - A2
        - A4
        - A6
        - A8
        - B0
        - B2
        - B4
        - B6
        - B8
        - C0
        - C2
        - C5
        - C6
        - C7
        - C8
        - D0
        - D2
        - D4
        - D6
        - D8
        - E0
        - E2
        - E4
        - E6
        - E8
        - F0
        - F1
        - F2
        - F8
        - G0
        - G2
        - H0
        - H2
        - H4
        - H6
        - H8
        - I0
        - I2
        - I4
        - I6
        - I8
        - J0
        - J2
        - J4
        - J6
        - J8
        - K0
        - K2
        - K4
        - K6
        - K8
        - L0
        - L2
        - L4
        - L6
        - L8
        - M0
        - M2
        - M4
        - M6
        - M8
        - N0
        - N2
        - N4
        - N6
      example: '05'
      maxLength: 2
    GradeCode:
      type: string
      description: |-
        競走のグレードを表すコード。

        | コード | 内容 | 欧字表記 |
        | :--- | :--- | :--- |
        | A | G1（平地） | G1 |
        | B | G2（平地） | G2 |
        | C | G3（平地） | G3 |
        | D | グレードのない重賞 | - |
        | E | 重賞以外の特別競走 | - |
        | F | J・G1（障害） | J・G1 |
        | G | J・G2（障害） | J・G2 |
        | H | J・G3（障害） | J・G3 |
        | L | L（リステッド） | L |
        | _ | 一般競走 または 未設定 | - |

        ※ `_` は半角スペース(0x20)をアンダースコアに置換しています。
      enum:
        - A
        - B
        - C
        - D
        - E
        - F
        - G
        - H
        - L
        - _
      x-fern-enum:
        _:
          name: Open
          description: 一般競走 または 未設定 (元の JV-Data コードは半角スペース 0x20)
      example: A
      maxLength: 1
    TypeCode:
      type: string
      description: |-
        競走の年齢・品種種別を表すコード。

        | コード | 名称 | 略称(6文字) | 欧字名 |
        | :--- | :--- | :--- | :--- |
        | 11 | サラ系2歳 | サラ系2歳 | TWO-YEAR-OLDS |
        | 12 | サラ系3歳 | サラ系3歳 | THREE-YEAR-OLDS |
        | 13 | サラ系3歳以上 | サラ系3歳上 | THREE-YEAR-OLDS & UP |
        | 14 | サラ系4歳以上 | サラ系4歳上 | FOUR-YEAR-OLDS & UP |
        | 18 | サラ系障害3歳以上 | 障害3歳上 | THREE-YEAR-OLDS & UP STEEPLE-CHASE |
        | 19 | サラ系障害4歳以上 | 障害4歳上 | FOUR-YEAR-OLDS & UP STEEPLE-CHASE |
        | 21 | アラブ系2歳 | アラ系2歳 | - |
        | 22 | アラブ系3歳 | アラ系3歳 | - |
        | 23 | アラブ系3歳以上 | アラ系3歳上 | - |
        | 24 | アラブ系4歳以上 | アラ系4歳上 | - |
        | 00 | 未設定 | 未設定 | - |

        ※2000年以前のデータは「数え年」表記のため、上記名称より年齢が1つ上がります（例: 11はサラ系3歳）
      enum:
        - '11'
        - '12'
        - '13'
        - '14'
        - '18'
        - '19'
        - '21'
        - '22'
        - '23'
        - '24'
        - '00'
      example: '14'
      maxLength: 2
    SignCode:
      type: string
      description: >-
        競走の条件（産地・性別・交流制限など）を表す3バイトのコード。JV-Data 仕様書「2006.競走記号コード」に準拠。


        ### コードの構成

        このコードは3バイトで構成され、各バイトが独立した属性を表します。


        | バイト | 属性 | 値の範囲 |

        | :--- | :--- | :--- |

        | 第1バイト | 産地・購買条件等 | `0` (下記以外) / `A` (混合) / `B` (父) / `C` (市) / `D` (抽)
        / `E` ([抽]) / `F` ((市)(抽)) / `G` ((抽) 関西配布馬) / `H` ((抽) 関東配布馬) / `I`
        ([抽] 関西配布馬) / `J` ([抽] 関東配布馬) / `K` ((市)(抽) 関西配布馬) / `L` ((市)(抽) 関東配布馬)
        / `M` (九州産馬) / `N` ((国際)) |

        | 第2バイト | 性別制限 | `0` (制限なし) / `1` (牡) / `2` (牝) / `3` (牡・ｾﾝ) / `4` (牡・牝)
        |

        | 第3バイト | 交流競走関係等 | `0` (下記以外) / `1` ((指定)) / `2` (見習騎手・若手騎手) / `3`
        ([指定]) / `4` ((特指)) |


        ### 主要な記号の意味

        | 記号 | 内容 |

        | :--- | :--- |

        | (混合) | 内国産馬に外国産馬が混合して出走できる競走 |

        | (国際) | 内国産馬に外国産馬および海外出走歴のある馬が混合して出走できる競走 |

        | (指定) | JRA指定の地方競馬所属馬が出走可能 |

        | [指定] | 地方競馬所属の騎手が騎乗可能 |

        | (特指) | 地方競馬の認定競走勝ち馬が出走可能 |

        | (抽) | JRA が市場で購買し抽選で馬主に配布したサラブレッド系内国産馬 |


        ### 代表的なコード例

        | コード | 内容 |

        | :--- | :--- |

        | `000` | 制限なし (一般) |

        | `020` | 牝 |

        | `040` | 牡・牝 |

        | `A00` | (混合) |

        | `A40` | (混合) 牡・牝 |

        | `A41` | (混合) 牡・牝 (指定) |

        | `N00` | (国際) |

        | `N01` | (国際) (指定) |

        | `N44` | (国際) 牡・牝 (特指) |


        ※未設定時は `000` が返ります。
      enum:
        - '000'
        - '001'
        - '002'
        - '003'
        - '004'
        - '020'
        - '021'
        - '023'
        - '024'
        - '030'
        - '031'
        - '033'
        - '034'
        - '040'
        - '041'
        - '043'
        - '044'
        - A00
        - A01
        - A02
        - A03
        - A04
        - A10
        - A11
        - A13
        - A14
        - A20
        - A21
        - A23
        - A24
        - A30
        - A31
        - A33
        - A34
        - A40
        - A41
        - B00
        - B01
        - B03
        - B04
        - C00
        - C01
        - C03
        - C04
        - D00
        - D01
        - D03
        - E00
        - E01
        - E03
        - F00
        - F01
        - F03
        - F04
        - G00
        - G01
        - G03
        - H00
        - H01
        - I00
        - I01
        - I03
        - J00
        - J01
        - K00
        - K01
        - K03
        - L00
        - L01
        - L03
        - M00
        - M01
        - M03
        - M04
        - N00
        - N01
        - N03
        - N04
        - N20
        - N21
        - N23
        - N24
        - N30
        - N31
        - N40
        - N41
        - N44
      example: A41
      maxLength: 3
    TrackCode:
      type: string
      description: |-
        コースの種類と形状を表すコード。 

        ### 分類ガイド
        - **10番台**: 芝 (Turf)
        - **20番台**: ダート (Dirt)
        - **50番台**: サンド (Sand)
        - **00/29**: 障害・特殊

        ### 主要なコード一覧
        | コード | 内容 | 欧字表記 | 
        | :--- | :--- | :--- | 
        | 10 | 芝・直 | Turf Str. |
        | 11 | 芝・左 | Turf |
        | 12 | 芝・左外 | Turf |
        | 17 | 芝・右 | Turf |
        | 18 | 芝・右外 | Turf |
        | 24 | ダート・右 | Dirt |
        | 25 | ダート・左 | Dirt |
        | 29 | ダート・直 | Dirt Str. |
        | 52 | サンド・右 | Sand |
        | 55 | サンド・左 | Sand |
        | 00 | 未設定 | - |

        ※詳細はJV-Data仕様書「2009.トラックコード」を参照してください
      enum:
        - '00'
        - '10'
        - '11'
        - '12'
        - '13'
        - '14'
        - '15'
        - '16'
        - '17'
        - '18'
        - '19'
        - '20'
        - '21'
        - '22'
        - '23'
        - '24'
        - '25'
        - '26'
        - '27'
        - '28'
        - '29'
        - '51'
        - '52'
        - '53'
        - '54'
        - '55'
        - '56'
        - '57'
        - '58'
        - '59'
      example: '17'
      maxLength: 2
    SuccessResponse:
      type: object
      description: >-
        成功レスポンスの共通ラッパー。code は常に "SUCCESS"、data にエンドポイント固有のレスポンスボディ、extensions
        に補助情報 (pagination や統計など) を含みます。
      required:
        - code
        - data
      properties:
        code:
          type: string
          description: 処理結果コード。成功時は常に 'SUCCESS'
          example: SUCCESS
        data:
          description: 取得されたデータ本体
        extensions:
          $ref: '#/components/schemas/ResponseExtensions'
    Race:
      type: object
      description: >-
        レースの基本情報および結果詳細。


        `condition2Yo` / `condition3Yo` / `condition4Yo` / `condition5YoUp` /
        `conditionYoungest` の 5 列は、それぞれ 2歳・3歳・4歳・5歳以上・最若年の競走条件 (JV-Data RA レコード
        #28-#32 由来) を表し、いずれも `RaceConditionCode` で定義された同一の値空間を取ります。
      required:
        - id
        - dataType
        - raceYear
        - raceDate
        - courseCode
        - raceNumber
        - title
        - distance
      properties:
        id:
          $ref: '#/components/schemas/RaceId'
        dataType:
          type: string
          description: >-
            データ区分。1:出走馬名表(木曜), 2:出馬表(金・土曜), 3:速報成績(3着まで確定), 4:速報成績(5着まで確定),
            5:速報成績(全馬着順確定), 6:速報成績(全馬着順+コーナ通過順), 7:成績(月曜), A:地方競馬, B:海外国際レース,
            9:レース中止, 0:該当レコード削除(提供ミスなどの理由による)
          example: '2'
          maxLength: 1
        dataUpdatedAt:
          type: integer
          description: データ作成日時 (JV-Data RA レコード §3 由来、Unix Timestamp)
          example: 1716715200
        raceYear:
          type: integer
          description: 開催年 (yyyy)
          example: 2024
        raceDate:
          type: string
          description: 開催月日 (mmdd)
          example: '0526'
          pattern: ^[0-9]{4}$
          maxLength: 4
        courseCode:
          $ref: '#/components/schemas/CourseCode'
        meetingNumber:
          type: integer
          description: '開催回 (その競馬場でその年の何回目の開催か、JV-Data RA レコード #7 Kaiji 由来)'
          example: 2
        meetingDay:
          type: integer
          description: '開催日目 (そのレース施行回で何日目か、JV-Data RA レコード #8 Nichiji 由来)'
          example: 12
        raceNumber:
          type: integer
          description: レース番号 (1-12)
          example: 11
        dayOfWeekCode:
          $ref: '#/components/schemas/DayOfWeekCode'
        specialRaceNumber:
          type: string
          description: 特別競走番号
          example: '0000'
          maxLength: 4
        title:
          type: string
          description: 競走名本題
          example: 東京優駿
          maxLength: 60
        subTitle:
          type: string
          description: 競走名副題
          example: （日本ダービー）
          nullable: true
          maxLength: 60
        titleAppendix:
          type: string
          description: 競走名カッコ内
          example: （ＧＩ）
          nullable: true
          maxLength: 60
        titleEnglish:
          type: string
          description: 競走名本題欧字
          example: TOKYO YUSHUN
          nullable: true
          maxLength: 120
        titleEnglishSub:
          type: string
          description: 競走名副題欧字 (JV-Data RA レコード §16 由来)
          example: JAPANESE DERBY
          nullable: true
          maxLength: 120
        titleEnglishParen:
          type: string
          description: 競走名カッコ内欧字 (JV-Data RA レコード §17 由来)
          example: G1
          nullable: true
          maxLength: 120
        titleClassification:
          type: string
          description: 競走名区分 (JV-Data RA レコード §21 由来)。0:初期値, 1:本題, 2:副題, 3:カッコ内
          example: '1'
          maxLength: 1
        titleShort10:
          type: string
          description: 競走名略称10文字
          example: 日本ダービー
          maxLength: 20
        titleShort6:
          type: string
          description: 競走名略称6文字
          example: ダービー
          maxLength: 12
        titleShort3:
          type: string
          description: 競走名略称3文字
          example: ダービー
          maxLength: 6
        gradeCode:
          $ref: '#/components/schemas/GradeCode'
        gradeChangedFrom:
          $ref: '#/components/schemas/GradeCode'
        gradeCount:
          type: integer
          description: 重賞回次
          example: 91
        typeCode:
          $ref: '#/components/schemas/TypeCode'
        signCode:
          $ref: '#/components/schemas/SignCode'
        weightTypeCode:
          $ref: '#/components/schemas/WeightTypeCode'
        condition2Yo:
          $ref: '#/components/schemas/RaceConditionCode'
        condition3Yo:
          $ref: '#/components/schemas/RaceConditionCode'
        condition4Yo:
          $ref: '#/components/schemas/RaceConditionCode'
        condition5YoUp:
          $ref: '#/components/schemas/RaceConditionCode'
        conditionYoungest:
          $ref: '#/components/schemas/RaceConditionCode'
        conditionName:
          type: string
          description: 競走条件名称（主に地方競馬用）
          example: null
          nullable: true
          maxLength: 60
        distance:
          type: integer
          description: 距離 (m)
          example: 2400
        distanceChangedFrom:
          type: integer
          description: 変更前距離
          example: 0
        trackCode:
          $ref: '#/components/schemas/TrackCode'
        trackChangedFrom:
          $ref: '#/components/schemas/TrackCode'
        courseSubset:
          type: string
          description: コース区分（A, B, C...）
          example: A
          maxLength: 2
        courseSubsetChangedFrom:
          type: string
          description: 変更前コース区分 (JV-Data RA レコード §39 由来)。変更がない場合は空文字
          example: ''
          maxLength: 2
        prizes:
          type: array
          description: >-
            本賞金 [1着, 2着, 3着, 4着, 5着] (単位: 円、JV-Data RA レコード §40 由来)。JV-Data
            原データは 8 byte × 7 回繰返 (5着3同着考慮で最大 7 entries) だが、本 API は 1〜5着の 5 要素
            array に集約。データ未投入の slot は要素単位で null を保持し位置を維持する (例: 速報成績 3着まで確定段階では
            `[300000000, 120000000, 75000000, null, null]`)。全 slot が未投入のレース (例:
            dataType が出走馬名表 / 出馬表 段階) では本 field 自体を omit する
          items:
            type:
              - integer
              - 'null'
          example:
            - 300000000
            - 120000000
            - 75000000
            - 45000000
            - 30000000
        prizesChangedFrom:
          type: array
          description: >-
            変更前本賞金 [1着, 2着, 3着, 4着, 5着] (単位: 円、JV-Data RA レコード §41
            由来)。同着により本賞金の分配が変更された場合のみ値を保持。JV-Data 原データは 8 byte × 5 回繰返 (5着3同着考慮)
            を 1〜5着の 5 要素 array に集約。データ未投入の slot は要素単位で null
            を保持し位置を維持する。変更が一切無いレースでは本 field 自体を omit する
          items:
            type:
              - integer
              - 'null'
          example:
            - 300000000
            - 90000000
            - 90000000
            - 45000000
            - 30000000
        addedPrizes:
          type: array
          description: >-
            付加賞 [1着, 2着, 3着] (単位: 円、JV-Data RA レコード §42 由来)。JV-Data 原データは 8 byte
            × 5 回繰返 (3着3同着考慮で最大 5 entries) だが、本 API は 1〜3着の 3 要素 array
            に集約。データ未投入の slot は要素単位で null を保持し位置を維持する (例: 速報成績 1着まで確定段階では
            `[45122000, null, null]`)。全 slot が未投入の race では本 field 自体を omit する
          items:
            type:
              - integer
              - 'null'
          example:
            - 45122000
            - 12892000
            - 6446000
        addedPrizesChangedFrom:
          type: array
          description: >-
            変更前付加賞 [1着, 2着, 3着] (単位: 円、JV-Data RA レコード §43
            由来)。同着により付加賞の分配が変更された場合のみ値を保持。JV-Data 原データは 8 byte × 3 回繰返 (3着3同着考慮)
            を 1〜3着の 3 要素 array に集約。データ未投入の slot は要素単位で null
            を保持し位置を維持する。変更が一切無いレースでは本 field 自体を omit する
          items:
            type:
              - integer
              - 'null'
          example:
            - 40000000
            - 12000000
            - 6000000
        postTime:
          type: string
          description: 発走時刻 (hhmm)
          example: '1540'
          maxLength: 4
        postTimeChangedFrom:
          type: string
          description: 変更前発走時刻
          example: '1540'
          maxLength: 4
        entryCount:
          type: integer
          description: 登録頭数
          example: 18
        starterCount:
          type: integer
          description: 出走頭数
          example: 18
        finisherCount:
          type: integer
          description: 入線頭数
          example: 18
        weatherCode:
          $ref: '#/components/schemas/WeatherCode'
        turfConditionCode:
          $ref: '#/components/schemas/TrackConditionCode'
        dirtConditionCode:
          $ref: '#/components/schemas/TrackConditionCode'
        lapTimes:
          type: array
          description: 'ハロン単位のラップタイム (単位: 秒)'
          items:
            type: number
          example:
            - 12.2
            - 10.8
            - 11.3
            - 12.1
            - 12.6
            - 12.7
            - 12.5
            - 11.7
            - 11.3
            - 11.1
            - 11.2
            - 11.5
        steepleMileTime:
          type: number
          description: '障害マイルタイム (単位: 秒)'
          example: null
          nullable: true
        first3FTime:
          type: number
          description: '前3ハロンタイム (単位: 秒)'
          example: 34.3
        first4FTime:
          type: number
          description: '前4ハロンタイム (単位: 秒)'
          example: 46.4
        last3FTime:
          type: number
          description: '後3ハロンタイム (単位: 秒)'
          example: 33.8
        last4FTime:
          type: number
          description: '後4ハロンタイム (単位: 秒)'
          example: 45
        cornerPassingOrder:
          type: array
          description: >-
            コーナー毎の通過順位 (JV-Data RA §58 由来)。`corner` はコーナー番号 (1-4)、`lap` は周回数
            (1:1周, 2:2周, 3:3周、障害競走のみ意味あり、平地は常に 1)、`order` は通過順位文字列。例: [{corner:
            1, lap: 1, order: '1-2-3'}]
          items:
            type: object
            properties:
              corner:
                type: integer
                description: コーナー番号 (JV-Data RA §58a 由来、1-4)
                example: 1
              lap:
                type: integer
                description: コーナー周回数 (JV-Data RA §58b 由来、1:1周, 2:2周, 3:3周、障害競走のみ意味あり)
                example: 1
              order:
                type: string
                description: 通過順位文字列 (JV-Data RA §58c 由来、70 byte)
                example: 15-2,5(3,7,12)(1,8,11,14)(4,13,17)-6,16,18-9-10
        isRecordBreak:
          type: integer
          description: レコード更新区分 (0:なし, 1:大会レコード, 2:コースレコード)
          example: 0
        payout:
          $ref: '#/components/schemas/RacePayout'
        createdAt:
          type: integer
          description: レコード作成日時 (Unix Timestamp)
          example: 1716716000
        updatedAt:
          type: integer
          description: レコード最終更新日時 (Unix Timestamp)
          example: 1716716000
    ResponseExtensions:
      type: object
      description: レスポンスに関する補助情報（メタデータ）。一覧取得時にはページネーション情報が含まれます。
      properties:
        totalCount:
          type: integer
          description: 検索条件に一致する全データの総件数
          example: 150
        limit:
          type: integer
          description: 1リクエストあたりの最大取得件数
          example: 50
        page:
          type: integer
          description: 現在のページ番号
          example: 1
        totalPages:
          type: integer
          description: 全件数をlimitで割った合計ページ数
          example: 3
        dataUpdatedAt:
          type: integer
          description: 返却されたデータの最終更新日時 (Unix Timestamp)。キャッシュ制御などに利用します。
          example: 1716715200
    RaceId:
      type: string
      pattern: ^ra_[0-9]{16}$
      example: ra_2024052605021211
      description: >-
        Race entity ID。JV-Data RA レコード由来の合成 PK (開催年月日 8 桁 + 場コード 2 桁 + 開催回 2 桁 +
        開催日目 2 桁 + レース番号 2 桁)
    DayOfWeekCode:
      type: string
      description: |-
        曜日のコード値。以下の対応表を参照してください。

        | コード | 曜日名 | 略称 | 英語 |
        | :--- | :--- | :--- | :--- |
        | 1 | 土曜日 | 土 | SATURDAY |
        | 2 | 日曜日 | 日 | SUNDAY |
        | 3 | 祝日 | 祝 | HOLIDAY |
        | 4 | 月曜日 | 月 | MONDAY |
        | 5 | 火曜日 | 火 | TUESDAY |
        | 6 | 水曜日 | 水 | WEDNESDAY |
        | 7 | 木曜日 | 木 | THURSDAY |
        | 8 | 金曜日 | 金 | FRIDAY |
        | 0 | なし/未定義 | - | - |
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
        - '4'
        - '5'
        - '6'
        - '7'
        - '8'
      example: '1'
      maxLength: 1
    WeightTypeCode:
      type: string
      description: |-
        負担重量（斤量）の決定方法を表すコード。

        | コード | 内容 | 欧字表記 | 説明 |
        | :--- | :--- | :--- | :--- |
        | 1 | ハンデ | HANDICAP | 実績を考慮しハンデキャッパーが決定する。 |
        | 2 | 別定 | SPECIAL WEIGHT | レース毎に定められた基準で決定する。 |
        | 3 | 馬齢 | WEIGHT FOR AGE | 馬の年齢と性別のみで決定する。 |
        | 4 | 定量 | SPECIAL WEIGHT | 性別や年齢に基づき、あらかじめ固定された重量。 |
        | 0 | 未設定 | - | 地方競馬・海外等での初期値。 |
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
        - '4'
      example: '4'
      maxLength: 1
    RaceConditionCode:
      type: string
      description: >-
        競走条件を表すコード。JV-Data 仕様書「2007.競走条件コード」に準拠。


        ### コードの構造

        - `000`〜`100`: 収得賞金区分 (`XYZ` = `XYZ × 100 万円以下`、例: `001` = 100
        万円以下、`100` = 1 億円以下)

        - `701`〜`703`: 馬齢・出走経歴ベースの条件

        - `999`: オープン


        ### 主要なコード

        | コード | 名称 | 内容 |

        | :--- | :--- | :--- |

        | `000` | (未設定) | 主に地方競馬・海外国際レースに関するデータの初期値 |

        | `001` | 100万円以下 | 収得賞金が 100 万円以下の馬が出走できる |

        | `005` | 500万円以下 / **1勝クラス** | 1勝した馬が出走できる |

        | `010` | 1000万円以下 / **2勝クラス** | 2勝した馬が出走できる |

        | `016` | 1600万円以下 / **3勝クラス** | 3勝した馬が出走できる |

        | `099` | 9900万円以下 | |

        | `100` | 1億円以下 | |

        | `701` | 新馬 | サラブレッド系の未出走馬が出走できる |

        | `702` | 未出走 | 該当競馬以外で出走経験がなく、当該競馬で1着または重賞2着になったことのない馬 |

        | `703` | 未勝利 | 該当競馬以外で出走経験があるが収得賞金がない馬 (および未出走馬) |

        | `999` | オープン | 特に記載のない限りすべての馬が出走できる |


        ※`001`〜`100` は連続値で、各値は「数値 × 100 万円以下」を意味します (`002` = 200 万円以下、`050` =
        5000 万円以下、等)。1勝/2勝/3勝クラスの呼称は 2019 年 6
        月の競走体系再編により導入されたもので、それ以前は賞金区分名で呼ばれていました (JV-Data 特記事項参照)
      enum:
        - '000'
        - '001'
        - '002'
        - '003'
        - '004'
        - '005'
        - '006'
        - '007'
        - '008'
        - '009'
        - '010'
        - '011'
        - '012'
        - '013'
        - '014'
        - '015'
        - '016'
        - '017'
        - '018'
        - '019'
        - '020'
        - '021'
        - '022'
        - '023'
        - '024'
        - '025'
        - '026'
        - '027'
        - '028'
        - '029'
        - '030'
        - '031'
        - '032'
        - '033'
        - '034'
        - '035'
        - '036'
        - '037'
        - '038'
        - '039'
        - '040'
        - '041'
        - '042'
        - '043'
        - '044'
        - '045'
        - '046'
        - '047'
        - '048'
        - '049'
        - '050'
        - '051'
        - '052'
        - '053'
        - '054'
        - '055'
        - '056'
        - '057'
        - '058'
        - '059'
        - '060'
        - '061'
        - '062'
        - '063'
        - '064'
        - '065'
        - '066'
        - '067'
        - '068'
        - '069'
        - '070'
        - '071'
        - '072'
        - '073'
        - '074'
        - '075'
        - '076'
        - '077'
        - '078'
        - '079'
        - '080'
        - '081'
        - '082'
        - '083'
        - '084'
        - '085'
        - '086'
        - '087'
        - '088'
        - '089'
        - '090'
        - '091'
        - '092'
        - '093'
        - '094'
        - '095'
        - '096'
        - '097'
        - '098'
        - '099'
        - '100'
        - '701'
        - '702'
        - '703'
        - '999'
      example: '005'
      maxLength: 3
    WeatherCode:
      type: string
      description: |-
        レース当日の天候を表すコード。

        | コード | 名称 | 英語表記 |
        | :--- | :--- | :--- |
        | 1 | 晴 | Fine |
        | 2 | 曇 | Cloudy |
        | 3 | 雨 | Rainy |
        | 4 | 小雨 | Drizzle |
        | 5 | 雪 | Snow |
        | 6 | 小雪 | Light Snow |
        | 0 | 未設定 | - |
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
        - '4'
        - '5'
        - '6'
      example: '1'
      maxLength: 1
    TrackConditionCode:
      type: string
      description: |-
        馬場の含水状況を表すコード。

        | コード | 名称 | 英語(芝) | 英語(ダート) |
        | :--- | :--- | :--- | :--- |
        | 1 | 良 | Good to Firm | Standard |
        | 2 | 稍重 | Good | Good |
        | 3 | 重 | Yielding | Muddy |
        | 4 | 不良 | Soft | Sloppy |
        | 0 | 未設定 | - | - |
      enum:
        - '0'
        - '1'
        - '2'
        - '3'
        - '4'
      example: '1'
      maxLength: 1
    RacePayout:
      type: object
      description: >-
        レースの払い戻し情報。単勝・複勝・枠連・馬連・ワイド・馬単・3連複・3連単の的中番号、払戻金、人気順を含みます。`Race.payout` は
        `?include=payout` 指定時のみ含まれる optional field。
      required:
        - raceId
        - dataType
      properties:
        raceId:
          $ref: '#/components/schemas/RaceId'
        dataType:
          type: string
          description: >-
            データ区分 (JV-Data HR レコード §2 由来)。1:速報成績(払戻金確定), 2:成績(月曜), 9:レース中止,
            0:該当レコード削除(提供ミスなどの理由による)
          example: '2'
          maxLength: 1
        dataUpdatedAt:
          type: integer
          description: データ作成日時 (JV-Data HR レコード §3 由来、Unix Timestamp)
          example: 1716715200
        entryCount:
          type: integer
          description: 登録頭数
          example: 18
        starterCount:
          type: integer
          description: 出走頭数
          example: 18
        flags:
          type: object
          description: >-
            不成立・特払・返還のフラグ群 (JV-Data HR §12-38 由来)。各 flag は 8 券種
            (`win`/`place`/`bracketQuinella`/`quinella`/`wide`/`exacta`/`trio`/`trifecta`)
            で個別保持。各値は `true`:該当あり / `false`:該当なし
          properties:
            failed:
              type: object
              description: >-
                不成立フラグ (JV-Data HR §12-20。§17 は予備フィールドで未公開、§18 は馬単に対応)。該当券種は不成立
                (発売停止 等) で払戻なし
              properties:
                win:
                  type: boolean
                  description: 単勝不成立 (HR §12)
                place:
                  type: boolean
                  description: 複勝不成立 (HR §13)
                bracketQuinella:
                  type: boolean
                  description: 枠連不成立 (HR §14)
                quinella:
                  type: boolean
                  description: 馬連不成立 (HR §15)
                wide:
                  type: boolean
                  description: ワイド不成立 (HR §16)
                exacta:
                  type: boolean
                  description: 馬単不成立 (HR §18)
                trio:
                  type: boolean
                  description: 3連複不成立 (HR §19)
                trifecta:
                  type: boolean
                  description: 3連単不成立 (HR §20)
            special:
              type: object
              description: >-
                特払フラグ (JV-Data HR §21-29。§26 は予備フィールドで未公開、§27
                は馬単に対応)。該当券種は的中無しで特別払戻が発生
              properties:
                win:
                  type: boolean
                  description: 単勝特払 (HR §21)
                place:
                  type: boolean
                  description: 複勝特払 (HR §22)
                bracketQuinella:
                  type: boolean
                  description: 枠連特払 (HR §23)
                quinella:
                  type: boolean
                  description: 馬連特払 (HR §24)
                wide:
                  type: boolean
                  description: ワイド特払 (HR §25)
                exacta:
                  type: boolean
                  description: 馬単特払 (HR §27)
                trio:
                  type: boolean
                  description: 3連複特払 (HR §28)
                trifecta:
                  type: boolean
                  description: 3連単特払 (HR §29)
            refund:
              type: object
              description: >-
                返還フラグ (JV-Data HR §30-38。§35 は予備フィールドで未公開、§36
                は馬単に対応)。該当券種は返還対象の馬番・枠番あり (詳細は `refundHorseNumbers` /
                `refundBracketNumbers` / `refundSameBracketNumbers` 参照)
              properties:
                win:
                  type: boolean
                  description: 単勝返還 (HR §30)
                place:
                  type: boolean
                  description: 複勝返還 (HR §31)
                bracketQuinella:
                  type: boolean
                  description: 枠連返還 (HR §32)
                quinella:
                  type: boolean
                  description: 馬連返還 (HR §33)
                wide:
                  type: boolean
                  description: ワイド返還 (HR §34)
                exacta:
                  type: boolean
                  description: 馬単返還 (HR §36)
                trio:
                  type: boolean
                  description: 3連複返還 (HR §37)
                trifecta:
                  type: boolean
                  description: 3連単返還 (HR §38)
        refundHorseNumbers:
          type: array
          description: 返還となった馬番のリスト
          items:
            type: integer
          example: []
        refundBracketNumbers:
          type: array
          description: 返還となった枠番のリスト
          items:
            type: integer
          example: []
        refundSameBracketNumbers:
          type: array
          description: 返還となった同枠番号のリスト
          items:
            type: integer
          example: []
        win:
          type: array
          description: 単勝の払戻情報 (JV-Data HR §42 由来、同着考慮で最大 3 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        place:
          type: array
          description: 複勝の払戻情報 (JV-Data HR §43 由来、同着考慮で最大 5 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        bracketQuinella:
          type: array
          description: 枠連の払戻情報 (JV-Data HR §44 由来、同着考慮で最大 3 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        quinella:
          type: array
          description: 馬連の払戻情報 (JV-Data HR §45 由来、同着考慮で最大 3 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        wide:
          type: array
          description: ワイドの払戻情報 (JV-Data HR §46 由来、同着考慮で最大 7 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        exacta:
          type: array
          description: 馬単の払戻情報 (JV-Data HR §48 由来、同着考慮で最大 6 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        trio:
          type: array
          description: 3連複の払戻情報 (JV-Data HR §49 由来、同着考慮で最大 3 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        trifecta:
          type: array
          description: 3連単の払戻情報 (JV-Data HR §50 由来、同着考慮で最大 6 件)
          items:
            $ref: '#/components/schemas/RacePayoutItem'
        createdAt:
          type: integer
          description: レコード作成日時 (Unix Timestamp)
          example: 1716716000
        updatedAt:
          type: integer
          description: レコード最終更新日時 (Unix Timestamp)
          example: 1716716000
    ErrorResponse:
      type: object
      description: >-
        エラーレスポンスの共通ラッパー。すべての 4xx / 5xx で同一構造を返します。トップレベルの `error`
        フィールドに、プログラム判定用の `code`、人間向け `message`、問い合わせ追跡用の `requestId` を入れます。
      required:
        - error
      properties:
        error:
          type: object
          required:
            - code
            - message
          properties:
            code:
              type: string
              description: エラーコード。プログラムで判定可能な SCREAMING_SNAKE_CASE 文字列
              example: UNAUTHORIZED
            message:
              type: string
              description: エラーの内容（人間向けメッセージ）
              example: 有効なAPIアクセスキーが必要です。
            requestId:
              type: string
              description: 問い合わせ用ID
              example: req_abcd1234
    RacePayoutItem:
      type: object
      description: >-
        個別の払い戻し的中データ（的中番号、払戻金、人気順）。配列要素として行が存在する場合、numbers / payout
        は常に値が確定する。payout は発売なし時のみ 0、特払・不成立時は当該金額が入る。popularity は発売なし時に存在しないため
        nullable。
      required:
        - numbers
        - payout
      properties:
        numbers:
          type: string
          description: '的中番号（馬番や枠番の組み合わせ。例: ''5'', ''1-2'', ''5-15-12''）。行が存在する場合は常に値が確定する。'
          example: '5'
        payout:
          type: integer
          description: >-
            払戻金（単位：円）。行が存在する場合は常に値が確定する。発売なし時のみ 0 で、特払・不成立時は JV-Data 原値の金額が入る
            (JV-Data HR §42b-§50b 由来)。
          example: 4660
        popularity:
          type: integer
          description: 人気順。発売なし時には存在しないため省略される場合がある。
          example: 9
  responses:
    BadRequest:
      description: リクエストの構文エラーや型不整合
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: BAD_REQUEST
              message: リクエストの形式が正しくありません。
    Unauthorized:
      description: >-
        認証エラー（APIキー未設定、または無効）。`Authorization: Bearer <sk_live_... or
        sk_test_...>` を必ず付与してください。失敗理由（キー欠落 / 不明 / 失効）は同一 body で返します。
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: UNAUTHORIZED
              message: 有効なAPIキーが必要です。
    NotFound:
      description: リソースが見つからない場合
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: NOT_FOUND
              message: 指定されたIDのリソースが見つかりませんでした。
    InternalServerError:
      description: サーバー内部エラー
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error:
              code: INTERNAL_SERVER_ERROR
              message: サーバー内部で予期せぬエラーが発生しました。
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        APIダッシュボードで発行された `sk_live_...` または `sk_test_...` キーを入力してください。prefix は
        mode を示し、両 mode とも同じ API URL で利用できます (`sk_live_*` = live mode /
        本番、`sk_test_*` = test mode / 開発・自動テスト)。

````