
A VIN entered into a dealer tool or fleet application may contain a typo before you ever try to decode it. By the end of this guide, you can call Vehicle API’s VIN validation endpoint, interpret its check-digit result, and distinguish a valid format from evidence that a vehicle or its history exists.
Send a VIN for validation
Vehicle API validates the VIN’s format and its ISO 3779 check digit. The calculation runs locally within the service, without an upstream data-provider call. The ninth character is the check digit.
Send a JSON object containing the vin field to the validation endpoint. The following request uses the documentation’s control VIN, which corresponds to a 2003 Honda Accord; it is not the VIN of the reader’s car.
curl -X POST "https://vehicles-api.com/api/v1/vin/validate" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"vin":"1HGCM82633A004352"}'
Replace YOUR_API_KEY with your own key when running the request. The documented authentication method is the X-API-Key header; Authorization Bearer authentication also works. Keep the key in server-side configuration rather than embedding it in a public client.
Use validation as an input check, not as a substitute for decoding. A passing check-digit calculation does not establish that the VIN was issued, that it is attached to a particular vehicle, or that the vehicle’s details match a listing.
Read the response field by field
The official response for the control VIN is:
{
"status": "success",
"source": "local",
"data": {
"vin": "1HGCM82633A004352",
"valid": true,
"check_digit": "3"
}
}
The response is an envelope: inspect status and source, then read the validation result inside data.
statusissuccessin this example. An error response instead hasstatusset toerror, with details undererror.codeanderror.message.sourceislocalhere. It identifies the local validation calculation; it is not a claim that the VIN was checked against a vehicle registry.data.vinis the VIN associated with the result. Retain it alongside the input being processed so the result cannot be attributed to the wrong vehicle record.data.validis the Boolean result to use for the validation decision. The example’struemeans the supplied VIN passes the format and check-digit validation.data.check_digitis the check-digit value, represented as a string. In the example it is"3", corresponding to the ninth character of the control VIN.
These fields do not contain a measurement, currency, timestamp, or timezone. In particular, treat check_digit as a character value, not as a quantity with units. The response does not provide a decoded make or model, recall information, or a vehicle history.
Use the exact key valid when reading the decision. Do not substitute the presence of a check_digit, a successful response envelope, or the source value for that Boolean. A successful API operation and a VIN passing validation are separate decisions.
Call the endpoint from Python
This example uses Python’s standard library to send the same control VIN and read the response. It checks the envelope before accessing the result and treats a missing or null valid value as an indeterminate result, not as a pass.
import json
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen
url = "https://vehicles-api.com/api/v1/vin/validate"
payload = {"vin": "1HGCM82633A004352"}
request = Request(
url,
data=json.dumps(payload).encode("utf-8"),
headers={
"X-API-Key": "YOUR_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):
raise SystemExit("Request failed; response was not valid JSON.")
except URLError as exc:
raise SystemExit("Could not reach the validation service.") from exc
if result.get("status") == "error":
error = result.get("error") or {}
raise SystemExit(
f"API error: {error.get('code')} — {error.get('message')}"
)
if result.get("status") != "success":
raise SystemExit("Unexpected response status.")
data = result.get("data") or {}
valid = data.get("valid")
print("Source:", result.get("source"))
print("VIN:", data.get("vin"))
print("Check digit:", data.get("check_digit"))
if valid is True:
print("VIN passed validation.")
elif valid is False:
print("VIN did not pass validation.")
else:
print("Validation result is unavailable.")
For an actual integration, supply the VIN from the vehicle record being processed rather than leaving the control VIN in place. The sample distinguishes true, false, and an unavailable value; collapsing the last two can make a service or parsing problem look like a bad VIN.
The error branch reads the documented error.code and error.message fields when an error envelope is available. Handle network failures separately from API errors, and avoid logging the API key with request details. Consult the Documentation for current error details.
Understand what validation does not tell you
Validation checks the supplied string; it does not decode the vehicle. Vehicle API also offers VIN decoding using NHTSA vPIC data, including year, make, model, trim, engine, transmission, and assembly plant. Decoding works worldwide, but the returned detail is fullest for US-market vehicles.
Decoded fields may be null when data is unavailable. Preserve that distinction in your application: an unavailable engine or trim value is not proof that a vehicle lacks one. Display an appropriate unavailable state and avoid filling a null field with a guessed value.
Official US safety data has a narrower scope than VIN decoding. Recalls, owner complaints, and NCAP crash ratings cover US-market vehicles only and are matched by make, model, and year. A validation pass does not establish that safety data exists for the vehicle, and a safety-data match should not be presented as a vehicle-specific history.
Dutch plate data comes from RDW open data, and Dutch plate responses never include a VIN. If your workflow begins with a Dutch plate, do not expect to extract a VIN from that response and automatically submit it to this validation endpoint. Obtain the VIN separately when validation is needed.
Vehicle API is not a vehicle history report: it does not provide title, accident, or ownership history. Keep that boundary clear in dealer listings, insurance workflows, and agent responses, especially when a valid VIN is shown next to decoded or safety information.
Operate the integration
Validation is computed locally, but API rate limits and your plan’s monthly quota still matter to your integration. Check the current limits for your account and plan in the documentation rather than assuming a particular request allowance. Starter is $19 per month, and every plan has a seven-day free trial.
When an error response arrives, record its error.code and error.message for diagnosis. Apply retry or backoff behavior according to the current documentation and the error received; do not treat every failure as an invalid VIN. A network failure, an authentication problem, or a quota issue requires a different user-facing response from a completed validation that returns valid: false.
Cache decoded VIN data when repeated lookups would otherwise retrieve the same vehicle details. Choose a refresh policy for your application rather than assuming cached upstream data is permanently current. Keep the cached validation decision distinct from decoded fields and from safety data, whose underlying campaigns and counts can change as NHTSA publishes updates.
For null handling, preserve the raw distinction between an explicit false result and unavailable data. Your application can ask a user to correct a VIN after a definite validation failure, but it should report an unavailable result when it cannot make that decision. This prevents transient failures from becoming incorrect data-quality flags.
For agent workflows, Vehicle API also provides an MCP server. Apply the same interpretation there: validation is a format and check-digit check, not confirmation of a vehicle’s identity or history.
FAQ
Does a valid VIN prove that the vehicle exists?
No. valid: true means the submitted value passed the endpoint’s format and check-digit validation. It does not prove issuance, ownership, or a match to a particular vehicle.
What does source: local mean?
The validation calculation is performed locally by the service, without an upstream call. It does not mean that the result came from NHTSA, RDW, or a vehicle registry.
Can I use the result to retrieve US safety data for any vehicle?
No. Recalls, complaints, and NCAP ratings cover US-market vehicles and are matched by make, model, and year. The validation response itself does not supply those safety results.
What should I do if a decoded field or validation result is null?
Treat it as unavailable, not as a negative answer or a value to infer. For validation, make a pass-or-fail decision only when valid is an explicit Boolean.
Ready to test the endpoint with your own application? Register to start the seven-day free trial, then replace the control VIN with a VIN supplied by your workflow.
