
You need to turn a VIN into structured year/make/model/trim/engine data you can trust, without babysitting multiple data sources or post-processing. By the end of this guide you’ll POST a VIN to a single endpoint, parse a consistent response envelope, handle timeouts and errors server-side, cache results, and understand coverage for US safety data and Dutch plates.
What this endpoint does and when to use it
The VIN Decoder endpoint accepts any 17-character VIN and returns normalized vehicle specs from NHTSA vPIC. It’s designed for server-side integrations in dealer tools, marketplaces, fleet and insurance apps, and AI agents that need authoritative specs.
- Worldwide VIN decoding; coverage is most complete for US-market vehicles.
- US safety data (recalls, owner complaints, NCAP crash ratings) are matched by make + model + year and available for the US market only.
- Dutch plates are available from RDW open data, and never include a VIN.
- This is not a vehicle history report: no title, accident, or ownership history.
Base URL for REST: https://vehicles-api.com/api/v1. Authentication is via the X-API-Key header (Authorization: Bearer also works). MCP access is available at MCP if you are building an agent that speaks the protocol.
Endpoint and official examples
Lookup: VIN Decoder
Endpoint: POST https://vehicles-api.com/api/v1/vin/decode
cURL request
curl -X POST "https://vehicles-api.com/api/v1/vin/decode" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"vin":"1HGCM82633A004352"}'
Official JSON response
{
"status": "success",
"source": "nhtsa",
"data": {
"vin": "1HGCM82633A004352",
"valid": true,
"year": 2003,
"make": "HONDA",
"model": "Accord",
"trim": "EX-V6",
"body": "Coupe",
"doors": 2,
"vehicle_type": "PASSENGER CAR",
"engine": {
"cylinders": 6,
"displacement_l": 3,
"configuration": "V-Shaped",
"model": "J30A4",
"hp": 240,
"fuel": "Gasoline"
},
"fuel_type": "Gasoline",
"electrification_level": null,
"ev_drive_unit": null,
"battery_kwh": null,
"charger_level": null,
"charger_power_kw": null,
"drive": null,
"transmission": {
"style": "Automatic",
"speeds": 5
},
"plant": {
"country": "UNITED STATES (USA)",
"city": "MARYSVILLE",
"state": "OHIO"
},
"manufacturer": "AMERICAN HONDA MOTOR CO., INC."
}
}
What you will use from the response
- Envelope: status (success or error), source (nhtsa), and data for successful decodes. On error, you receive status: error with error.code and error.message.
- Core identity: vin, valid, year, make, model, trim, body, doors, vehicle_type.
- Powertrain: engine.cylinders, engine.displacement_l, engine.configuration, engine.model, engine.hp, engine.fuel, fuel_type, transmission.style, transmission.speeds, drive (may be null if not published).
- Plant and manufacturer: plant.country, plant.city, plant.state, manufacturer.
- Electrification: electrification_level, ev_drive_unit, battery_kwh, charger_level, charger_power_kw — these may be null for non-EVs and when a field is not published by NHTSA.
Note the null fields for electrification in the example. The control VIN is a gasoline vehicle; do not assume EV fields are present. NHTSA does not publish every attribute for all models, so some fields may be null even for valid decodes.
Server-side integration: Python and PHP
Keep your API key on the server. Do not embed it in browser code or public mobile apps. Both samples below implement a network timeout and envelope-aware error handling.
Python (requests)
import requests
API_URL = "https://vehicles-api.com/api/v1/vin/decode"
API_KEY = "YOUR_API_KEY" # store securely (env var, secret manager)
VIN = "1HGCM82633A004352"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
# Alternatively: "Authorization": f"Bearer {API_KEY}"
}
try:
resp = requests.post(API_URL, json={"vin": VIN}, headers=headers, timeout=8)
resp.raise_for_status()
payload = resp.json()
except requests.exceptions.Timeout:
# Map to your retry/backoff policy
raise SystemExit("Vehicle API request timed out")
except requests.exceptions.HTTPError as e:
raise SystemExit(f"HTTP error: {e}")
except ValueError:
raise SystemExit("Non-JSON response from Vehicle API")
status = payload.get("status")
if status != "success":
err = payload.get("error", {})
code = err.get("code", "unknown_error")
message = err.get("message", "Unknown error")
raise SystemExit(f"VIN decode failed: {code} - {message}")
data = payload.get("data", {})
# Extract the fields you care about
vin = data.get("vin")
year = data.get("year")
make = data.get("make")
model = data.get("model")
trim = data.get("trim")
engine = data.get("engine", {}) or {}
transmission = data.get("transmission", {}) or {}
summary = {
"vin": vin,
"year": year,
"make": make,
"model": model,
"trim": trim,
"engine_cyl": engine.get("cylinders"),
"engine_displacement_l": engine.get("displacement_l"),
"engine_hp": engine.get("hp"),
"transmission_style": transmission.get("style"),
"transmission_speeds": transmission.get("speeds"),
}
print(summary)
PHP (cURL)
<?php
$apiUrl = "https://vehicles-api.com/api/v1/vin/decode";
$apiKey = "YOUR_API_KEY"; // store securely (env/secret), never client-side
$vin = "1HGCM82633A004352";
$ch = curl_init($apiUrl);
$payload = json_encode([ "vin" => $vin ]);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-API-Key: $apiKey",
"Content-Type: application/json"
// Alternatively: "Authorization: Bearer $apiKey"
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_TIMEOUT => 8
]);
$response = curl_exec($ch);
if ($response === false) {
$err = curl_error($ch);
curl_close($ch);
die("cURL error: $err");
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($httpCode < 200 || $httpCode >= 300) {
die("HTTP error status: $httpCode");
}
$payload = json_decode($response, true);
if (!is_array($payload)) {
die("Non-JSON response from Vehicle API");
}
if (($payload["status"] ?? null) !== "success") {
$code = $payload["error"]["code"] ?? "unknown_error";
$message = $payload["error"]["message"] ?? "Unknown error";
die("VIN decode failed: $code - $message");
}
$data = $payload["data"] ?? [];
$result = [
"vin" => $data["vin"] ?? null,
"year" => $data["year"] ?? null,
"make" => $data["make"] ?? null,
"model" => $data["model"] ?? null,
"trim" => $data["trim"] ?? null,
"engine_cyl" => $data["engine"]["cylinders"] ?? null,
"engine_displacement_l" => $data["engine"]["displacement_l"] ?? null,
"engine_hp" => $data["engine"]["hp"] ?? null,
"transmission_style" => $data["transmission"]["style"] ?? null,
"transmission_speeds" => $data["transmission"]["speeds"] ?? null
];
print_r($result);
Response envelope, errors, and nulls
Every response uses a consistent envelope so you can centralize error handling:
- Success: status: "success", source: "nhtsa", data: {...vehicle fields...}
- Error: status: "error", error.code, error.message
Do not assume a field is present. When the upstream does not publish a value, that field is null (for example, electrification_level for non-EVs). Always null-check nested fields like engine and transmission before accessing properties, or use a default empty object to avoid type errors.
Caching, retries, and quotas
VIN data is stable. Cache decoded VINs at your edge or database tier with a long TTL (e.g., weeks or months). When you cache by VIN, you reduce latency and save quota for endpoints that do change (such as recalls), which you can refresh on a schedule by year/make/model.
- Timeouts: set an application-level timeout (examples use 8 seconds). Implement an exponential backoff retry for transient network errors, not for 4xx responses.
- Idempotency: VIN decoding is read-only; safe to retry on network failures.
- Rate limits and monthly quota: enforced per account. Check your dashboard and the Documentation for current limits. Handle HTTP 429 with backoff.
- Server-side only: keep X-API-Key out of client apps. If you need client access, proxy via your server.
Field usage patterns for dealer tools, marketplaces, fleets, and agents
- Inventory intake: Use vin, year, make, model, trim, body, doors, and vehicle_type to standardize listings from disparate sources.
- Pricing and search facets: engine.cylinders, engine.displacement_l, engine.hp, transmission.style/speeds are high-signal facets.
- Regulatory and safety context (US-only): join by year/make/model to your recall, complaints, and NCAP queries if you use those endpoints elsewhere in your stack.
- Manufacturing metadata: plant and manufacturer can improve matching logic when multiple trims share a VIN pattern.
- EV handling: If electrification_level is null, do not present EV-specific UI. If present, use battery_kwh and charger_power_kw to derive range or charging filters. Always guard for null.
Coverage notes you should wire into your UX
- VIN decoding works worldwide. Attribute depth is fullest for US-market vehicles from NHTSA vPIC. For some vehicles, drive, trim, or engine model may be null.
- US safety data (recalls, complaints, NCAP ratings) are matched by make + model + year and apply to the US market only.
- Dutch plates come from RDW open data and never include a VIN. If your flow starts from a Dutch plate, design for a plate-to-specs path without backfilling VIN.
- This service does not provide title, accident, or ownership history. Do not label it as a vehicle history report.
Security, observability, and MCP
- Authentication: X-API-Key is the primary method; Authorization: Bearer is also accepted. Rotate keys periodically and store them in your secret manager.
- Logging: log request IDs and VINs at info level; never log secrets. Redact keys in application logs.
- Metrics: track success vs. error counts by error.code to identify validation issues vs. upstream unavailability.
- Agents and tools: if you’re building an AI agent, connect over the MCP server at MCP to structure VIN decoding and safety lookups as tools with strongly typed results.
Putting it in production
Suggested workflow
- Validate VIN length/charset (17 chars, uppercase alphanumeric) before calling.
- POST to /vin/decode with a request timeout and retry-once policy for transient failures.
- Check payload.status. On success, persist data keyed by VIN. On error, branch by error.code (e.g., invalid_vin vs. quota_exceeded) for user messaging and alerting.
- Cache decoded results. Invalidate only if you detect upstream schema or data changes that affect your UX.
- Internationalization: present units as returned (e.g., displacement_l as liters, hp as horsepower). If you convert units, do so consistently and store the original values.
- Downstream joins: for US-market safety data, query by year/make/model, not the VIN, as those datasets are published at model-year granularity.
Error handling patterns
- HTTP 4xx: do not retry. Surface error.code/error.message and prompt for correction (e.g., malformed VIN) or show a quota message.
- HTTP 5xx/network: retry with exponential backoff (e.g., 250 ms, 1 s), then fail open to cached data if available.
- JSON parse errors: treat as transient; log and retry once unless repeated.
- Null fields: treat as “unknown,” not “absent.” Avoid defaulting to incorrect values in UI or ML features.
Quick reference
- Base URL: https://vehicles-api.com/api/v1
- VIN Decoder: POST /vin/decode
- Auth: X-API-Key: YOUR_API_KEY (or Authorization: Bearer YOUR_API_KEY)
- Response: envelope with status, source, data on success; status error with error.code and error.message on failure
- Coverage: VIN decode worldwide (fullest for US-market); US safety data only; Dutch plates from RDW without VIN
For full parameter and field notes, see the Documentation.
FAQ
Does the decoder accept any 17-character VIN?
Yes. VIN decoding works worldwide; completeness is highest for US-market vehicles. Some fields may be null when not published by NHTSA.
Can I look up US plates?
Do not rely on US plate lookup; it is not live. Dutch plates are supported via RDW, and RDW plate data does not include the VIN.
How are recalls, complaints, and NCAP ratings matched?
By make + model + year for US-market vehicles. They are not VIN-specific and are outside the VIN decode response.
How should I cache results?
Cache by VIN with a long TTL. The decode result is stable. Refresh only if you change schema mapping or need to backfill fields that were previously null.
Where do I find my rate limits and monthly quota?
Limits are enforced per account. Check your dashboard and the API docs. Handle HTTP 429 by backing off before retrying.
Start with the VIN Decoder in minutes and keep your key server-side. Every plan includes a 7-day free trial. Register and integrate using the samples above, or explore the Documentation for more endpoints and field details.