{
  "openapi": "3.0.1",
  "info": {
    "title": "HKJC Racing Scraper: Results, Dividends & Jockey/Trainer Stats",
    "description": "Extract HKJC race results, pool dividends, and jockey/trainer season stats from racing.hkjc.com as structured JSON. Covers Sha Tin and Happy Valley, every pool type: Win, Place, Quinella, Trio. Feeds Python/pandas, Excel, Sheets, and MCP agents. Skip six brittle DIY scrapers. $0.0079 per result.",
    "version": "0.1",
    "x-build-id": "xAWuM8NfeXdl39kvp"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/getascraper~hkjc-results-dividends-stats/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-getascraper-hkjc-results-dividends-stats",
        "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/getascraper~hkjc-results-dividends-stats/runs": {
      "post": {
        "operationId": "runs-sync-getascraper-hkjc-results-dividends-stats",
        "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/getascraper~hkjc-results-dividends-stats/run-sync": {
      "post": {
        "operationId": "run-sync-getascraper-hkjc-results-dividends-stats",
        "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": {
          "dateFrom": {
            "title": "Race Date From",
            "type": "string",
            "description": "Earliest race day to fetch results and dividends for, in YYYY-MM-DD format. HKJC race meetings happen on select Wednesdays (Happy Valley) and weekends (Sha Tin), so not every date has data. The default points at a confirmed past meeting day so the run always has real races to process.",
            "default": "2026-09-06"
          },
          "dateTo": {
            "title": "Race Date To",
            "type": "string",
            "description": "Latest race day to fetch, in YYYY-MM-DD format. Leave equal to Race Date From for a single day. A wider range is processed one meeting day at a time, up to the Max Race Days limit below.",
            "default": "2026-09-06"
          },
          "racecourse": {
            "title": "Racecourse",
            "enum": [
              "ST",
              "HV",
              "BOTH"
            ],
            "type": "string",
            "description": "Which HKJC racecourse to fetch: Sha Tin (ST), Happy Valley (HV), or both. Since a given date usually only has one course racing, leaving this on Both is safe and simply skips the course that isn't racing that day.",
            "default": "BOTH"
          },
          "raceNumbers": {
            "title": "Race Numbers",
            "type": "array",
            "description": "Specific race numbers to include, e.g. [1, 2, 3]. Leave empty to fetch every race on the selected date(s) (a typical HKJC meeting has 8-11 races).",
            "default": []
          },
          "includeDividends": {
            "title": "Include Pool Dividends",
            "type": "boolean",
            "description": "Fetch the full pool payout table for each race (Win, Place, Quinella, Quinella Place, Forecast, Tierce, Trio, Quartet, Double, Tribella, and any other pools HKJC publishes). This is pulled from the same results page as the race result, so it adds negligible extra requests. The named competitor's HKJC Actor explicitly does not offer dividend/payout data yet, so this is the main reason to use this Actor over that one.",
            "default": true
          },
          "includeJockeyTrainerStats": {
            "title": "Include Jockey & Trainer Season Stats",
            "type": "boolean",
            "description": "Also fetch the current-season jockey and trainer ranking tables (total wins, places, win rate) from HKJC's own standings pages. This is a separate dataset from race results, so it defaults off to keep a plain results run fast and cheap; turn it on when you specifically need aggregate jockey/trainer performance rather than per-race appearances.",
            "default": false
          },
          "maxRaceDays": {
            "title": "Max Race Days per Run",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Caps how many distinct race meeting days are processed in a single run, even if Race Date From/To spans a wider range. Keeps the default run fast and predictable; raise it for bulk historical pulls, but expect a longer run.",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "racing.hkjc.com is a server-rendered legacy site with no observed IP-reputation gating, so the default Apify Proxy (datacenter) group works reliably and is far cheaper than residential IPs.",
            "default": {
              "useApifyProxy": true
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}