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

# 坂路調教履歴



## OpenAPI

````yaml /reference/openapi.json get /horses/{horseId}/trainings
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:
  /horses/{horseId}/trainings:
    get:
      tags:
        - Updates
      summary: 坂路調教履歴
      operationId: listHorseTrainings
      parameters:
        - $ref: '#/components/parameters/horseId'
        - $ref: '#/components/parameters/from'
        - $ref: '#/components/parameters/to'
        - $ref: '#/components/parameters/sort'
        - $ref: '#/components/parameters/fields'
        - $ref: '#/components/parameters/page'
        - $ref: '#/components/parameters/limit'
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/SuccessResponse'
                  - type: object
                    properties:
                      data:
                        type: array
                        items:
                          $ref: '#/components/schemas/Training'
              example:
                code: SUCCESS
                data:
                  - id: hc_12024052207152021105477
                    dataType: '1'
                    dataUpdatedAt: 1716715200
                    horseId: um_2021105477
                    trainingCenterCode: '1'
                    trainingDate: '20240522'
                    trainingTime: '0715'
                    times:
                      f4: 52.4
                      f3: 38.1
                      f2: 24.5
                    lapTimes:
                      - 12.2
                      - 12.3
                      - 13.6
                      - 14.3
                    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:
    horseId:
      name: horseId
      in: path
      required: true
      schema:
        $ref: '#/components/schemas/HorseId'
    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'
    sort:
      name: sort
      in: query
      schema:
        type: string
        maxLength: 100
      description: ソート順（- を付けると降順）
    fields:
      name: fields
      in: query
      schema:
        type: string
        maxLength: 500
      description: 取得するフィールドの絞り込み（カンマ区切り）
    page:
      name: page
      in: query
      schema:
        type: integer
        default: 1
        minimum: 1
        maximum: 10000
      description: ページ番号 (1 以上 10000 以下)
    limit:
      name: limit
      in: query
      schema:
        type: integer
        default: 100
        minimum: 1
        maximum: 1000
      description: 1リクエストあたりの最大取得件数 (1 以上 1000 以下)
  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'
    Training:
      type: object
      description: >-
        坂路調教タイムデータ (JV-Data HC レコード由来)。JRA トレセン (美浦/栗東) の坂路コースでの追い切り情報。ウッドチップ調教は
        `WoodChipTraining` schema を参照
      required:
        - id
        - horseId
        - trainingDate
      properties:
        id:
          $ref: '#/components/schemas/TrainingId'
        dataType:
          type: string
          description: データ区分 (JV-Data HC レコード §2 由来)。1:初期値, 0:該当レコード削除(提供ミスなどの理由による)
          example: '1'
          maxLength: 1
        dataUpdatedAt:
          type: integer
          description: データ作成日時 (JV-Data HC レコード §3 由来、Unix Timestamp)
          example: 1716715200
        horseId:
          $ref: '#/components/schemas/HorseId'
        trainingCenterCode:
          type: string
          description: トレセン区分 (JV-Data HC レコード §4 由来)。0:美浦, 1:栗東
          example: '1'
          maxLength: 1
        trainingDate:
          type: string
          description: 調教年月日 (yyyymmdd 形式、JV-Data HC レコード §5 由来)
          example: '20240522'
          minLength: 8
          maxLength: 8
          pattern: ^[0-9]{8}$
        trainingTime:
          type: string
          description: 調教時刻 (hhmm 形式、JV-Data HC レコード §6 由来)
          example: '0715'
          minLength: 4
          maxLength: 4
          pattern: ^([01][0-9]|2[0-3])[0-5][0-9]$
        times:
          type: object
          description: >-
            ハロン合計タイム (単位: 秒)。`fN` は N ハロン地点 (200m × N) から終点までの累積タイム。JV-Data 原値が
            `0000` (測定不良) の場合は該当 key が省略される
          properties:
            f4:
              type: number
              description: 4 ハロン合計 (800m 地点から終点まで、JV-Data HC レコード §8 由来)
              example: 52.4
            f3:
              type: number
              description: 3 ハロン合計 (600m 地点から終点まで、JV-Data HC レコード §10 由来)
              example: 38.1
            f2:
              type: number
              description: 2 ハロン合計 (400m 地点から終点まで、JV-Data HC レコード §12 由来)
              example: 24.5
        lapTimes:
          type: array
          description: >-
            200m ごとのラップタイム (単位: 秒、JV-Data HC レコード §14/§13/§11/§9 由来)。区間順
            [200M-0M, 400M-200M, 600M-400M, 800M-600M] (終点側から起点側、最終 200m が先頭)、最大
            4 要素。JV-Data 原値が `000` (測定不良) の場合は該当区間が省略される
          items:
            type: number
          maxItems: 4
          example:
            - 12.2
            - 12.3
            - 13.6
            - 14.3
        createdAt:
          type: integer
          description: >-
            API 側の行作成タイムスタンプ (Unix 秒、内部管理メタデータ)。JV-Data 由来の `dataUpdatedAt` (HC
            §3、データ作成年月日) とは独立した別軸
        updatedAt:
          type: integer
          description: >-
            API 側の行更新タイムスタンプ (Unix 秒、内部管理メタデータ)。JV-Data 由来の `dataUpdatedAt` (HC
            §3、データ作成年月日) とは独立した別軸
    HorseId:
      type: string
      pattern: ^um_[0-9]{10}$
      example: um_2021105477
      description: Horse entity ID。JV-Data UM レコード由来の血統登録番号 (10 桁)
    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
    TrainingId:
      type: string
      pattern: ^hc_[0-9]{23}$
      example: hc_12024052207152021105477
      description: >-
        Training record ID。JV-Data HC レコード由来 (坂路調教、トレセン区分 1 桁 + 調教年月日 8 桁 + 調教時刻
        4 桁 + 血統登録番号 10 桁、合計 23 桁)。トレセン区分は 0:美浦 / 1:栗東
    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 / 開発・自動テスト)。

````