VIN Decoder API Documentation

By Vehicle API
VIN Decoder API Documentation

A VIN alone is not enough for a dealer tool or fleet app to display structured vehicle specifications. By the end of this guide, you can call the Vehicle API VIN decoder, read its response envelope, handle missing fields and errors, and cache results without treating a decode as a vehicle history report.

Make a VIN decode request

The VIN Decoder accepts a 17-character VIN and returns vehicle attributes sourced from NHTSA vPIC. Decoding works worldwide, with the fullest information generally available for US-market vehicles. A successful decode can include the year, make, model, trim, engine, transmission and assembly plant.

Illustration: VIN Decoder API Documentation

The endpoint is POST https://vehicles-api.com/api/v1/vin/decode. Get an API key from your Vehicle API dashboard and send it in the X-API-Key header; Authorization Bearer also works. The base URL is https://vehicles-api.com/api/v1.

Replace YOUR_API_KEY with your dashboard key before running this request. The VIN shown is the documentation’s control VIN for a 2003 Honda Accord, not necessarily the vehicle your application’s user wants to decode.

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"}'

Send the user’s VIN as the vin value in your application. Validate that input is present and has 17 characters before making the request, but still handle the API’s invalid-input response: a length check alone is not a substitute for the decoder’s validation.

Read the response envelope

The official response below shows the control VIN. Every response uses an envelope: a successful response has status, source and data; an error response has an error status with error.code and error.message.

{
    "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."
    }
}

Check status before reading data. In this example, source is nhtsa, and data.vin identifies the VIN that was decoded. The valid field is true for this example; it should not be treated as evidence of a clean title, accident-free history or current ownership.

Use year, make and model for the primary vehicle label. trim, body, doors and vehicle_type can add detail when available. Preserve the returned values rather than assuming every vehicle will have the same level of detail as the control VIN.

The nested engine object contains specifications including cylinders, displacement_l, configuration, model, hp and fuel. Displacement is in liters and hp is horsepower. fuel_type is also available at the vehicle-data level.

transmission.style and transmission.speeds describe the transmission. The plant object identifies the assembly country, city and state when supplied, while manufacturer identifies the manufacturer in the decoded data.

The example is a gasoline car, and its electrification fields are null. That includes electrification_level, ev_drive_unit, battery_kwh, charger_level and charger_power_kw; drive is also null. A null value means the field has no published value in the response, not zero or a specification your application should infer.

Use the decoder from Python

This example uses the requests library and calls the same endpoint as the curl request. It checks the response envelope before accessing vehicle data and prints a small set of fields suitable for a vehicle label.

import requests

url = "https://vehicles-api.com/api/v1/vin/decode"
headers = dict(
X_API_Key="YOUR_API_KEY"
)
headers = {"X-API-Key": headers["X_API_Key"]}

response = requests.post(
url,
headers=headers,
json=dict(vin="1HGCM82633A004352"),
timeout=30,
)

try:
payload = response.json()
except requests.exceptions.JSONDecodeError:
response.raise_for_status()
raise

if payload.get("status") == "error":
error = payload.get("error") or {}
raise RuntimeError(
f"Vehicle API error: {error.get('code')} - {error.get('message')}"
)

response.raise_for_status()

if payload.get("status") != "success":
raise RuntimeError("Unexpected Vehicle API response status")

vehicle = payload["data"]
print("Source:", payload.get("source"))
print("VIN:", vehicle.get("vin"))
print("Valid:", vehicle.get("valid"))
print("Year:", vehicle.get("year"))
print("Make:", vehicle.get("make"))
print("Model:", vehicle.get("model"))
print("Trim:", vehicle.get("trim"))

engine = vehicle.get("engine") or {}
print("Engine displacement in liters:", engine.get("displacement_l"))

For production, load the API key from a secure configuration rather than committing it to source control. The sample’s timeout is a client-side setting, not an API limit. Handle connection failures and timeouts in the calling application as well as errors returned in the response envelope.

The example uses get for optional display fields and falls back to an empty engine object when needed. In a user interface, display an unavailable value as such or omit it; avoid converting null to zero. For example, a missing engine displacement is different from an engine with zero liters of displacement.

Handle errors, limits and caching

Use both the HTTP status and the error envelope when deciding what to do next. The documented errors most relevant to this integration are:

  • 401, invalid_api_key: Check the key from the dashboard and the authentication header. A user cannot fix this by changing the VIN.
  • 403, no_active_plan: Check the account’s plan status before retrying the request.
  • 422, invalid input: Return an actionable validation message to the user and let them correct the VIN. Inspect error.code and error.message for the returned error details.

Keep the key on a trusted backend where possible. Do not expose it in a browser application or include it in user-visible error messages. Log enough information to diagnose the response, but avoid logging the key.

Account for both rate limits and the monthly quota when designing a bulk import or a user-facing lookup. Check the current plan details for the limits that apply to your account; do not assume that a successful trial or a particular subscription includes an unlimited number of requests. Starter is $19 per month, and every plan has a 7-day free trial.

Cache successful decoded VIN results to avoid requesting the same specifications repeatedly. Key the cached record by VIN and retain the response source alongside the data, so the application can identify where the specifications came from. Choose a refresh policy appropriate to your product and allow a refresh when current source data matters; no fixed cache lifetime is assumed here.

Separate a cached decode from the result of a failed request. An authentication, plan or input error should not become a saved vehicle specification. If a user corrects a VIN, look up the corrected value rather than continuing to show a result cached for the previous input.

Understand what a VIN decode covers

A decode describes attributes available from NHTSA vPIC for the submitted VIN. The worldwide scope does not mean every field is populated for every vehicle. In particular, US-market vehicles generally have the fullest data, and fields NHTSA does not publish return null.

Vehicle API also offers official US safety data for recall campaigns, owner complaints and NCAP crash ratings. These datasets cover US-market vehicles only and are matched by make, model and year. They should not be presented as proof that a particular VIN has an open recall, that a specific vehicle was involved in a complaint, or that its individual crash performance was measured.

For Dutch plates, Vehicle API uses RDW open data, and a plate result never includes a VIN. A plate result therefore cannot be used as a source for a VIN to send to this decoder. Obtain the VIN independently when a VIN decode is required.

Neither the VIN decode nor the associated safety data is a vehicle history report. They do not provide title, accident or ownership history. Make that distinction visible wherever a user could mistake decoded specifications or model-level safety data for the history of one car.

For an agent-based integration, Vehicle API also provides an MCP server. The same distinction between decoded specifications and vehicle history matters when an agent summarizes results.

FAQ

Can I decode a VIN from outside the United States?

Yes. The decoder works with 17-character VINs worldwide, although US-market vehicles generally have the fullest data. Design for null fields and varying levels of detail.

Why are battery and charger fields null?

The control VIN is a gasoline vehicle, and its electrification fields are null in the example. More generally, a field that NHTSA does not publish comes back null; do not replace it with an assumed value.

Does a successful decode include recalls for that individual vehicle?

No. The decode returns vehicle specifications. Vehicle API’s US recall, complaint and NCAP data is matched by make, model and year, not presented as an individual vehicle history.

What should I do if the request returns 401 or 403?

For 401 invalid_api_key, verify the dashboard key and authentication header. For 403 no_active_plan, check that the account has an active plan. Consult the Documentation for current integration details.

Register to start a 7-day free trial, get a dashboard API key and test the VIN decoder with your application’s vehicles.