# VIN decoder API (`njoylab/vin-decoder-api`) Actor

Decode and validate VINs at scale. Extract WMI/manufacturer, country/region, model year,
plant, and sequence. ISO 3779 check digit with configurable policy (auto/require/ignore).
Accepts an array of VINs, outputs a structured dataset with validity views.

- **URL**: https://apify.com/njoylab/vin-decoder-api.md
- **Developed by:** [njoylab](https://apify.com/njoylab) (community)
- **Categories:** Automation, Integrations, Other
- **Stats:** 38 total users, 2 monthly users, 100.0% runs succeeded, 2 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.50 / 1,000 results

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

### VIN Extractor

Decode and validate Vehicle Identification Numbers (VINs) at scale. The Actor accepts an array of VINs and returns structured details such as manufacturer (WMI), model year, plant, country/region, and check‑digit status. When available, it enriches results.

### Usage

Provide input in Apify Console (or via API) as JSON:

```json
{
  "vins": [
    "1HGCM82633A004352",
    "WBA3A5C50DF123456"
  ]
}
```

Console output example (sectioned format):

```
Processing 2 VIN(s)...

VIN: 1HGCM82633A004352
Valid: yes
Structure valid: yes
Identity: WMI=1HG  VDS=CM8263  VIS=3A004352
Origin: USA | Manufacturer=Honda
Model: Make=Honda | Model=Accord | Year=2003 | Type=Passenger Car | Body=Sedan | Doors=4
Build: Plant=A | Sequence=004352
Check digit: expected=3 actual=3 (match; required=yes)
```

#### Check digit policy

Control how the check digit affects validity using `checkDigitPolicy` in INPUT:

```json
{
  "vins": ["VF1ABCD12C1234567"],
  "checkDigitPolicy": "auto" // one of: auto | require | ignore
}
```

- `auto` (default): required only for North America (1–5).
- `require`: required for all VINs (invalid if mismatch).
- `ignore`: never required (validity based on structure only; mismatch still shown).

#### Output

One dataset item per VIN with these key fields (non‑exhaustive):

- `vin`: Original VIN; `wmi`, `vds`, `vis`.
- `valid`: Overall validity per policy; `invalid` (inverse).
- `validStructure`: Length/charset checks; `validCheckDigit`: Check‑digit match; `checkDigitRequired` (true/false).
- `checkDigit.expected`, `checkDigit.actual`, `checkDigit.match`.
- `manufacturer`, `country`, `countryCode` (2‑char, if resolved), `region`, `origin` (country or region).
- `year` (model year), `plant` (11th char), `sequence` (last 6).
- Enrichment (when available): `make`, `model`, `vehicleType`, `bodyClass`, `doors`.
- `extra`: the full grouped decode (object of groups and fields).

##### Example dataset item

```json
{
  "vin": "5YJSA1E14HF000001",
  "valid": false,
  "validStructure": true,
  "checkDigitRequired": true,
  "wmi": "5YJ",
  "vds": "SA1E14",
  "vis": "HF000001",
  "checkDigit": {
    "expected": "8",
    "actual": "4",
    "match": false
  },
  "validCheckDigit": false,
  "region": "North America",
  "country": "United States",
  "manufacturer": "TESLA, INC.",
  "year": 2017,
  "plant": "F",
  "sequence": "000001",
  "origin": "United States",
  "countryCode": "5Y",
  "make": "Tesla",
  "model": "Model S",
  "vehicleType": "Passenger Car",
  "bodyClass": "Hatchback/Liftback/Notchback",
  "doors": "5",
  "extra": {
    "General": {
      "Make": "Tesla",
      "Manufacturer Name": "TESLA, INC.",
      "Model": "Model S",
      "Model Year": "2017",
      "Plant City": "FREMONT",
      "Vehicle Type": "Passenger Car",
      "Plant Country": "UNITED STATES (USA)",
      "Plant State": "CALIFORNIA"
    },
    "Exterior / Body": {
      "Body Class": "Hatchback/Liftback/Notchback",
      "Doors": "5"
    },
    "Engine": {
      "Fuel Type - Primary": "Electric",
      "Electrification Level": "BEV (Battery Electric Vehicle)",
      "Other Engine Info": "Single Motor - Standard"
    }
  }
}
```

Output views

- Overview: General details and errors.
- Validity: Focus on `validStructure`, `validCheckDigit`, `checkDigitRequired`.
- Invalid VINs: Quick triage of failures and mismatches.

#### Notes & Limitations

- Check digit per ISO 3779; requirement per region/policy as above.
- Manufacturer resolution via WMI tables, broad but not exhaustive.
- Country resolution prefers 2‑char prefix when available, then first‑char region fallback.

#### Categories

- Data extraction
- Validation
- Automotive / VIN decoding
- Data quality & compliance

# Actor input Schema

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

Array of VINs (17 characters, no I/O/Q)

## `checkDigitPolicy` (type: `string`):

How to treat the VIN check digit when computing validity.

## `onlyValid` (type: `boolean`):

When true, only push results for VINs with a matching check digit.

## Actor input object example

```json
{
  "vins": [
    "WBA3A5C50DF123456",
    "WAUZZZ8K5DA123456"
  ],
  "checkDigitPolicy": "auto",
  "onlyValid": false
}
```

# Actor output Schema

## `dataset` (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("njoylab/vin-decoder-api").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("njoylab/vin-decoder-api").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 njoylab/vin-decoder-api --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,njoylab/vin-decoder-api"
        }
    }
}
```

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/6DXfkxLK4i13pmr1a/builds/2cK3imaACCYHdd4H7/openapi.json
