VIN Model Year API Documentation

By Vehicle API
VIN Model Year API Documentation

A vehicle listing or fleet record may need a model year before a developer can display consistent specifications or match US safety data. This guide shows how to submit a 17-character VIN, read the year field from Vehicle API’s response, and handle authentication, missing values, and integration limits.

Request the model year from a VIN

Vehicle API decodes a VIN through POST https://vehicles-api.com/api/v1/vin/decode. The JSON request contains a vin field, and a successful response places the decoded model year in data.year.

Illustration: VIN Model Year API Documentation

Get an API key from the dashboard and send it in the X-API-Key header. Authorization Bearer also works, but the examples here use X-API-Key. Keep the key on your server or in another protected environment rather than distributing it in client-side code.

The following request uses the documentation’s control VIN. It identifies a 2003 Honda Accord; replace the VIN with the vehicle you need to decode when integrating the request into your application.

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

The decoder accepts 17-character VINs worldwide, with the fullest results for US-market vehicles. The VIN is the input to the decode; the year returned by the API is the vehicle’s model year, not a date of registration or a record of ownership.

Read the response envelope and year

Every successful response has an envelope containing status, source, and data. The official response for the request above is:

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

For a model-year integration, the fields to read first are:

  • status identifies the response as successful. Check it before treating data as a decoded vehicle.
  • source is nhtsa in this example. VIN decoding uses NHTSA vPIC data.
  • data.vin identifies the VIN associated with the result, while data.valid reports the validity value returned by the decoder.
  • data.year is the model year. It is a JSON number in this example, so applications can store and compare it as a year rather than parsing it from a display string.
  • data.make and data.model provide the other vehicle identifiers needed alongside the year when matching US safety data.

The remaining fields help describe the decoded vehicle. For example, trim, body, and doors can enrich a listing; transmission and plant contain nested details. The engine’s displacement_l is in liters and hp is horsepower. Battery capacity and charger power, when available, use kWh and kW respectively.

Fields NHTSA does not publish come back as null. In this gasoline-car example, the electrification fields are null; drive is also null. Treat null as an unavailable value, not as zero, an empty string, or proof of a particular specification.

Use the model year in Python

This example calls the same endpoint with Python’s standard library. It checks the response status, reads the decoded year with make and model, and reports the documented error information when an HTTP request fails.

import json
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen

url = "https://vehicles-api.com/api/v1/vin/decode"
api_key = "YOUR_API_KEY"
payload = json.dumps({"vin": "1HGCM82633A004352"}).encode("utf-8")

request = Request(
url,
data=payload,
headers={
"X-API-Key": api_key,
"Content-Type": "application/json",
},
method="POST",
)

try:
with urlopen(request) as response:
result = json.load(response)
except HTTPError as exc:
try:
result = json.load(exc)
except (ValueError, UnicodeDecodeError):
print("Request failed with HTTP status:", exc.code)
else:
error = result.get("error") or {}
print("HTTP status:", exc.code)
print("Error code:", error.get("code"))
print("Message:", error.get("message"))
except URLError as exc:
print("Connection failed:", exc.reason)
else:
if result.get("status") != "success":
error = result.get("error") or {}
print("Error code:", error.get("code"))
print("Message:", error.get("message"))
else:
vehicle = result.get("data") or {}
year = vehicle.get("year")
if year is None:
print("Model year is unavailable")
else:
print("Model year:", year)
print("Make:", vehicle.get("make"))
print("Model:", vehicle.get("model"))
print("Source:", result.get("source"))

Before running the sample, substitute your dashboard key for YOUR_API_KEY. In a deployed service, supply that key through protected configuration instead of committing it to the application’s source code. The sample’s VIN is the control vehicle, so its output does not describe a different vehicle a user may have entered.

Use data.year directly rather than extracting the year from the VIN yourself. If the field is null or absent in a response, keep the year unknown and decide how your application should ask for or otherwise handle the missing information. Likewise, check nested objects and their fields before displaying optional specifications.

Handle errors, limits, and cached results

An error response has status set to an error state and provides error.code and error.message. Keep these separate from the success path: an error does not provide a decoded model year to display.

  • 401, invalid_api_key: Check the key obtained from the dashboard and the authentication header being sent.
  • 403, no_active_plan: Check the account’s plan status before retrying the integration.
  • 422: The input is invalid. Check the submitted vin and use the returned error message to help diagnose the request.

Do not repeatedly retry an unchanged invalid VIN or an unchanged authentication configuration. Surface a useful message to the caller, while keeping the API key out of application logs and user-visible errors. A connection failure is different from an API error envelope, so handle network exceptions separately, as the Python example does.

Requests are subject to rate limits and a monthly quota. Check your account and the Documentation for the limits and current guidance applicable to your plan; do not assume a particular request allowance or reset schedule. Monitor usage and avoid sending a new decode for every page view of the same vehicle.

Cache decoded results by VIN when your application will reuse them. Store the model year with the VIN and, if useful for your workflow, the returned source and other decoded fields. Choose a refresh policy appropriate to your application rather than assuming cached source data can never change.

Keep missing values distinct from actual values in the cache. If a field is null, displaying “unknown” or omitting it is safer than supplying a default. A later refresh may return different published information, so make sure your application can update cached fields without treating a previous null as a permanent vehicle attribute.

Apply the year within the right coverage

Vehicle API’s VIN decoder works worldwide, but its NHTSA vPIC data is fullest for US-market vehicles. A successful decode does not guarantee that every specification is available. Design listing and fleet screens so they remain useful when trim, drivetrain, or other optional details are missing.

Official US recall campaigns, owner complaints, and NCAP crash ratings are US-market data. They are matched by make, model, and year, rather than being presented here as a VIN-specific history. Preserve the returned make, model, and year together if your application needs that safety-data context.

A model-year match should not be described as proof that a particular vehicle was affected by a campaign or that a specific repair was performed. Similarly, a complaint or crash rating associated with a make, model, and year is not an account of an individual vehicle’s use. Source publications can change, so a cached decode and separately retrieved safety data may need different refresh policies.

Dutch plate data comes from RDW open data, but Dutch plate responses never include a VIN. Do not assume a plate lookup can supply a VIN for this decode request. Vehicle API is also not a vehicle history report: it does not provide title, accident, or ownership history.

For an AI agent that needs vehicle data, Vehicle API also provides an MCP server. Apply the same distinction between decoded vehicle attributes and US-market safety data when presenting an agent’s result.

FAQ

Which field contains the VIN model year?

Read data.year after confirming that status indicates success. The official control VIN returns 2003; that value belongs to the example Honda Accord, not necessarily to a vehicle submitted by your user.

Can I decode a VIN from outside the United States?

Yes. The decoder accepts 17-character VINs worldwide, although the available data is fullest for US-market vehicles. Handle null fields instead of assuming every vehicle has the same level of detail.

Does the model year identify a vehicle’s recall history?

No. US recalls are matched using make, model, and year; that match is not a vehicle-specific repair or ownership history. Complaints and NCAP ratings have the same US-market coverage boundary.

What should I do when the year or another field is null?

Treat it as unavailable and keep it separate from zero or a guessed value. Your application can omit the field, show it as unknown, or request additional information through its own workflow.

Ready to test the model-year decode with your own VINs? Register to start a 7-day free trial. Starter is $19 per month, and every plan includes the trial.

Keep reading