# Vehicle Emissions Test Lookup (VIN + State) (`kevinserver24/vehicle-emissions-test-lookup`) Actor

For a VIN and a US state (plus county, where needed): does this vehicle need an emissions/smog test here? Decodes the VIN live via NHTSA's free vPIC service and joins it against a bundled ruleset covering all 50 states + DC. Charged only when confirmed.

- **URL**: https://apify.com/kevinserver24/vehicle-emissions-test-lookup.md
- **Developed by:** [Kevin](https://apify.com/kevinserver24) (community)
- **Categories:** Automation, Developer tools
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$100.00 / 1,000 emissions check delivereds

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?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
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.
Actors are written with capital "A".

## 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.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## Vehicle Emissions Test Lookup (VIN + State)

*An independent tool. It is not affiliated with, endorsed by, or operated by
NHTSA, any US state government, or any state DMV/environmental agency. The
VIN decode is read live from NHTSA's own free vPIC service; each state's
emissions-testing rule is a periodically refreshed bundle built from public
sources, cited and dated in `data/emissions_rules.json`.*

**The VIN decode is live, on every run — the state rule is a bundle.** A
VIN's model year, make and fuel type never change, so there is nothing to
bundle there; a state's testing rule changes at most every few years, so
re-parsing fifty different government sites inside every customer run would
buy nothing. See `witnesses.py` for how drift in the bundle is actually
caught.

***

### Why this exists

Someone buying a used car, registering an out-of-state vehicle, or running
a small used-car lot faces one binary question with real cost if answered
wrong: does this specific vehicle need an emissions/smog test before it can
be registered here? The rules are free and public, but scattered — a
different state agency for each of the roughly 28 states (and often a
specific COUNTY within that state) that still test, each with its own
vehicle-age exemption and fuel-type exemption. No lookup found on the Apify
store answers this for a specific VIN today (see `DOSSIER.md`, "WHY IT IS
RELEVANT"). This Actor answers it in one call: decode the VIN, apply the
right state's (and county's) rule, done.

### What you get per row

| Field | Meaning |
|---|---|
| `vin`, `state`, `county_given` | What you asked about |
| `decoded_model_year`, `decoded_make`, `decoded_vehicle_type`, `decoded_fuel_category` | Read live from NHTSA's vPIC decode |
| `state_has_program` | Whether this state runs any emissions-testing program at all |
| `program_scope` | `statewide`, `county` or `null` (no program) |
| `covered_counties` | The counties this state restricts testing to, when it does |
| `test_required` | `true`, `false`, or `null` when the answer could not be confirmed (see `determination_basis`) |
| `determination_basis` | The specific reason: `required`, `state_no_program`, `vehicle_too_new`, `vehicle_too_old`, `fuel_type_exempt`, `county_not_covered`, `county_required_not_given`, `county_list_unconfirmed`, `county_partial_verify_zip`, or `decode_failed` |
| `test_frequency` | `annual`, `biennial`, etc., when a test is required |
| `source_url`, `data_as_of` | Where the state rule bundle came from, and when it was last checked |
| `charged` / `not_charged_reason` | Whether this row cost you anything, and why not if it did not |

### Coverage — read this before you rely on it

**v1 covers all 50 states + DC.** 28 of them currently run some form of
emissions/smog testing; the rest report a confident `test_required: false`
(`state_no_program`). Of the 28, county-level detail is fully sourced for
27; **California and Pennsylvania's own official sources give only a count
of covered counties (41 of 58, and 25 of 67), never a list** — for those
two, a lookup returns `test_required: null` rather than a guessed answer,
naming exactly which two government pages to check by hand.

**Out of scope for v1:** heavy-duty/commercial GVWR-based rules, and
diplomatic, military, farm-plate or other special-plate exemptions beyond
what each state's general passenger-vehicle rule already states. `hybrid`
is treated as `gasoline` unless a state's own rule names hybrids
specifically (none of the 28 currently does).

***

### Input

```json
{
  "lookups": [
    {"vin": "1HGCM82633A004352", "state": "NY", "county": ""},
    {"vin": "1FTFW1ET1BFC00001", "state": "GA", "county": "Fulton"}
  ]
}
```

Up to 20 vehicles per run. `county` is optional but required to get a
confirmed answer in a county-restricted state — omit it and you get a free,
indeterminate row naming the covered counties instead.

### Output

```json
{
  "vin": "1HGCM82633A004352",
  "state": "NY",
  "county_given": "",
  "decoded_model_year": 2003,
  "decoded_make": "HONDA",
  "decoded_vehicle_type": "PASSENGER CAR",
  "decoded_fuel_category": "gasoline",
  "state_has_program": true,
  "program_scope": "statewide",
  "covered_counties": [],
  "test_required": false,
  "determination_basis": "vehicle_too_old",
  "test_frequency": "annual",
  "source_url": "https://en.wikipedia.org/wiki/Vehicle_inspection_in_the_United_States",
  "data_as_of": "2026-08-29",
  "charged": false,
  "not_charged_reason": ""
}
```

A `SUMMARY.json` lands in the key-value store with how many vehicles were
requested, determined, indeterminate, charged and free.

# Actor input Schema

## `lookups` (type: `array`):

Each item: `vin` (the vehicle's 17-character VIN) and `state` (the 2-letter USPS code where it is registered). `county` is optional but resolves the answer in the ~28 states that restrict emissions testing to specific counties -- without it, those states return an indeterminate result (free, never charged) naming which counties are covered. Up to 20 vehicles per run.

## Actor input object example

```json
{
  "lookups": [
    {
      "vin": "1HGCM82633A004352",
      "state": "NY",
      "county": ""
    },
    {
      "vin": "1FTFW1ET1BFC00001",
      "state": "GA",
      "county": "Fulton"
    }
  ]
}
```

# Actor output Schema

## `results` (type: `string`):

One row per requested item, with the full decoded and joined answer.

## `resultsCsv` (type: `string`):

The same rows as a spreadsheet.

## `summary` (type: `string`):

How many vehicles were requested, determined, indeterminate, charged and free.

# 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 = {
    "lookups": [
        {
            "vin": "1HGCM82633A004352",
            "state": "NY",
            "county": ""
        },
        {
            "vin": "1FTFW1ET1BFC00001",
            "state": "GA",
            "county": "Fulton"
        }
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kevinserver24/vehicle-emissions-test-lookup").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 = { "lookups": [
        {
            "vin": "1HGCM82633A004352",
            "state": "NY",
            "county": "",
        },
        {
            "vin": "1FTFW1ET1BFC00001",
            "state": "GA",
            "county": "Fulton",
        },
    ] }

# Run the Actor and wait for it to finish
run = client.actor("kevinserver24/vehicle-emissions-test-lookup").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 '{
  "lookups": [
    {
      "vin": "1HGCM82633A004352",
      "state": "NY",
      "county": ""
    },
    {
      "vin": "1FTFW1ET1BFC00001",
      "state": "GA",
      "county": "Fulton"
    }
  ]
}' |
apify call kevinserver24/vehicle-emissions-test-lookup --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,kevinserver24/vehicle-emissions-test-lookup"
        }
    }
}

```

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/8AFa0hrzWHP8FxZnv/builds/2JUy9Apikx5CFNFLk/openapi.json
