# NHTSA VIN Decode and Model-Year Recall Counts (`hopeful_crabgrass/nhtsa-vehicle-recalls`) Actor

Batch-decodes VINs with NHTSA vPIC and joins each decode to official NHTSA recall flat files by make, model, and model year. Recall counts are not VIN-specific and are not a safety, legal, or insurance finding.

- **URL**: https://apify.com/hopeful_crabgrass/nhtsa-vehicle-recalls.md
- **Developed by:** [Juan Marcos](https://apify.com/hopeful_crabgrass) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 90.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

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

## NHTSA VIN Decode and Model-Year Recall Counts

Batch-decodes VINs with NHTSA vPIC and joins each decode to official NHTSA recall flat files by make, model, and model year. Recall counts are not VIN-specific and are not a safety, legal, or insurance determination.

### What it does

It sends batches of up to 50 VINs to the official vPIC `DecodeVINValuesBatch` endpoint and matches each successful decode against NHTSA’s official recall flat files (`FLAT_RCL_POST_2010.zip` and `FLAT_RCL_PRE_2010.zip` on `static.nhtsa.gov`). It does not call `api.nhtsa.gov`.

Output is a count of campaigns for that make, model, and model year, plus the latest report-received date, campaign numbers, and whether any of those campaigns are marked do-not-drive or park-outside. Defect narratives and complaint text are not emitted.

`latestRecallDate` is the official `RCDATE` field (the date the report was received), not the manufacturer notification date.

Zip files are cached on disk for reuse **within the same run** only (for example, one download served many VIN batches). On the Apify platform each run starts a fresh container, so the zips are downloaded again at the start of the run.

Source: NHTSA (U.S. government data). No licence is stated on the recall flat files; attribution given as a courtesy.

Default run memory is 256 MB (maximum 512 MB). The recall index is stored in SQLite so a typical run stays within that default.

### Input

| Field | Default | Description |
| --- | --- | --- |
| `vins` | (required) | Array of VIN strings |
| `modelYear` | empty | Optional model-year hint passed to vPIC |
| `maxVins` | `1000` | Hard cap, maximum 1,000 |

Invalid VINs and decode-missing rows are pushed so you can see what was skipped, and they are not billed.

### Pricing

Pay-per-event. The primary event is `vin-processed` at **$0.002** per valid VIN row that is decoded and pushed. Invalid and decode-missing rows are written with no charge. The platform also bills a synthetic `apify-actor-start` event automatically; this Actor does not call `Actor.charge()` for that event. If the user sets a maximum total charge, the Actor stops when a charge is refused or the remaining budget cannot cover another billed result.

### Support

Contact via the Apify Store Issues tab.

# Actor input Schema

## `vins` (type: `array`):

Up to 1,000 VIN strings. Invalid VINs (not 17 characters, or containing I, O, or Q) are returned as status=invalid and are not charged. Required for a live run.

## `modelYear` (type: `integer`):

If set, passed to vPIC for every VIN in the batch. Leave 0 to omit the hint.

## `maxVins` (type: `integer`):

Hard cap on VINs processed in this run. Default 1000, maximum 1000.

## Actor input object example

```json
{
  "vins": [
    "1HGCM82633A004352",
    "WBA3A5C59CF256802",
    "JN1AZ4EH8DM430111"
  ],
  "modelYear": 0,
  "maxVins": 5
}
```

# Actor output Schema

## `results` (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 = {
    "vins": [
        "1HGCM82633A004352",
        "WBA3A5C59CF256802",
        "JN1AZ4EH8DM430111"
    ],
    "maxVins": 5
};

// Run the Actor and wait for it to finish
const run = await client.actor("hopeful_crabgrass/nhtsa-vehicle-recalls").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 = {
    "vins": [
        "1HGCM82633A004352",
        "WBA3A5C59CF256802",
        "JN1AZ4EH8DM430111",
    ],
    "maxVins": 5,
}

# Run the Actor and wait for it to finish
run = client.actor("hopeful_crabgrass/nhtsa-vehicle-recalls").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 '{
  "vins": [
    "1HGCM82633A004352",
    "WBA3A5C59CF256802",
    "JN1AZ4EH8DM430111"
  ],
  "maxVins": 5
}' |
apify call hopeful_crabgrass/nhtsa-vehicle-recalls --silent --output-dataset

```

## MCP server setup

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

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/s41YKsf2fBbPJ0uZx/builds/clV2JT5nBZPGfTGTC/openapi.json
