{
  "openapi": "3.0.1",
  "info": {
    "title": "Equibase Scraper - Horse Racing Entries, Results & Charts API",
    "description": "Extract US and Canadian Thoroughbred racing data from Equibase: race entries with jockey, trainer, owner, sire and dam, finished results with win-place-show and exotic payoffs, and horse profiles with career records.",
    "version": "0.1",
    "x-build-id": "C9thDoTlyfKl0vwLz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/parseforge~equibase-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-parseforge-equibase-scraper",
        "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/parseforge~equibase-scraper/runs": {
      "post": {
        "operationId": "runs-sync-parseforge-equibase-scraper",
        "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/parseforge~equibase-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-parseforge-equibase-scraper",
        "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",
        "required": [
          "resultType"
        ],
        "properties": {
          "resultType": {
            "title": "What to scrape",
            "enum": [
              "entries",
              "results",
              "horses",
              "jockeys",
              "trainers"
            ],
            "type": "string",
            "description": "Entries are the horses declared for an upcoming card. Results are the finish order and payoffs of a card that has run. Horses are career profiles with speed figures. Jockeys and trainers are their profiles: career and year-by-year records, and optionally their upcoming mounts and top horses.",
            "default": "entries"
          },
          "tracks": {
            "title": "Tracks",
            "type": "array",
            "description": "Equibase track codes (DMR, SAR, CD, GP…) or full track names (\"Del Mar\"). Leave empty to take every track with a card on the chosen date. For jockey or trainer profiles with no IDs given, the tracks and date pick whose profiles to read: everyone named on those entries.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "date": {
            "title": "Race date",
            "type": "string",
            "description": "A single race day as YYYY-MM-DD. Defaults to today for entries, and to each track's most recent card for results."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Start of an inclusive date range, YYYY-MM-DD. Days a track did not race are skipped using its own calendar, so they cost nothing."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "End of the inclusive date range, YYYY-MM-DD."
          },
          "maxDays": {
            "title": "Max race days per track",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Ceiling on how many race days are fetched per track. Each day is one page load through the anti-bot challenge, so this is the main lever on run time.",
            "default": 3
          },
          "country": {
            "title": "Country",
            "enum": [
              "USA",
              "CAN",
              "PUR"
            ],
            "type": "string",
            "description": "Equibase country code in the page URL. USA covers the United States, CAN covers Canadian tracks such as Woodbine.",
            "default": "USA"
          },
          "horseUrls": {
            "title": "Horse URLs or reference numbers",
            "type": "array",
            "description": "Required when result type is Horse profiles. Accepts a full Equibase horse URL or the bare refno, for example 10068168.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "jockeyUrls": {
            "title": "Jockey URLs or IDs",
            "type": "array",
            "description": "For result type Jockey profiles. Accepts a full Equibase jockey profile URL or the bare person id (the number after eID=, for example 164186). Every entry row already carries jockeyId. Leave empty to take every jockey named on the entries for the tracks and date above.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "trainerUrls": {
            "title": "Trainer URLs or IDs",
            "type": "array",
            "description": "For result type Trainer profiles. Accepts a full Equibase trainer profile URL or the bare person id (for example 277836). Every entry row already carries trainerId. Leave empty to take every trainer named on the entries for the tracks and date above.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Ceiling on rows written. A ceiling, not a target — a single card returns as many rows as it has runners.",
            "default": 100
          },
          "raceNumbers": {
            "title": "Race numbers",
            "type": "array",
            "description": "Keep only these races on the card, for example [1, 2, 9].",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "surfaces": {
            "title": "Surface",
            "type": "array",
            "description": "Keep only races on these surfaces.",
            "items": {
              "type": "string",
              "enum": [
                "Dirt",
                "Turf",
                "All Weather",
                "Steeplechase"
              ],
              "enumTitles": [
                "Dirt",
                "Turf",
                "All Weather / synthetic",
                "Steeplechase"
              ]
            },
            "default": []
          },
          "minPurse": {
            "title": "Minimum purse (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only races with a purse of at least this much."
          },
          "maxPurse": {
            "title": "Maximum purse (USD)",
            "minimum": 0,
            "type": "integer",
            "description": "Keep only races with a purse of at most this much."
          },
          "onlyStakes": {
            "title": "Only stakes races",
            "type": "boolean",
            "description": "Keep only stakes, handicaps, derbies, cups and graded races.",
            "default": false
          },
          "onlyClaiming": {
            "title": "Only claiming races",
            "type": "boolean",
            "description": "Keep only races where horses can be claimed.",
            "default": false
          },
          "breeds": {
            "title": "Breed",
            "type": "array",
            "description": "Keep only these breeds, for example TB for Thoroughbred, QH for Quarter Horse.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "horseName": {
            "title": "Horse name",
            "type": "string",
            "description": "Keep only rows whose horse name contains this text."
          },
          "jockey": {
            "title": "Jockey",
            "type": "string",
            "description": "Keep only rows whose jockey contains this text. Equibase abbreviates first names on entries, so \"Kimura\" beats \"Kazushi Kimura\". On jockey profiles it matches the jockey's full name."
          },
          "trainer": {
            "title": "Trainer",
            "type": "string",
            "description": "Keep only rows whose trainer contains this text. On trainer profiles it matches the trainer's full name."
          },
          "owner": {
            "title": "Owner",
            "type": "string",
            "description": "Keep only rows whose owner contains this text."
          },
          "sexes": {
            "title": "Sex",
            "type": "array",
            "description": "Keep only horses of these sexes, using Equibase's one-letter codes.",
            "items": {
              "type": "string",
              "enum": [
                "C",
                "F",
                "G",
                "H",
                "M",
                "R"
              ],
              "enumTitles": [
                "Colt",
                "Filly",
                "Gelding",
                "Horse",
                "Mare",
                "Ridgling"
              ]
            },
            "default": []
          },
          "minAge": {
            "title": "Minimum age",
            "minimum": 1,
            "type": "integer",
            "description": "Keep only horses at least this many years old."
          },
          "maxAge": {
            "title": "Maximum age",
            "minimum": 1,
            "type": "integer",
            "description": "Keep only horses at most this many years old."
          },
          "excludeScratched": {
            "title": "Exclude scratched horses",
            "type": "boolean",
            "description": "Drop horses Equibase marks as scratched from the card.",
            "default": false
          },
          "includeConnections": {
            "title": "Include owners and breeders",
            "type": "boolean",
            "description": "Adds the owner and breeder to every runner, and the winning owner, breeder, trainer and jockey to every result. Billed per row that carries them. The jockey and trainer riding each entry are always included and cost nothing extra.",
            "default": false
          },
          "includePedigree": {
            "title": "Include pedigree",
            "type": "boolean",
            "description": "Adds sire, dam and dam sire to every runner. Billed per row that carries them.",
            "default": false
          },
          "includeWagers": {
            "title": "Include exotic payoffs",
            "type": "boolean",
            "description": "Adds the exacta, trifecta, superfecta and Pick N payoffs to the winning row of each race. Billed per race that publishes them. Win, place and show payoffs are always included and cost nothing extra.",
            "default": false
          },
          "includeRaceHistory": {
            "title": "Include race history",
            "type": "boolean",
            "description": "Adds the full past-performance list to each horse profile. Billed per profile that carries one. Career totals, win rate and earnings are always included.",
            "default": false
          },
          "includePeopleDetails": {
            "title": "Include mounts and top horses",
            "type": "boolean",
            "description": "Adds to each jockey or trainer profile their upcoming entries, latest results, top 20 horses by earnings and, for trainers, the Equibase rating of each horse in the barn. Billed per profile that carries any of it. Career and year-by-year records are always included.",
            "default": false
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Equibase refuses datacenter addresses, so a residential exit is the default. If your plan has no residential access the run does not fail: it falls back to the proxy your plan includes and stops early if Equibase blocks it, and blocked pages are never charged.",
            "default": {
              "useApifyProxy": true,
              "apifyProxyGroups": [
                "RESIDENTIAL"
              ]
            }
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}