# Vehicle Safety Recalls by Make, Model & Year (`grit-77/vehicle-safety-recalls`) Actor

Vehicle safety recall lookup from NHTSA for supplied make, model and model-year combinations. Export recall campaign details, summaries and remedies as JSON.

- **URL**: https://apify.com/grit-77/vehicle-safety-recalls.md
- **Developed by:** [Grit](https://apify.com/grit-77) (community)
- **Categories:** Business, Other
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$0.50 / 1,000 recalls

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

## Vehicle Safety Recalls by Make, Model & Year

Check automotive inventory by make, model and year against published NHTSA recall campaigns, with structured records and direct campaign links.

### What it returns

One row per distinct campaign/component pair from the official [NHTSA vehicle recall endpoint](https://api.nhtsa.gov/recalls/recallsByVehicle?make=Toyota\&model=Camry\&modelYear=2020). The default dataset contains these fields:

| Field | Type | Meaning |
|---|---|---|
| make | string | Make reported by NHTSA |
| model | string | Model reported by NHTSA |
| modelYear | integer | Requested and verified model year |
| manufacturer | string or null | Manufacturer, when provided |
| campaignNumber | string | NHTSA recall campaign identifier |
| component | string or null | Affected component, when provided |
| reportDate | string or null | Report-received date as YYYY-MM-DD; the source's DD/MM/YYYY dates are parsed day first |
| affectedUnits | integer or null | Campaign affected-unit count, only when the endpoint provides it; never inferred from prose |
| sourceUrl | string | NHTSA campaign search link |

This actor uses automotive NHTSA recall data. FDA drug, device and food recall datasets are outside its scope. It accepts bounded vehicle names and numeric controls; it has no VIN, plate, owner, complaint, document, contact or free-text search inputs. Summaries, consequences, remedies and contact text are discarded from the result projection.

### Input

The Console prefill is:

```json
{"make":"Toyota","model":"Camry","modelYear":2020,"maxItems":10}
```

| Input | Required | Limits |
|---|---|---|
| make | yes | One NHTSA vehicle make; 1-64 characters |
| model | yes | One exact NHTSA model name; 1-64 characters |
| modelYear | yes | Integer from 1949 through the next calendar year |
| maxItems | no | Integer 1-1000; default 10; cap on returned and charged records |

Vehicle names allow letters, digits, spaces and ordinary name punctuation. URLs, line breaks, arbitrary additional keys and invalid numeric values are rejected before the data request. Prefill helps the Console form; API callers must supply the three required vehicle fields.

### Real output example

The following record comes from the local Toyota/Camry/2020 run on 2026-10-06 UTC. [sample_output.json](sample_output.json) contains 3 actual records. That run took 2.016 seconds including local process startup; this is an observation, not a performance guarantee.

```json
{
  "make": "TOYOTA",
  "model": "CAMRY",
  "modelYear": 2020,
  "manufacturer": "Toyota Motor Engineering & Manufacturing",
  "campaignNumber": "20V682000",
  "component": "FUEL SYSTEM, GASOLINE:DELIVERY:FUEL PUMP",
  "reportDate": "2020-11-04",
  "affectedUnits": null,
  "sourceUrl": "https://www.nhtsa.gov/recalls?nhtsaId=20V682000"
}
```

### Pricing

Proposed pay-per-event price: **$0.0005 per recall record**, or $0.50 per 1,000 records in recall events. The event name is **recall**. A successful dataset write is followed by one recall charge. Duplicates, malformed records, empty results and records beyond maxItems have no recall event. The actor also stops when the configured recall event budget is exhausted.

The price is proposed, not a live Store configuration. Platform usage and platform-managed fees depend on the eventual configuration. Local runs do not make cloud billing transactions. See [PRICING.md](PRICING.md) for the dated Store API evidence and the billing-unit differences between competitors.

### Limits and failure handling

Each run checks one make/model/year combination and requests the official endpoint with concurrency limited to one connection. Network errors, HTTP 429 and selected temporary server errors get at most three attempts with 1-second and 2-second backoff. NHTSA also returns HTTP 400 with its explicit successful empty envelope; that exact Count=0, success-message, empty-results shape is treated as no matching records. Other HTTP failures and invalid response envelopes fail the run explicitly; they are not converted into zero recalls.

A malformed individual source record is skipped while valid records continue. Per-item error rows are stored separately in the default key-value store's **ERRORS** record, preserving the nine-field recall dataset. **RUN_SUMMARY** records source count, delivered count, item error count, truncation and elapsed time. If all returned records are malformed, the run fails with diagnostics.

The records apply to a make/model/year, not a specific inventory vehicle or its repair status. An empty result can also mean an unlisted or misspelled model. A campaign's unit count, when available, can cover multiple models; it is not your inventory count. The sample endpoint response did not include affected-unit counts, so the sample values are null.

### FAQ

**Do I need a source API key or proxy?** The actor calls the public NHTSA endpoint directly. Its local run used no source API key or proxy.

**Does this tell me whether a particular vehicle still needs repair?** It lists published campaigns for the requested make/model/year. It does not determine vehicle-specific applicability or completed repairs.

**Why is affectedUnits null?** The endpoint did not supply a recognized unit-count field. Counts are never calculated from the summary or from the number of recall results.

**What if there are more recalls than maxItems?** The actor returns the first records in the source's order after validation and duplicate removal. RUN_SUMMARY marks truncation.

**What is billed if no records are returned?** This actor emits no recall event. Any separately configured platform fees follow Apify's configuration.

### Use with AI agents / MCP

After the owner publishes or otherwise makes the actor available, an agent can invoke it through Apify's Actors integration or MCP connection using the four input fields above. The output schema exposes the default dataset items URL. Agents should inspect run status and RUN_SUMMARY before treating an empty dataset as a no-results answer, and use sourceUrl to trace each campaign. This delivery does not implement a separate MCP server.

### Local development

The shared project venv already supplies apify, httpx and pytest. Do not install packages into it. From this actor directory, the delivered helpers run the same Python module used by the container:

```powershell
C:/GritWork/earn/.venv/Scripts/python.exe evidence/run_tests.py unit
C:/GritWork/earn/.venv/Scripts/python.exe evidence/run_tests.py live
C:/GritWork/earn/.venv/Scripts/python.exe evidence/run_local.py
apify validate-schema
```

The local helper sets APIFY_LOCAL_STORAGE_DIR to this actor's storage directory, writes storage/key_value_stores/default/INPUT.json, and runs python -m src without the Apify CLI. It also sets the SDK 4 storage alias CRAWLEE_STORAGE_DIR to that directory. Unit tests use a saved real NHTSA response; positive/malformed unit-count cases are explicitly synthetic mutations. The marked live test contacts NHTSA. [evidence/CONTRACT.md](evidence/CONTRACT.md) defines the independent process checks.

# Actor input Schema

## `make` (type: `string`):

Vehicle make as listed by NHTSA, for example Toyota. A bounded vehicle name, not a search query.

## `model` (type: `string`):

Exact NHTSA model name, for example Camry or F-150. One model per run.

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

Vehicle model year. Runtime accepts 1949 through the next calendar year.

## `maxItems` (type: `integer`):

Hard cap on returned and charged recall records. Duplicates and invalid records are excluded.

## Actor input object example

```json
{
  "make": "Toyota",
  "model": "Camry",
  "modelYear": 2020,
  "maxItems": 10
}
```

# Actor output Schema

## `dataset` (type: `string`):

Dataset containing the requested vehicle and recall campaign fields.

# 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 = {
    "make": "Toyota",
    "model": "Camry",
    "modelYear": 2020,
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("grit-77/vehicle-safety-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 = {
    "make": "Toyota",
    "model": "Camry",
    "modelYear": 2020,
    "maxItems": 10,
}

# Run the Actor and wait for it to finish
run = client.actor("grit-77/vehicle-safety-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 '{
  "make": "Toyota",
  "model": "Camry",
  "modelYear": 2020,
  "maxItems": 10
}' |
apify call grit-77/vehicle-safety-recalls --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,grit-77/vehicle-safety-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/nMn9XM4bosAEnxH8R/builds/PGP9xDilrzS4INZuL/openapi.json
