{
  "openapi": "3.0.1",
  "info": {
    "title": "NY Motor Vehicle Crash Records - Cases, People, Citations",
    "description": "The NYS DMV crash register (2021-2024) in four linked tables: crash cases, vehicles, people and citations. Filter by county, date, crash type, lighting, weather, vehicle make, role, injury severity, age or violation; profiles join occupants and citations.",
    "version": "0.0",
    "x-build-id": "pG2PuXz58x20N96H0"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~ny-crash-records/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-ny-crash-records",
        "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/j0401~ny-crash-records/runs": {
      "post": {
        "operationId": "runs-sync-j0401-ny-crash-records",
        "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/j0401~ny-crash-records/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-ny-crash-records",
        "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": {
          "corpus": {
            "title": "Dataset",
            "enum": [
              "cases",
              "vehicles",
              "individuals",
              "violations"
            ],
            "type": "string",
            "description": "cases = crash attributes; vehicles = one row per vehicle; individuals = one row per person; violations = one row per citation. vehicles and individuals join on caseVehicleId; individuals and violations join on caseIndividualId.",
            "default": "cases"
          },
          "mode": {
            "title": "Mode",
            "enum": [
              "",
              "search",
              "aggregate",
              "vehicle-profile",
              "person-profile"
            ],
            "type": "string",
            "description": "search = matching records. aggregate = one row per group. vehicle-profile = a vehicle plus every occupant and their citations. person-profile = a person plus vehicle and citations. Leave blank to auto-route from the id or groupBy you supply."
          },
          "groupBy": {
            "title": "Group by (aggregate)",
            "enum": [
              "",
              "year",
              "county",
              "municipality",
              "accidentDescriptor",
              "collisionType",
              "lighting",
              "weather",
              "roadSurface",
              "trafficControl",
              "eventDescriptor",
              "vehicleMake",
              "vehicleBodyType",
              "registrationClass",
              "fuelType",
              "stateOfRegistration",
              "contributingFactor",
              "eventType",
              "roleType",
              "injurySeverity",
              "victimStatus",
              "gender",
              "safetyEquipment",
              "ejection",
              "seatingPosition",
              "violationCode"
            ],
            "type": "string",
            "description": "Dimension for mode=aggregate. Availability depends on the corpus."
          },
          "maxResults": {
            "title": "Max records",
            "type": "integer",
            "description": "Records to deliver in search mode (default 50, max 25000).",
            "default": 50
          },
          "year": {
            "title": "Year",
            "type": "integer",
            "description": "Crash year, 2021-2024 (the source is a rolling four-year window)."
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Crash date start, YYYY-MM-DD (cases only; the other tables carry year only)."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Crash date end, YYYY-MM-DD (cases only)."
          },
          "caseVehicleId": {
            "title": "Vehicle record ID",
            "type": "string",
            "description": "case_vehicle_id. With mode=vehicle-profile, returns the vehicle, every occupant and their citations."
          },
          "caseIndividualId": {
            "title": "Person record ID",
            "type": "string",
            "description": "case_individual_id. With mode=person-profile, returns the person, their vehicle and citations."
          },
          "county": {
            "title": "County",
            "type": "string",
            "description": "County name, e.g. \"ERIE\". Cases only."
          },
          "municipality": {
            "title": "Municipality",
            "type": "string",
            "description": "Municipality or city name, e.g. \"BUFFALO\". Cases only."
          },
          "accidentDescriptor": {
            "title": "Crash outcome",
            "enum": [
              "",
              "Fatal Accident",
              "Injury Accident",
              "Property Damage & Injury Accident",
              "Property Damage Accident"
            ],
            "type": "string",
            "description": "Crash severity class. Cases only."
          },
          "collisionType": {
            "title": "Collision type",
            "type": "string",
            "description": "Collision type descriptor, e.g. \"RIGHT ANGLE\", \"OTHER\". Cases only."
          },
          "lighting": {
            "title": "Lighting",
            "type": "string",
            "description": "Lighting conditions, e.g. \"Daylight\", \"Dark-Road Lighted\". Cases only."
          },
          "weather": {
            "title": "Weather",
            "type": "string",
            "description": "Weather conditions, e.g. \"Clear\", \"Rain\". Cases only."
          },
          "roadDescriptor": {
            "title": "Road configuration",
            "type": "string",
            "description": "Road descriptor, e.g. \"Straight and Level\". Cases only."
          },
          "roadSurface": {
            "title": "Road surface",
            "type": "string",
            "description": "Road surface conditions, e.g. \"Dry\", \"Wet\". Cases only."
          },
          "trafficControl": {
            "title": "Traffic control",
            "type": "string",
            "description": "Traffic control device, e.g. \"None\", \"Traffic Signal\". Cases only."
          },
          "eventDescriptor": {
            "title": "Event",
            "type": "string",
            "description": "Event descriptor, e.g. \"Collision With Fixed Object\". Cases only."
          },
          "pedestrianAction": {
            "title": "Pedestrian/bicyclist action",
            "type": "string",
            "description": "Pedestrian or bicyclist action. Cases only."
          },
          "vehicleMake": {
            "title": "Vehicle make",
            "type": "string",
            "description": "Vehicle make code as recorded, e.g. \"TOYOT\", \"HONDA\". Vehicles only."
          },
          "vehicleBodyType": {
            "title": "Vehicle body type",
            "type": "string",
            "description": "Vehicle body type, e.g. \"SEDAN\". Vehicles only."
          },
          "registrationClass": {
            "title": "Registration class",
            "type": "string",
            "description": "Registration class, e.g. \"PASSENGER OR SUBURBAN\". Vehicles only."
          },
          "fuelType": {
            "title": "Fuel type",
            "type": "string",
            "description": "Fuel type. Vehicles only."
          },
          "stateOfRegistration": {
            "title": "State of registration",
            "type": "string",
            "description": "Two-letter state of registration, e.g. \"NY\". Vehicles only."
          },
          "eventType": {
            "title": "Vehicle event type",
            "type": "string",
            "description": "Vehicle event type. Vehicles only."
          },
          "contributingFactor": {
            "title": "Contributing factor",
            "type": "string",
            "description": "Contributing factor category (HUMAN / VEHICLE / ENVIRONMENT). Vehicles only."
          },
          "actionPrior": {
            "title": "Action prior to crash",
            "type": "string",
            "description": "Action prior to the accident, e.g. \"Going Straight Ahead\", \"Parked\". Vehicles only."
          },
          "roleType": {
            "title": "Role",
            "type": "string",
            "description": "Person role, e.g. \"Driver of a Motor Vehicle in Transport\", \"Passenger of a Motor Vehicle in Transport\", \"Pedestrian\", \"Bicyclist (operator)\", \"Registrant\". Individuals only."
          },
          "injurySeverity": {
            "title": "Injury severity",
            "enum": [
              "",
              "Killed",
              "Severe",
              "Moderate",
              "Minor",
              "Injured with Unkn Severity",
              "Uninjured"
            ],
            "type": "string",
            "description": "Injury severity. Individuals only."
          },
          "victimStatus": {
            "title": "Victim status",
            "type": "string",
            "description": "Victim status, e.g. \"Apparent Death\". Individuals only."
          },
          "safetyEquipment": {
            "title": "Safety equipment",
            "type": "string",
            "description": "Safety equipment used, e.g. \"Lap Belt/Harness\", \"Air Bag Deployed/Lap Belt/Harness\". Individuals only."
          },
          "ejection": {
            "title": "Ejection",
            "type": "string",
            "description": "Ejection status, e.g. \"Not Ejected\". Individuals only."
          },
          "gender": {
            "title": "Gender",
            "type": "string",
            "description": "M / F / U. Individuals only."
          },
          "seatingPosition": {
            "title": "Seating position",
            "type": "string",
            "description": "Seating position, e.g. \"Driver\". Individuals only."
          },
          "age": {
            "title": "Age of person",
            "type": "string",
            "description": "Age as recorded, e.g. \"35\". Individuals only."
          },
          "violationCode": {
            "title": "Violation code",
            "type": "string",
            "description": "NY vehicle and traffic law code, e.g. \"1172A\". Violations only."
          },
          "violationDescription": {
            "title": "Violation description contains",
            "type": "string",
            "description": "Case-insensitive substring of the violation description. Violations only."
          },
          "keyword": {
            "title": "Keyword (violations)",
            "type": "string",
            "description": "Free text over the violation description. Violations only."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}