{
  "openapi": "3.0.1",
  "info": {
    "title": "Japan Horse Racing Data (netkeiba.com)",
    "description": "JRA & NAR race results, race cards and horse profiles from netkeiba.com — payouts, lap times, odds, career histories, English schema. Unofficial; not affiliated with Net Dreamers Co., Ltd.",
    "version": "0.1",
    "x-build-id": "Ldh1CR4z58h6QSakK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/jpopendata~japan-keiba-netkeiba/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-jpopendata-japan-keiba-netkeiba",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/jpopendata~japan-keiba-netkeiba/runs": {
      "post": {
        "operationId": "runs-sync-jpopendata-japan-keiba-netkeiba",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/jpopendata~japan-keiba-netkeiba/run-sync": {
      "post": {
        "operationId": "run-sync-jpopendata-japan-keiba-netkeiba",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "mode": {
            "title": "Mode",
            "enum": [
              "race_results",
              "race_card",
              "horse_db"
            ],
            "type": "string",
            "description": "Optional, default race_results. What to fetch: race_results (finished races with full result, payouts, laps — JRA and NAR), race_card (upcoming-race entry lists with declared runners and morning odds — JRA), or horse_db (horse profiles with career record and optional full race history).",
            "default": "race_results"
          },
          "date": {
            "title": "Race date",
            "type": "string",
            "description": "Optional. ISO date YYYY-MM-DD. race_results: a PAST race day (all races of that day, JRA + NAR; e.g. a recent Saturday/Sunday). race_card: an UPCOMING race day (JRA cards appear ~2 days ahead). Ignored when raceId is set; not used by horse_db. With neither date nor raceId, race_results falls back to the example race below (with a warning)."
          },
          "raceId": {
            "title": "Race id(s)",
            "type": "string",
            "description": "Optional. One or more 12-digit netkeiba race ids, comma-separated (e.g. \"202601020211\"). Takes precedence over date. The id encodes year + track + meeting + day + race number and appears in every netkeiba race URL (…/race/result.html?race_id=202601020211). Default: the example race, so a run with no input succeeds.",
            "default": "202601020211"
          },
          "horseId": {
            "title": "Horse id(s)",
            "type": "string",
            "description": "REQUIRED for horse_db (otherwise ignored): one or more 10-digit netkeiba horse ids, comma-separated (e.g. \"2022102057\"). Horse ids are included in race_results output (entries[].horseId), so a results run feeds a horse_db run."
          },
          "track": {
            "title": "Track filter",
            "type": "string",
            "description": "Optional. Restrict a date-driven run to one track — netkeiba 2-digit code (\"01\"), Japanese (\"札幌\") or English (\"Sapporo\"; \"Sapporo Racecourse\" also works). Supports all 10 JRA tracks (Sapporo, Hakodate, Fukushima, Niigata, Tokyo, Nakayama, Chukyo, Kyoto, Hanshin, Kokura) and the major NAR tracks (Oi, Kawasaki, Funabashi, Urawa, Monbetsu, Kochi, Saga, Obihiro…). An unknown value stops the run with the full track list. Leave empty for all tracks."
          },
          "includeRaceHistory": {
            "title": "Include full race history (horse_db)",
            "type": "boolean",
            "description": "Optional, default true. horse_db only. When true each horse costs one extra request and includes every career start (date, race, odds, finish, time, going, weight...). When false, profile only.",
            "default": true
          },
          "maxItems": {
            "title": "Max records",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Optional, default 12. Stop after this many dataset records (1 record = 1 race or 1 horse; 1..200 — a JRA day has up to 36 races).",
            "default": 12
          },
          "maxApiRequests": {
            "title": "Max upstream requests",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Optional, default 30. Hard budget of HTTP requests to netkeiba.com for this run (1 listing page + 1 per race, or 1-2 per horse). Requests are strictly serial with >= 1.2 s spacing. When the budget runs out the run still SUCCEEDS with the records collected so far and complete=false in RUN_SUMMARY (not an error).",
            "default": 30
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Apify proxy settings. Default: no proxy (direct connection works). Never used for rotation/evasion — one client identity per run."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}