{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sportstatsapi/json-schema/sportstatsapi-database-horse-racing-course-stats-schema.json",
  "title": "database.HorseRacingCourseStats",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sportstatsapi-horse-racing-api-openapi.yml#/components/schemas/database.HorseRacingCourseStats",
  "properties": {
    "course": {
      "type": "string"
    },
    "draw": {
      "description": "Draw: distance bands with at least HorseRacingDrawMinRaces races\nwhose every runner had a stall (from HorseRacingDrawFrom; in the USA a\npost position, the program number, from the start of our data).",
      "items": {
        "$ref": "#/$defs/database.HorseRacingDrawBand"
      },
      "type": "array"
    },
    "draw_collecting": {
      "description": "DrawCollecting: the bands still under HorseRacingDrawMinRaces races,\nwith their count so far (no thirds: too few to say anything).",
      "items": {
        "$ref": "#/$defs/database.HorseRacingDrawBand"
      },
      "type": "array"
    },
    "draw_splits": {
      "description": "DrawSplits: the same split by going or surface and by field size.",
      "items": {
        "$ref": "#/$defs/database.HorseRacingDrawBand"
      },
      "type": "array"
    },
    "favourites": {
      "$ref": "#/$defs/database.HorseRacingFavourites"
    },
    "from": {
      "type": "string"
    },
    "jockeys": {
      "description": "most wins first",
      "items": {
        "$ref": "#/$defs/database.HorseRacingPersonTally"
      },
      "type": "array"
    },
    "race_days": {
      "description": "days with a settled race",
      "type": "integer"
    },
    "races": {
      "description": "settled",
      "type": "integer"
    },
    "region": {
      "type": "string"
    },
    "to": {
      "type": "string"
    },
    "trainers": {
      "description": "most wins first",
      "items": {
        "$ref": "#/$defs/database.HorseRacingPersonTally"
      },
      "type": "array"
    }
  },
  "type": "object",
  "$defs": {
    "database.HorseRacingDrawBand": {
      "properties": {
        "band": {
          "description": "\"5f-6f\", \"7f-1m\", \"1m1f-1m3f\", \"1m4f+\"",
          "type": "string"
        },
        "by": {
          "description": "By and Value: a split's dimension (\"ground\": going group or USA\nsurface; \"field\": field size) and value (\"Good or firmer\", \"Dirt\",\n\"10-13 runners\"); empty for the band as a whole.",
          "enum": [
            "ground",
            "field"
          ],
          "type": "string"
        },
        "races": {
          "type": "integer"
        },
        "thirds": {
          "items": {
            "$ref": "#/$defs/database.HorseRacingDrawThird"
          },
          "type": "array"
        },
        "value": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "database.HorseRacingDrawThird": {
      "properties": {
        "places": {
          "type": "integer"
        },
        "prb": {
          "description": "PRB: the share of rivals beaten on average, in % (50: no bias).",
          "type": "number"
        },
        "runs": {
          "type": "integer"
        },
        "third": {
          "description": "low, middle, high",
          "type": "string"
        },
        "win_rate": {
          "description": "%",
          "type": "number"
        },
        "wins": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "database.HorseRacingFavourites": {
      "properties": {
        "races": {
          "type": "integer"
        },
        "win_rate": {
          "description": "%",
          "type": "number"
        },
        "wins": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "database.HorseRacingPersonTally": {
      "properties": {
        "id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "places": {
          "type": "integer"
        },
        "runs": {
          "type": "integer"
        },
        "strike_rate": {
          "description": "wins per run in %, one decimal",
          "type": "number"
        },
        "wins": {
          "type": "integer"
        }
      },
      "type": "object"
    }
  }
}