# NY Motor Vehicle Crash Records - Cases, People, Citations (`j0401/ny-crash-records`) Actor

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.

- **URL**: https://apify.com/j0401/ny-crash-records.md
- **Developed by:** [Wenhao Yang](https://apify.com/j0401) (community)
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.03 / 1,000 ny crash 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

## NY Motor Vehicle Crash Records - Cases, People, Citations

The New York State DMV crash register in four linked tables - **8.4 million records** covering every reported motor vehicle crash in the state from 2021 through 2024:

| `corpus` | Records | What it holds |
|---|---|---|
| `cases` | 1,525,123 | crash date and time, county, municipality, outcome class, collision type, lighting, weather, road surface, traffic control, event |
| `vehicles` | 2,815,916 | body type, registration class, make, model year, fuel, axles, occupants, direction, action prior to the crash, contributing factors, partial VIN |
| `individuals` | 3,604,215 | role, seating position, ejection, safety equipment, injury descriptor, location and severity, age, gender, licence state, transport |
| `violations` | 449,434 | citation code and description tied to the person |

Counts measured 2026-10-21.

### Low cost

**From $0.00005 per record, down to $0.00003 at Gold**

Pay only for the records you receive. A 50-record search costs $0.0025 at the entry tier.

### Search

```json
{
  "corpus": "cases",
  "year": 2024,
  "county": "ERIE",
  "accidentDescriptor": "Fatal Accident",
  "maxResults": 500
}
```

Every filter is pushed into the query. Filters that a table does not carry are rejected with a message naming the field.

### Profiles - the joins that exist

`vehicles` and `individuals` share `caseVehicleId`; `individuals` and `violations` share `caseIndividualId`.

```json
{
  "mode": "vehicle-profile",
  "caseVehicleId": "20775214"
}
```

Returns one row per occupant: the vehicle's full fact set, the person's role and injury profile, and every citation issued to that person in the crash.

```json
{
  "mode": "person-profile",
  "caseIndividualId": "27259754"
}
```

Returns the person, their vehicle, and their citations in one record.

### Aggregate

```json
{
  "corpus": "individuals",
  "year": 2024,
  "mode": "aggregate",
  "groupBy": "injurySeverity"
}
```

One row per group with `groupCount` and `totalMatched`. Dimensions follow the corpus: counties and crash classes for cases, makes and body types for vehicles, roles and injuries for people, codes for citations. Rollups above 5,000 groups fail loudly.

### Data notes

- The register is a **rolling four-year window**: currently 2021, 2022, 2023 and 2024.
- **The case table has no crash case identifier.** The state does not publish one, so a crash case cannot be joined to its vehicles, people or citations. Search and aggregate it on its own attributes; use the vehicle and person ids for the cross-table joins above.
- Records carry no names, street addresses or full VINs. The deepest identifier is a partial VIN (last 8 characters) on the vehicle row.
- `vehicleMake` is stored as the state's code (`TOYOT`, `HONDA`) and a large block of vehicle rows has no make recorded; those aggregate under `(not stated)`.
- Freshness is checked against each dataset's last update stamp before any record is delivered.

# Actor input Schema

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

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.

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

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

Dimension for mode=aggregate. Availability depends on the corpus.

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

Records to deliver in search mode (default 50, max 25000).

## `year` (type: `integer`):

Crash year, 2021-2024 (the source is a rolling four-year window).

## `dateFrom` (type: `string`):

Crash date start, YYYY-MM-DD (cases only; the other tables carry year only).

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

Crash date end, YYYY-MM-DD (cases only).

## `caseVehicleId` (type: `string`):

case_vehicle_id. With mode=vehicle-profile, returns the vehicle, every occupant and their citations.

## `caseIndividualId` (type: `string`):

case_individual_id. With mode=person-profile, returns the person, their vehicle and citations.

## `county` (type: `string`):

County name, e.g. "ERIE". Cases only.

## `municipality` (type: `string`):

Municipality or city name, e.g. "BUFFALO". Cases only.

## `accidentDescriptor` (type: `string`):

Crash severity class. Cases only.

## `collisionType` (type: `string`):

Collision type descriptor, e.g. "RIGHT ANGLE", "OTHER". Cases only.

## `lighting` (type: `string`):

Lighting conditions, e.g. "Daylight", "Dark-Road Lighted". Cases only.

## `weather` (type: `string`):

Weather conditions, e.g. "Clear", "Rain". Cases only.

## `roadDescriptor` (type: `string`):

Road descriptor, e.g. "Straight and Level". Cases only.

## `roadSurface` (type: `string`):

Road surface conditions, e.g. "Dry", "Wet". Cases only.

## `trafficControl` (type: `string`):

Traffic control device, e.g. "None", "Traffic Signal". Cases only.

## `eventDescriptor` (type: `string`):

Event descriptor, e.g. "Collision With Fixed Object". Cases only.

## `pedestrianAction` (type: `string`):

Pedestrian or bicyclist action. Cases only.

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

Vehicle make code as recorded, e.g. "TOYOT", "HONDA". Vehicles only.

## `vehicleBodyType` (type: `string`):

Vehicle body type, e.g. "SEDAN". Vehicles only.

## `registrationClass` (type: `string`):

Registration class, e.g. "PASSENGER OR SUBURBAN". Vehicles only.

## `fuelType` (type: `string`):

Fuel type. Vehicles only.

## `stateOfRegistration` (type: `string`):

Two-letter state of registration, e.g. "NY". Vehicles only.

## `eventType` (type: `string`):

Vehicle event type. Vehicles only.

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

Contributing factor category (HUMAN / VEHICLE / ENVIRONMENT). Vehicles only.

## `actionPrior` (type: `string`):

Action prior to the accident, e.g. "Going Straight Ahead", "Parked". Vehicles only.

## `roleType` (type: `string`):

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

Injury severity. Individuals only.

## `victimStatus` (type: `string`):

Victim status, e.g. "Apparent Death". Individuals only.

## `safetyEquipment` (type: `string`):

Safety equipment used, e.g. "Lap Belt/Harness", "Air Bag Deployed/Lap Belt/Harness". Individuals only.

## `ejection` (type: `string`):

Ejection status, e.g. "Not Ejected". Individuals only.

## `gender` (type: `string`):

M / F / U. Individuals only.

## `seatingPosition` (type: `string`):

Seating position, e.g. "Driver". Individuals only.

## `age` (type: `string`):

Age as recorded, e.g. "35". Individuals only.

## `violationCode` (type: `string`):

NY vehicle and traffic law code, e.g. "1172A". Violations only.

## `violationDescription` (type: `string`):

Case-insensitive substring of the violation description. Violations only.

## `keyword` (type: `string`):

Free text over the violation description. Violations only.

## Actor input object example

```json
{
  "corpus": "cases",
  "maxResults": 50
}
```

# Actor output Schema

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

NY crash records, profiles or aggregate rows - 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/ny-crash-records").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/ny-crash-records").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/ny-crash-records --silent --output-dataset

```

## MCP server setup

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

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/yvDCDRShWtx4W1KGx/builds/pG2PuXz58x20N96H0/openapi.json
