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

# WIN5



## OpenAPI

````yaml /reference/openapi.json get /win5
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:
  /win5:
    get:
      tags:
        - Updates
      summary: WIN5
      operationId: getWin5
      parameters:
        - $ref: '#/components/parameters/date'
        - $ref: '#/components/parameters/fields'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      data:
                        $ref: '#/components/schemas/Win5'
              example:
                code: SUCCESS
                data:
                  id: wf_20240526
                  dataType: '3'
                  dataUpdatedAt: 1716715200
                  raceYear: 2024
                  raceDate: '0526'
                  targetRaceIds:
                    - ra_2024052605021210
                    - ra_2024052608021210
                    - ra_2024052605021211
                    - ra_2024052608021211
                    - ra_2024052605021212
                  totalVotes: 560000
                  validVotesList:
                    - 0
                    - 0
                    - 0
                    - 0
                    - 0
                  refundFlag: false
                  failedFlag: false
                  noWinFlag: false
                  carryoverInitial: 0
                  payouts:
                    - combination: 05-15-13-02-08
                      dividend: 6450000
                      winners: 12
                  carryoverAfter: 0
                  createdAt: 1716716000
                  updatedAt: 1716716000
        '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'
    fields:
      name: fields
      in: query
      schema:
        type: string
        maxLength: 500
      description: 取得するフィールドの絞り込み（カンマ区切り）
  schemas:
    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'
    Win5:
      type: object
      description: WIN5（重勝式）の発売・払戻情報
      required:
        - id
        - raceYear
        - raceDate
        - targetRaceIds
      properties:
        id:
          $ref: '#/components/schemas/Win5Id'
        dataType:
          type: string
          description: >-
            データ区分 (JV-Data WF レコード §2 由来)。1:重勝式詳細発表時, 2:重勝式対象1レース目確定時,
            3:重勝式払戻発表時, 7:成績(月曜), 9:重勝式中止時, 0:該当レコード削除(提供ミスなどの理由による)
          example: '3'
          maxLength: 1
        dataUpdatedAt:
          type: integer
          description: データ作成日時 (JV-Data WF レコード §3 由来、Unix Timestamp)
          example: 1716715200
        raceYear:
          type: integer
          description: >-
            対象 5 レースの開催年 (JV-Data WF レコード §4 由来、西暦 4 桁。`targetRaceIds` の全 5
            レースで共通)
          example: 2024
        raceDate:
          type: string
          description: >-
            対象 5 レースの開催月日 (JV-Data WF レコード §5 由来、mmdd 形式。`targetRaceIds` の全 5
            レースで共通)
          example: '0526'
          maxLength: 4
        targetRaceIds:
          type: array
          description: 対象となる 5 レースの ID リスト (JV-Data WF レコード §7 由来、固定 5 要素)
          items:
            $ref: '#/components/schemas/RaceId'
          minItems: 5
          maxItems: 5
          example:
            - ra_2024052605021210
            - ra_2024052608021210
            - ra_2024052605021211
            - ra_2024052608021211
            - ra_2024052605021212
        totalVotes:
          type: integer
          description: >-
            重勝式の合計発売票数 (JV-Data WF レコード §9 由来、1 票 = 100 円券。`560,000 票` = `5,600
            万円` 売上に相当)
          example: 560000
        validVotesList:
          type: array
          description: >-
            各対象レース確定後の残り有効票数 (JV-Data WF レコード §10 由来、targetRaceIds と同順、固定 5
            要素)。各 entry は該当対象レース確定時点で的中可能性のある残票数。レース未確定の slot は要素単位で null
            を保持し位置を維持する (例: 1 レース目のみ確定段階では `[10000, null, null, null, null]`)。全
            5 レース未確定 (dataType=1 詳細発表時) では本 field 自体を omit する
          items:
            type:
              - integer
              - 'null'
          minItems: 5
          maxItems: 5
        refundFlag:
          type: boolean
          description: 返還フラグ (JV-Data WF レコード §11 由来)。`true`:返還あり / `false`:返還なし
          example: false
        failedFlag:
          type: boolean
          description: 不成立フラグ (JV-Data WF レコード §12 由来)。`true`:不成立あり / `false`:不成立なし
          example: false
        noWinFlag:
          type: boolean
          description: 的中無フラグ (JV-Data WF レコード §13 由来)。`true`:的中無 / `false`:的中あり
          example: false
        carryoverInitial:
          type: integer
          description: 'キャリーオーバー金額初期 (単位: 円、JV-Data WF レコード §14 由来)。開催日当日開始時のキャリーオーバー残高'
          example: 0
        payouts:
          type: array
          description: 重勝式払戻情報 (JV-Data WF レコード §16 由来)
          items:
            type: object
            required:
              - combination
              - dividend
              - winners
            properties:
              combination:
                type: string
                description: 重勝式的中馬番組合 (JV-Data WF §16a 由来、的中無の場合も組合せを設定)
                example: 05-15-13-02-08
                maxLength: 14
              dividend:
                type: integer
                description: '重勝式払戻金 (単位: 円、JV-Data WF §16b 由来、的中無の場合 0)'
                example: 6450000
              winners:
                type: integer
                description: 重勝式的中票数 (1 票 = 100 円券、JV-Data WF §16c 由来、的中無の場合 0)
                example: 12
        carryoverAfter:
          type: integer
          description: 'キャリーオーバー金額残高 (単位: 円、JV-Data WF レコード §15 由来)。次回開催日への繰越金'
          example: 0
        createdAt:
          type: integer
          description: >-
            API 側の行作成タイムスタンプ (Unix 秒、内部管理メタデータ)。JV-Data 由来の `dataUpdatedAt` (WF
            §3、データ作成年月日) とは独立した別軸
        updatedAt:
          type: integer
          description: >-
            API 側の行更新タイムスタンプ (Unix 秒、内部管理メタデータ)。JV-Data 由来の `dataUpdatedAt` (WF
            §3、データ作成年月日) とは独立した別軸
    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
    Win5Id:
      type: string
      pattern: ^wf_[0-9]{8}$
      example: wf_20240526
      description: Win5 record ID。JV-Data WF レコード由来 (重勝式 WIN5、対象日 yyyymmdd 8 桁)
    RaceId:
      type: string
      pattern: ^ra_[0-9]{16}$
      example: ra_2024052605021211
      description: >-
        Race entity ID。JV-Data RA レコード由来の合成 PK (開催年月日 8 桁 + 場コード 2 桁 + 開催回 2 桁 +
        開催日目 2 桁 + レース番号 2 桁)
    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
  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 / 開発・自動テスト)。

````