{
  "openapi": "3.0.1",
  "info": {
    "title": "NYC Vehicle Collisions - Crashes & Vehicles Involved",
    "description": "NYPD NYC collision reports: 2,304,281 crashes (date, borough, ZIP, coordinates, injuries and deaths, contributing factors) and 4,619,347 vehicles (type, make, model, year, occupants, licence status, registration state, damage). Join on collision id; profile one collision.",
    "version": "0.0",
    "x-build-id": "56Hw0NIs5ca1fu7HZ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/j0401~nyc-vehicle-collisions/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-j0401-nyc-vehicle-collisions",
        "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~nyc-vehicle-collisions/runs": {
      "post": {
        "operationId": "runs-sync-j0401-nyc-vehicle-collisions",
        "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~nyc-vehicle-collisions/run-sync": {
      "post": {
        "operationId": "run-sync-j0401-nyc-vehicle-collisions",
        "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": [
              "",
              "rows",
              "aggregate",
              "profile"
            ],
            "type": "string",
            "description": "rows = records from the chosen corpus (default). aggregate = one row per group with a count, occupants, injured or killed total. profile = one collision with its vehicle count and types (collisionId required).",
            "default": ""
          },
          "corpus": {
            "title": "Corpus",
            "enum": [
              "vehicles",
              "crashes"
            ],
            "type": "string",
            "description": "vehicles = one row per vehicle involved (4,619,347). crashes = one row per collision (2,304,281) with location and injury counts.",
            "default": "vehicles"
          },
          "collisionId": {
            "title": "Collision ID",
            "type": "string",
            "description": "NYPD collision id - a 32-character hexadecimal string, e.g. \"24e796a6c3ed3613ec3b6655c1ab1636\". Returns the collision's vehicles (or with mode=profile, the crash plus vehicle summary)."
          },
          "dateFrom": {
            "title": "Crash date from",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD). Both corpora."
          },
          "dateTo": {
            "title": "Crash date to",
            "type": "string",
            "description": "ISO date (YYYY-MM-DD). Both corpora."
          },
          "contributingFactor": {
            "title": "Contributing factor contains",
            "type": "string",
            "description": "Case-insensitive substring, e.g. \"Inattention\", \"Failure to Yield\", \"Alcohol\". Both corpora (any of the factor slots)."
          },
          "borough": {
            "title": "Borough",
            "type": "string",
            "description": "Crashes corpus only. e.g. BROOKLYN, QUEENS, MANHATTAN, BRONX, STATEN ISLAND. 674,893 rows carry no borough."
          },
          "zipcode": {
            "title": "ZIP code",
            "type": "string",
            "description": "Crashes corpus only. Exact 5-digit ZIP. Accepts ZIP+4 (\"12345-6789\"); matched on the 5-digit core."
          },
          "minInjured": {
            "title": "Minimum persons injured",
            "minimum": 0,
            "type": "number",
            "description": "Crashes corpus only."
          },
          "minKilled": {
            "title": "Minimum persons killed",
            "minimum": 0,
            "type": "number",
            "description": "Crashes corpus only."
          },
          "vehicleType": {
            "title": "Vehicle type contains",
            "type": "string",
            "description": "Vehicles corpus only. Free text with 3,317 distinct spellings, e.g. \"Sedan\", \"TAXI\", \"Bicycle\", \"Bus\"."
          },
          "vehicleMake": {
            "title": "Vehicle make contains",
            "type": "string",
            "description": "Vehicles corpus only - case-insensitive substring, e.g. \"hond\", \"toyt\", \"ford\". Newer rows abbreviate makes (\"HOND -CAR/SUV\"), so a stem matches both vocabularies."
          },
          "vehicleModel": {
            "title": "Vehicle model contains",
            "type": "string",
            "description": "Vehicles corpus only."
          },
          "vehicleYear": {
            "title": "Vehicle year",
            "type": "string",
            "description": "Vehicles corpus only. Exact model year as filed, e.g. \"2019\"."
          },
          "registrationState": {
            "title": "Registration state",
            "type": "string",
            "description": "Vehicles corpus only. Two-letter state where the vehicle is registered, e.g. \"NJ\", \"PA\". This is not a plate; the source publishes no plate."
          },
          "driverLicenseStatus": {
            "title": "Driver licence status contains",
            "type": "string",
            "description": "Vehicles corpus only, e.g. \"Unlicensed\", \"Suspended\", \"Revoked\"."
          },
          "minOccupants": {
            "title": "Minimum vehicle occupants",
            "minimum": 0,
            "type": "number",
            "description": "Vehicles corpus only."
          },
          "groupBy": {
            "title": "Aggregate dimension",
            "enum": [
              "",
              "vehicleType",
              "vehicleMake",
              "contributingFactor",
              "driverLicenseStatus",
              "travelDirection",
              "crashYear",
              "borough",
              "zipcode"
            ],
            "type": "string",
            "description": "Used only with mode=aggregate. Vehicles: vehicleType (default), vehicleMake, contributingFactor, driverLicenseStatus, travelDirection, crashYear. Crashes: borough (default), zipcode, contributingFactor, crashYear.",
            "default": ""
          },
          "metric": {
            "title": "Aggregate metric",
            "enum": [
              "",
              "count",
              "occupants",
              "injured",
              "killed"
            ],
            "type": "string",
            "description": "count (default). vehicles also supports occupants; crashes also support injured and killed.",
            "default": ""
          },
          "maxResults": {
            "title": "Max records",
            "type": "integer",
            "description": "How many records to deliver in rows/profile mode (default 50, max 5000). Aggregate and profile modes ignore this.",
            "default": 50
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}