# NYC Vehicle Collisions - Crashes & Vehicles Involved (`j0401/nyc-vehicle-collisions`) Actor

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.

- **URL**: https://apify.com/j0401/nyc-vehicle-collisions.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Categories:** Business, Developer tools
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 nyc collision records

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## NYC Vehicle Collisions - 2.30M Crashes, 4.62M Vehicles

The NYPD's motor-vehicle collision reports for New York City, in two corpora
joined on `collision_id`:

- **2,304,281 collisions** - date, time, borough, ZIP, coordinates, street
  names, persons injured and killed (split by pedestrians, cyclists and
  motorists), and up to five contributing factors.
- **4,619,347 vehicles involved** - vehicle type, make, model, year, travel
  direction, occupants, driver sex, licence status and jurisdiction, pre-crash
  action, point of impact, damage, public-property damage and contributing
  factors.

Newest crash date in the file: **6 November 2026** (counts measured 10 November
2026\). The city files reports continuously and revises older records; 71,494
collisions in the file are from 2026.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold.** Pay only for the
records you receive - the full crash and vehicle files stay queryable, and you
are never billed for the scan behind it.

### What you get

**Crashes** (`corpus="crashes"`): `collisionId`, `crashDate`, `crashTime`,
`borough`, `zipCode`, `latitude`/`longitude`, `onStreet`, `offStreet`,
`crossStreet`, `personsInjured`/`personsKilled`, `pedestriansInjured`/
`pedestriansKilled`, `cyclistsInjured`/`cyclistsKilled`,
`motoristsInjured`/`motoristsKilled`, `contributingFactors` (all five slots,
folded into one field), `vehicleTypesInCrash`.

**Vehicles** (`corpus="vehicles"`): `collisionId`, `uniqueId`, `crashDate`,
`crashTime`, `vehicleId`, `vehicleType`, `vehicleMake`, `vehicleModel`,
`vehicleYear`, `travelDirection`, `occupants`, `driverSex`,
`driverLicenseStatus`, `driverLicenseJurisdiction`, `registrationState`,
`preCrash`, `pointOfImpact`, `vehicleDamage` (plus three damaged-area slots),
`publicPropertyDamage`, `publicPropertyDamageType`, `contributingFactors`.

Every record also carries `corpus`, `mode` and `totalMatched`.

### Search it

- **One collision** - `mode="profile", collisionId="24e796a6c3ed3613ec3b6655c1ab1636"`
  returns the crash plus the exact vehicle count, occupant total and the vehicle
  types involved. Collision ids are 32-character hexadecimal strings.
- **Borough and year** - `corpus="crashes", borough="BROOKLYN", dateFrom="2026-01-01"`.
- **Injury crashes** - `corpus="crashes", minInjured=3`.
- **Distraction crashes** - `contributingFactor="Inattention"`.
- **One make** - `corpus="vehicles", vehicleMake="hond"` (328,873 rows; the
  source spells newer vehicles `HOND -CAR/SUV`, so the broader `hond` catches
  both vocabularies - `honda` alone matches only 309 rows).
- **Registration state** - `registrationState="NJ"`.
- **Licence status** - `driverLicenseStatus="Unlicensed"`.
- **Occupancy** - `corpus="vehicles", minOccupants=4`. The source contains 165
  rows with impossible occupancy values (data-entry errors up to 999,999,999);
  `metric="occupants"` and a profile's occupant total exclude values above 99,
  while the raw `occupants` field keeps the source figure.

### Example inputs

**Injury crashes in Queens in 2026**

```json
{ "corpus": "crashes", "borough": "QUEENS",
  "dateFrom": "2026-01-01", "minInjured": 1, "maxResults": 100 }
```

**Fatal crashes**

```json
{ "corpus": "crashes", "minKilled": 1, "maxResults": 100 }
```

**Every vehicle in one collision**

```json
{ "corpus": "vehicles", "collisionId": "24e796a6c3ed3613ec3b6655c1ab1636" }
```

**Honda vehicles in crashes**

```json
{ "corpus": "vehicles", "vehicleMake": "hond", "maxResults": 100 }
```

### Aggregate it

```json
{ "mode": "aggregate", "corpus": "crashes",
  "groupBy": "borough", "metric": "injured" }
```

- **Vehicles** - `groupBy` = `vehicleType` (default), `vehicleMake`,
  `contributingFactor`, `driverLicenseStatus`, `travelDirection`,
  `crashYear`; `metric` = `count`, `occupants`.
- Aggregate `groupCount` for a text dimension is the count of that **exact**
  source value (`SEDAN` = 1,182,761), while the text filters are **contains**
  matches (`vehicleType="Sedan"` = 1,293,035, `borough="E"` = 506,309).
- **Crashes** - `groupBy` = `borough` (default), `zipcode`,
  `contributingFactor`, `crashYear`; `metric` = `count`, `injured`, `killed`.

For `groupBy="contributingFactor"` the aggregate uses the source's **primary**
factor column (`contributing_factor_*_1`); the free-text `contributingFactor`
filter searches every factor slot. The two totals therefore differ by design.

