
You need a predictable way to turn a 17-character VIN into structured specs you can trust. By the end of this guide you will post a VIN to a single endpoint, read back year/make/model/trim plus engine, transmission, and assembly plant details, understand nulls and units, and handle errors, rate limits, and caching so your dealer tools, marketplaces, fleet, insurance apps, or AI agents stay fast and reliable.
Endpoint, authentication, and envelope
VIN decoding is a POST to a single JSON endpoint on Vehicle API:
- Base URL: https://vehicles-api.com/api/v1
- Endpoint: POST /vin/decode
- Auth: X-API-Key: YOUR_API_KEY header (Authorization: Bearer YOUR_API_KEY also works)
- Body: JSON with a single vin field
Every response uses the same envelope:
- On success: status, source, data
- On error: status, error.code, error.message
Coverage notes you should build around:
- VIN decoding works worldwide; coverage is fullest for US-market vehicles. Fields the source (NHTSA vPIC) does not publish return null.
- US recalls, owner complaints, and NCAP crash ratings are available separately and matched by make + model + year. They are US-market only.
- Dutch plates (RDW) are supported via other endpoints and never include a VIN.
- This is not a vehicle history report (no title, accident, or ownership history).
See the Documentation for the complete reference, rate limits, and monthly quota details.
Official request and response you can copy
The following request and response come directly from the official docs. The control VIN (1HGCM82633A004352) is a 2003 Honda Accord. Use this to validate your integration flow before wiring your own inputs.
cURL
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 example
{
"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."
}
}
Field-by-field: what you will actually use
- data.vin: Echo of the VIN submitted. Use for idempotent logging and cache keys.
- data.valid: Boolean VIN checksum/format validity. If false, do not trust downstream fields.
- data.year, data.make, data.model, data.trim: Primary identity for display, inventory matching, and normalizing feed records.
- data.body, data.doors, data.vehicle_type: Form factor and regulatory class. Helpful for fitment, search filters, and pricing rules.
- data.engine.*:
- cylinders: Count (integer).
- displacement_l: Liters (L).
- configuration: e.g., Inline, V-Shaped.
- model: Manufacturer engine code (e.g., J30A4).
- hp: Horsepower (SAE, as published by NHTSA when available).
- fuel: Fuel type string.
- data.fuel_type: Canonicalized top-level fuel type.
- data.electrification_level, data.ev_drive_unit, data.battery_kwh, data.charger_level, data.charger_power_kw: EV/PHEV fields. Null for ICE vehicles or when data is not published. Units:
- battery_kwh: kilowatt-hours (kWh)
- charger_power_kw: kilowatts (kW)
- data.drive: Drivetrain (FWD, RWD, AWD) when published; null otherwise.
- data.transmission.style: Transmission type (Automatic/Manual/Other).
- data.transmission.speeds: Number of forward gears (integer).
- data.plant.country, city, state: Assembly plant location fields. Strings as published.
- data.manufacturer: Certified name as reported to NHTSA.
Nulls are expected whenever NHTSA does not publish a given attribute for that VIN/year/make/model. Handle null defensively and avoid substituting guesses.
Language example: Python
This Python snippet calls the same endpoint, checks the response envelope, and extracts the fields you are most likely to index and display. Replace YOUR_API_KEY with your key.
import requests
API_BASE = "https://vehicles-api.com/api/v1"
API_KEY = "YOUR_API_KEY"
def decode_vin(vin: str) -> dict:
url = f"{API_BASE}/vin/decode"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
}
resp = requests.post(url, headers=headers, json={"vin": vin}, timeout=10)
data = resp.json()
if data.get("status") != "success":
err = data.get("error", {})
raise RuntimeError(f"VIN decode failed: {err.get('code')} - {err.get('message')}")
return data
def normalize_vehicle_fields(payload: dict) -> dict:
d = payload["data"]
eng = d.get("engine") or {}
trans = d.get("transmission") or {}
plant = d.get("plant") or {}
return {
"vin": d.get("vin"),
"valid": d.get("valid"),
"year": d.get("year"),
"make": d.get("make"),
"model": d.get("model"),
"trim": d.get("trim"),
"body": d.get("body"),
"doors": d.get("doors"),
"vehicle_type": d.get("vehicle_type"),
"engine_cylinders": eng.get("cylinders"),
"engine_displacement_l": eng.get("displacement_l"),
"engine_configuration": eng.get("configuration"),
"engine_model": eng.get("model"),
"engine_hp": eng.get("hp"),
"fuel_type": d.get("fuel_type"),
"drive": d.get("drive"),
"trans_style": trans.get("style"),
"trans_speeds": trans.get("speeds"),
"plant_country": plant.get("country"),
"plant_city": plant.get("city"),
"plant_state": plant.get("state"),
"manufacturer": d.get("manufacturer"),
# EV-related fields (may be None for ICE vehicles)
"electrification_level": d.get("electrification_level"),
"ev_drive_unit": d.get("ev_drive_unit"),
"battery_kwh": d.get("battery_kwh"),
"charger_level": d.get("charger_level"),
"charger_power_kw": d.get("charger_power_kw"),
}
if __name__ == "__main__":
payload = decode_vin("1HGCM82633A004352")
vehicle = normalize_vehicle_fields(payload)
print(vehicle)
Handling nulls, coverage, and units correctly
Nulls indicate one of two things: the source does not publish the field for that VIN, or the field is not applicable (e.g., EV battery_kwh for an ICE vehicle). Do not coerce null to a default string like “Unknown” unless it’s a UX requirement; keeping nulls in your domain model makes future data backfills straightforward.
VIN decoding works worldwide and relies on NHTSA vPIC; US-market vehicles are typically the most complete. Expect occasional nulls for regional trims or market-specific specifications. For EVs and PHEVs, use battery_kwh (kWh) and charger_power_kw (kW) as numeric values and surface charger_level as a display string.
US recalls, owner complaints, and NCAP ratings can be queried separately by make + model + year. These datasets are US-only and refreshed as data sources publish updates, independent of the VIN decode response.
Errors, edge cases, and how to respond
Always branch on the response envelope’s status field. If it is not success, inspect error.code and error.message. Below are realistic, complete examples you can use in testing your error handling:
Example: invalid VIN format (length/checksum)
{
"status": "error",
"error": {
"code": "invalid_vin",
"message": "VIN must be 17 characters and pass checksum validation."
}
}
Example: rate limit exceeded
{
"status": "error",
"error": {
"code": "rate_limited",
"message": "Rate limit exceeded. Please retry after the window resets."
}
}
Example: temporary upstream unavailability
{
"status": "error",
"error": {
"code": "upstream_unavailable",
"message": "NHTSA source temporarily unavailable. Please retry."
}
}
Recommended client behavior:
- invalid_vin: Surface a clear message to the user and disable submit until a 17-character VIN is entered.
- rate_limited: Implement exponential backoff with jitter and respect retry-after guidance if provided by headers. Consider local cache hits to avoid repeat calls.
- upstream_unavailable: Retry with short backoff. If you have a cache entry for the same VIN, serve it while queuing a background refresh.
Rate limits and monthly quotas depend on your plan; do not hardcode assumptions. Refer to the Documentation for current values and burst behavior.
Performance, caching, and reliability
VIN decodes are deterministic for a given VIN. Cache by VIN key for at least the life of your session and preferably across sessions to minimize latency, cost, and rate-limit pressure. A typical approach:
- Local LRU cache for hot paths (UI/agent prompting) to absorb immediate repeats.
- Persistent store (Redis, SQL) keyed by VIN with a long TTL (e.g., weeks). Invalidate only if upstream data model changes or you detect a misdecode.
- Deduplicate in-flight decode requests to avoid stampedes under concurrency.
Nulls should be stored as null in your cache; do not backfill with placeholders, which can make it harder to detect when a source starts publishing new values.
Use timeouts on client calls and circuit breakers to protect upstream dependencies. When status is error, do not cache the envelope as a success; cache only successful decodes.
MCP server option for AI agents
In addition to the REST endpoint, Vehicle API is available as an MCP server at MCP. If you are building an AI agent that tools into VIN decoding, MCP provides a native capability integration over the same underlying datasets and semantics. The response fields and coverage constraints are equivalent to the REST API: VIN decoding is worldwide with fullest coverage for US-market vehicles, while US safety datasets are matched by make + model + year.
Practical integration: mapping to your domain
Most dealer, marketplace, fleet, and insurance apps normalize a subset of the decode for indexing, pricing, and fitment. A minimal mapping that performs well in search facets and spec sheets looks like this:
- Identity: year, make, model, trim, vin
- Form: body, doors, vehicle_type
- Powertrain: engine.cylinders, engine.displacement_l, engine.hp, fuel_type, drive, transmission.style, transmission.speeds
- Provenance: plant.country, plant.city, plant.state, manufacturer
- EV-specific: electrification_level, battery_kwh, charger_level, charger_power_kw
If you combine VIN decode with US safety datasets, use the canonicalized make, model, and year from the decode to query those endpoints, understanding those datasets are US-only and may not exist for non-US models even if the VIN decodes.
Additional complete JSON examples for testing
Use these examples to validate your envelope parsing and error branches in automated tests.
Success envelope with null drivetrain
{
"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."
}
}
Error envelope: malformed JSON body
{
"status": "error",
"error": {
"code": "bad_request",
"message": "Request body must be valid JSON with a 'vin' field."
}
}
Error envelope: unauthorized
{
"status": "error",
"error": {
"code": "unauthorized",
"message": "Missing or invalid API key."
}
}
Operational considerations: quotas, retries, and logging
Quotas and rate limits are enforced per plan. Treat hard limits as guardrails and implement:
- Client request timeouts and retry budgets to avoid unbounded waits.
- Backoff with jitter on transient errors (rate_limited, upstream_unavailable) and no retry on permanent errors (invalid_vin, bad_request, unauthorized).
- Structured logs that include vin, status, source, and error.code so you can search incidents quickly.
If you process bulk VINs, throttle to remain under your rate window and deduplicate within a batch to avoid hitting the endpoint repeatedly for the same VIN. The decode is not paginated; each POST handles one VIN per request. For detailed rate-limit numbers and monthly allocations, consult the Documentation.
FAQ
Does VIN decoding include accident, title, or ownership history?
No. VIN decoding returns vehicle specifications and identifiers. It is not a vehicle history report.
Are recalls, complaints, and NCAP ratings included in the same response?
No. VIN decode is separate. Those US datasets are matched by make + model + year and are US-market only.
Why are some fields null for certain VINs?
Null means the source does not publish that attribute for the VIN or it is not applicable. Handle nulls without substituting guessed values.
Can I use the MCP server instead of REST?
Yes. The MCP server at MCP exposes the same VIN decoding capability for AI agents.
What are the rate limits and monthly quota?
They vary by plan. Check the Documentation for current values and enforcement behavior.
Ready to ship your integration? Starter is $19/mo and every plan includes a 7-day free trial. Get your API key now and start decoding VINs in minutes: Register. Explore the rest of Vehicle API at vehicles-api.com and wire in the MCP server for agents at MCP.
