API reference
VIN decoding
POST /vin decodes a Vehicle Identification Number: check digit, region and model year locally, plus make, model, trim, body, engine and plant from NHTSA vPIC.
https://api.qelka.com/v1/vinDecode a Vehicle Identification Number (VIN) to learn whether it is well formed, where and when the vehicle was made, and its make, model, trim, body, engine and assembly plant. Each lookup costs 1 credit, valid or not; errors and test keys are never billed.
Request
Send the 17-character VIN. The structure, check digit, region and model year are decoded on our servers; the vehicle details come from vPIC, the decoder of the U.S. National Highway Traffic Safety Administration (NHTSA).
vinstringRequiredfreshbooleanDefault falsetrue skips the 30-day result cache and asks vPIC again.The call waits for vPIC, so every snippet sets a 30-second client timeout.
curl https://api.qelka.com/v1/vin \
--max-time 30 \
-H "Authorization: Bearer $QELKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"vin": "1HGCM82633A004352"}'
const response = await fetch('https://api.qelka.com/v1/vin', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ vin: '1HGCM82633A004352' }),
signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os
import requests
api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
"https://api.qelka.com/v1/vin",
headers={"Authorization": f"Bearer {api_key}"},
json={"vin": "1HGCM82633A004352"},
timeout=30,
)
result = response.json()
print(result)
<?php
$ch = curl_init('https://api.qelka.com/v1/vin');
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Authorization: Bearer ' . getenv('QELKA_API_KEY'),
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode(['vin' => '1HGCM82633A004352']),
CURLOPT_TIMEOUT => 30,
]);
$result = json_decode(curl_exec($ch), true);
print_r($result);
package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
"os"
"time"
)
func main() {
payload, _ := json.Marshal(map[string]any{"vin": "1HGCM82633A004352"})
request, _ := http.NewRequest(http.MethodPost, "https://api.qelka.com/v1/vin", bytes.NewReader(payload))
request.Header.Set("Authorization", "Bearer "+os.Getenv("QELKA_API_KEY"))
request.Header.Set("Content-Type", "application/json")
client := &http.Client{Timeout: 30 * time.Second}
response, err := client.Do(request)
if err != nil {
panic(err)
}
defer response.Body.Close()
var result map[string]any
if err := json.NewDecoder(response.Body).Decode(&result); err != nil {
panic(err)
}
fmt.Println(result)
}
require 'json'
require 'net/http'
uri = URI('https://api.qelka.com/v1/vin')
request = Net::HTTP::Post.new(uri)
request['Authorization'] = "Bearer #{ENV.fetch('QELKA_API_KEY')}"
request['Content-Type'] = 'application/json'
request.body = JSON.generate({ vin: '1HGCM82633A004352' })
response = Net::HTTP.start(uri.host, uri.port, use_ssl: true, read_timeout: 30) do |http|
http.request(request)
end
result = JSON.parse(response.body)
puts result
Response
Every VIN gets a 200, valid or not. Read valid first; vehicle is filled when vPIC knows the vehicle.
idstringlkp_ followed by 26 characters.objectstringvin.inputstringvin you sent, without surrounding spaces.validbooleantrue when the VIN has 17 allowed characters and, for North American manufacturers, a correct check digit.statusstringvalid or invalid.reasonstring or nullinvalid_length, invalid_characters or invalid_check_digit. null when the VIN is valid.vinstring or nullnull when it is not 17 characters long.wmiobject or nullnull, like vds, vis, check_digit, model_year, plant_code and serial_number, when the VIN is not 17 allowed characters.wmi.codestringwmi.regionstringafrica, asia, europe, north_america, oceania or south_america, from the first character: A to H Africa, J to R Asia, S to Z Europe, 1 to 5 North America, 6 and 7 Oceania, 8, 9 and 0 South America (ISO 3780 zones).wmi.small_manufacturerbooleantrue when the third character is 9: small manufacturers share the code and are told apart by positions 12 to 14.vdsstring or nullvisstring or nullcheck_digitobject or nullcheck_digit.valuestringcheck_digit.expectedstringcheck_digit.validbooleantrue when value equals expected.check_digit.requiredbooleantrue for North American manufacturers, which must use the check digit.model_yearobject or nullmodel_year.codestringmodel_year.candidatesarray of integersmodel_year.estimateinteger or nullplant_codestring or nullserial_numberstring or nullvehicleobject or nullnull when vPIC has no make, model or year for the VIN, or was not asked because the VIN is not 17 allowed characters. Each field inside is null when vPIC has no value.vehicle.makestring or nullHONDA.vehicle.modelstring or nullAccord.vehicle.model_yearinteger or nullmodel_year.estimate when both exist.vehicle.trimstring or nullvehicle.seriesstring or nullvehicle.body_classstring or nullCoupe.vehicle.vehicle_typestring or nullPASSENGER CAR.vehicle.doorsinteger or nullvehicle.drive_typestring or nullvehicle.fuel_typestring or nullvehicle.engineobjectvehicle.engine.cylindersinteger or nullvehicle.engine.displacement_lnumber or nullvehicle.engine.horsepowernumber or nullvehicle.engine.configurationstring or nullV-Shaped.vehicle.engine.modelstring or nullvehicle.transmissionobjectvehicle.transmission.stylestring or nullAutomatic.vehicle.transmission.speedsinteger or nullvehicle.manufacturerstring or nullvehicle.plantobjectvehicle.plant.citystring or nullvehicle.plant.statestring or nullvehicle.plant.countrystring or nullvehicle.plant.companystring or nullvehicle.gvwrstring or nullnhtsaobject or nullnull when vPIC was not asked or returned nothing.nhtsa.error_codesarray of strings0 means the VIN decoded clean; other codes flag a wrong check digit, an incomplete decode or an unknown manufacturer.nhtsa.messagestring or nullcredits_usedinteger0 with a test key.cachedbooleantrue when the answer came from the 30-day cache.{
"id": "lkp_01M85RBTDRPFW1TC1KY1CSMHRJ",
"object": "vin",
"input": "1HGCM82633A004352",
"valid": true,
"status": "valid",
"reason": null,
"vin": "1HGCM82633A004352",
"wmi": { "code": "1HG", "region": "north_america", "small_manufacturer": false },
"vds": "CM826",
"vis": "3A004352",
"check_digit": { "value": "3", "expected": "3", "valid": true, "required": true },
"model_year": { "code": "3", "candidates": [2003], "estimate": 2003 },
"plant_code": "A",
"serial_number": "004352",
"vehicle": {
"make": "HONDA",
"model": "Accord",
"model_year": 2003,
"trim": "EX-V6",
"series": null,
"body_class": "Coupe",
"vehicle_type": "PASSENGER CAR",
"doors": 2,
"drive_type": null,
"fuel_type": "Gasoline",
"engine": { "cylinders": 6, "displacement_l": 3, "horsepower": 240, "configuration": "V-Shaped", "model": "J30A4" },
"transmission": { "style": "Automatic", "speeds": 5 },
"manufacturer": "AMERICAN HONDA MOTOR CO., INC.",
"plant": { "city": "MARYSVILLE", "state": "OHIO", "country": "UNITED STATES (USA)", "company": null },
"gvwr": "Class 1C: 4,001 - 5,000 lb (1,814 - 2,268 kg)"
},
"nhtsa": {
"error_codes": ["0"],
"message": "0 - VIN decoded clean. Check Digit (9th position) is correct"
},
"credits_used": 1,
"cached": false
}
Act on the result
status |
reason |
What it means | What to do |
|---|---|---|---|
valid |
null |
17 allowed characters and, for a North American manufacturer, a correct check digit. | Use vehicle when it is filled. When it is null, the VIN is well formed but vPIC does not know the vehicle. |
invalid |
invalid_length |
Not 17 characters once spaces and hyphens are removed. | Ask for the VIN again. |
invalid |
invalid_characters |
A character VINs never use: I, O, Q, or anything other than letters and digits. |
Ask for the VIN again: an O is probably a 0, an I a 1. |
invalid |
invalid_check_digit |
Position 9 does not match the other characters, for a North American manufacturer. | Ask the user to check each character: it is usually a typo. |
Every answer is billed 1 credit, including invalid VINs. A VIN describes a vehicle, never its owner.
How the check digit works
Position 9 is computed from the 16 other characters, as 49 CFR 565.15 specifies. Each letter gets a value (A = 1 to H = 8, J = 1 to N = 5, P = 7, R = 9, S = 2 to Z = 9), each position a weight (8, 7, 6, 5, 4, 3, 2, 10, 0, 9, 8, 7, 6, 5, 4, 3, 2), and the weighted sum is divided by 11. The remainder is the check digit, written X when it is 10.
U.S. rules make the check digit mandatory, and North American manufacturers apply it. Elsewhere, position 9 is not always a check digit. So invalid_check_digit is only reported when the first character is 1 to 5 (North America). For other VINs a mismatch shows in check_digit.valid, and valid stays true.
How the model year is read
Position 10 is a code that repeats every 30 years:
| Code | Years | Code | Years |
|---|---|---|---|
A |
1980, 2010 | S |
1995, 2025 |
B |
1981, 2011 | T |
1996, 2026 |
C |
1982, 2012 | V |
1997, 2027 |
D |
1983, 2013 | W |
1998, 2028 |
E |
1984, 2014 | X |
1999, 2029 |
F to H |
1985 to 1987, 2015 to 2017 | Y |
2000, 2030 |
J to N |
1988 to 1992, 2018 to 2022 | 1 to 9 |
2001 to 2009, 2031 to 2039 |
P, R |
1993, 1994, 2023, 2024 |
For North American manufacturers, the API picks the cycle from position 7, the rule 49 CFR 565.15 sets for passenger cars, multipurpose passenger vehicles and trucks of 10,000 lb or less: a digit means 1980 to 2009, a letter 2010 to 2039. For other VINs the estimate is the most recent matching year. Outside North America position 10 is not always a year, so treat model_year.estimate as a hint there.
Where the data comes from
The local decoding follows 49 CFR Part 565 and the ISO 3780 regions. Vehicle details come from NHTSA vPIC, a public U.S. Government service built from the data manufacturers file with NHTSA. vPIC covers vehicles made for the U.S. market: other VINs often decode partially or not at all, and vehicle is then null. See the data sources page.
Spot a letter VINs never use
This VIN has a letter O where a zero belongs. The API answers at once without calling vPIC, and the answer is billed because the check ran.
curl https://api.qelka.com/v1/vin \
--max-time 30 \
-H "Authorization: Bearer $QELKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"vin": "1HGCM82633A0O4352"}'
const response = await fetch('https://api.qelka.com/v1/vin', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ vin: '1HGCM82633A0O4352' }),
signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os
import requests
api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
"https://api.qelka.com/v1/vin",
headers={"Authorization": f"Bearer {api_key}"},
json={"vin": "1HGCM82633A0O4352"},
timeout=30,
)
result = response.json()
print(result)
{
"id": "lkp_01M8714DYDTVQ8XFRVNFDDR2TA",
"object": "vin",
"input": "1HGCM82633A0O4352",
"valid": false,
"status": "invalid",
"reason": "invalid_characters",
"vin": "1HGCM82633A0O4352",
"wmi": null,
"vds": null,
"vis": null,
"check_digit": null,
"model_year": null,
"plant_code": null,
"serial_number": null,
"vehicle": null,
"nhtsa": null,
"credits_used": 1,
"cached": false
}
Test without calling vPIC
Test keys decode the VIN on our servers and return a sample vehicle, make TEST MAKE, without calling vPIC. With a test key in QELKA_API_KEY, this request returns:
curl https://api.qelka.com/v1/vin \
--max-time 30 \
-H "Authorization: Bearer $QELKA_API_KEY" \
-H "Content-Type: application/json" \
-d '{"vin": "1HGCM82633A004352"}'
const response = await fetch('https://api.qelka.com/v1/vin', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.QELKA_API_KEY}`,
'Content-Type': 'application/json',
},
body: JSON.stringify({ vin: '1HGCM82633A004352' }),
signal: AbortSignal.timeout(30_000),
})
const result = await response.json()
console.log(result)
import os
import requests
api_key = os.environ["QELKA_API_KEY"]
response = requests.post(
"https://api.qelka.com/v1/vin",
headers={"Authorization": f"Bearer {api_key}"},
json={"vin": "1HGCM82633A004352"},
timeout=30,
)
result = response.json()
print(result)
{
"id": "lkp_01M8714EVPB58KPCJ0K935XXMY",
"object": "vin",
"input": "1HGCM82633A004352",
"valid": true,
"status": "valid",
"reason": null,
"vin": "1HGCM82633A004352",
"wmi": { "code": "1HG", "region": "north_america", "small_manufacturer": false },
"vds": "CM826",
"vis": "3A004352",
"check_digit": { "value": "3", "expected": "3", "valid": true, "required": true },
"model_year": { "code": "3", "candidates": [2003], "estimate": 2003 },
"plant_code": "A",
"serial_number": "004352",
"vehicle": {
"make": "TEST MAKE",
"model": "TEST MODEL",
"model_year": null,
"trim": null,
"series": null,
"body_class": null,
"vehicle_type": "PASSENGER CAR",
"doors": null,
"drive_type": null,
"fuel_type": null,
"engine": { "cylinders": null, "displacement_l": null, "horsepower": null, "configuration": null, "model": null },
"transmission": { "style": null, "speeds": null },
"manufacturer": null,
"plant": { "city": null, "state": null, "country": null, "company": null },
"gvwr": null
},
"nhtsa": {
"error_codes": ["0"],
"message": "0 - Simulated decode of 1HGCM82633A004352 for a test key."
},
"credits_used": 0,
"cached": false
}
Errors
| Status | Type | When |
|---|---|---|
| 400 | invalid_request | vin is missing, empty or longer than 40 characters, the body is not a JSON object, or it has a field the request table does not list |
| 401 | invalid_api_key | The key is missing, unknown or revoked |
| 402 | insufficient_credits | Your balance is less than 1 credit (live keys only) |
| 403 | forbidden | The key is restricted to other endpoints |
| 405 | invalid_request | The method is not POST |
| 429 | rate_limited | Too many requests: wait Retry-After seconds |
| 500 | internal_error | Unexpected error on our side: retry with backoff |
| 502 | upstream_unavailable | NHTSA vPIC could not be reached, answered with an error or did not answer in time: retry later |
No error is billed. A VIN that fails a check is not an error: it is a 200 with valid: false.
Related
- VIN decoder API
- Free tool: VIN decoder
- Batch: up to 100 VINs in one call, each item with
type: "vin" - Bulk: a whole file of VINs with
type=vin - Caching, Errors, Test mode