Every delivered record - including each aggregate row - is billed once.
An aggregate returns every group the dimension has; `maxResults` does not cap
it, so use the run's `maxTotalChargeUsd` if you need a ceiling. When
`maxResults` or the charge cap stops a rows query, the dataset also carries one
unbilled `_meta` row with `truncated`, `delivered` (a lower bound when
`stopReason="charge-limit"`), `totalMatched` and `stopReason`.

Measured today: Brooklyn 522,366 collisions, Queens 438,425, Manhattan 357,373,
Bronx 243,340, Staten Island 67,884; 674,893 rows carry no borough. Sedan
1,182,761 vehicles, Station Wagon/Sport Utility Vehicle 956,282, Passenger
Vehicle 770,753, Sport Utility/Station Wagon 337,927, Taxi 162,178 (the two
SUV spellings are separate source values). Citywide the file totals 778,610
persons injured and 3,744 killed.

### Row grain and how to read it

- **`corpus="vehicles"`: one row = one vehicle involved in one collision.**
  A collision with three vehicles appears three times; two-wheelers (bicycles,
  e-scooters) are rows too.
- **`corpus="crashes"`: one row = one collision.**
- `vehicle_type`, `vehicle_make` and the contributing factors are free text
  with mixed casing and 3,317 / 15,191 / 70 distinct spellings. Aggregate keys
  are upper-cased so "Sedan" and "SEDAN" do not split into two groups; the
  record keeps the source spelling. The make vocabulary also changed over time
  (`HONDA` early, `HOND -CAR/SUV` in newer rows), so search a stem such as
  `hond` rather than a full make name.
- **No registration plate is in the source.** `registrationState` is the
  two-letter state where the vehicle is registered (NY 3,502,740 rows, NJ
  264,584, PA 99,382; blank on 383,551) - a registration attribute, not a
  plate, and it is published.
- This is **NYC / NYPD** collision data. It is a different source with a
  different schema from the NY State DMV crash records; do not mix the two
  counts.
- These are public collision reports. `driverSex` and `driverLicenseStatus` are
  the officer's entries on the public report; the source carries no names,
  addresses or registration plates. Not a consumer report.

### Source and licence

New York City Police Department, published on the
[NYC Open Data portal](https://data.cityofnewyork.us/Transportation/Motor-Vehicle-Collisions-Crashes/h9gi-nx95)
(public open data).

### Use it from an AI agent (MCP)

Connect any MCP client to `https://mcp.apify.com/?tools=j0401/nyc-vehicle-collisions` to load this dataset as a single tool beside the tools you already have - same records, same per-record pricing.

# Actor input Schema

## `mode` (type: `string`):

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).

## `corpus` (type: `string`):

vehicles = one row per vehicle involved (4,619,347). crashes = one row per collision (2,304,281) with location and injury counts.

## `collisionId` (type: `string`):

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` (type: `string`):

ISO date (YYYY-MM-DD). Both corpora.

## `dateTo` (type: `string`):

ISO date (YYYY-MM-DD). Both corpora.

## `contributingFactor` (type: `string`):

Case-insensitive substring, e.g. "Inattention", "Failure to Yield", "Alcohol". Both corpora (any of the factor slots).

## `borough` (type: `string`):

Crashes corpus only. e.g. BROOKLYN, QUEENS, MANHATTAN, BRONX, STATEN ISLAND. 674,893 rows carry no borough.

## `zipcode` (type: `string`):

Crashes corpus only. Exact 5-digit ZIP. Accepts ZIP+4 ("12345-6789"); matched on the 5-digit core.

## `minInjured` (type: `number`):

Crashes corpus only.

## `minKilled` (type: `number`):

Crashes corpus only.

## `vehicleType` (type: `string`):

Vehicles corpus only. Free text with 3,317 distinct spellings, e.g. "Sedan", "TAXI", "Bicycle", "Bus".

## `vehicleMake` (type: `string`):

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` (type: `string`):

Vehicles corpus only.

## `vehicleYear` (type: `string`):

Vehicles corpus only. Exact model year as filed, e.g. "2019".

## `registrationState` (type: `string`):

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` (type: `string`):

Vehicles corpus only, e.g. "Unlicensed", "Suspended", "Revoked".

## `minOccupants` (type: `number`):

Vehicles corpus only.

## `groupBy` (type: `string`):

Used only with mode=aggregate. Vehicles: vehicleType (default), vehicleMake, contributingFactor, driverLicenseStatus, travelDirection, crashYear. Crashes: borough (default), zipcode, contributingFactor, crashYear.

## `metric` (type: `string`):

count (default). vehicles also supports occupants; crashes also support injured and killed.

## `maxResults` (type: `integer`):

How many records to deliver in rows/profile mode (default 50, max 5000). Aggregate and profile modes ignore this.

## Actor input object example

```json
{
  "mode": "",
  "corpus": "vehicles",
  "groupBy": "",
  "metric": "",
  "maxResults": 50
}
```

# Actor output Schema

## `recordsUrl` (type: `string`):

NYC collision records - as JSON

## `datasetUrl` (type: `string`):

No description

## `runUrl` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("j0401/nyc-vehicle-collisions").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("j0401/nyc-vehicle-collisions").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call j0401/nyc-vehicle-collisions --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,j0401/nyc-vehicle-collisions"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/VfiBSizzoR3EZQ48h/builds/56Hw0NIs5ca1fu7HZ/openapi.json
