Use this guide if your client calls api.carapi.dev/v1/vin-decode to identify a vehicle. Start with make, model, and fuel type. Test more detailed fields against the markets you serve.
Prerequisites
- Keep a CarAPI.dev token with VIN Decode access to run the before request. Check your quota in the CarAPI.dev dashboard.
- Get a CarsXE account and API key. Confirm that your account can make International VIN Decoding requests and has sufficient credits or quota. Keep both keys on the server and redact query strings from logs.
- Pick VINs from the countries and vehicle classes your app serves. The example below covers an international decode. Evaluate Specifications for US-market vehicles.
Choose the CarsXE endpoint
| Workflow | CarAPI.dev | CarsXE | Fit |
|---|---|---|---|
| Identify a non-US vehicle from its VIN | GET https://api.carapi.dev/v1/vin-decode/{vin} with a 17-character VIN in the path and token in the query | GET https://api.carsxe.com/v1/international-vin-decoder with vin and key in the query | Partial match. The core vehicle fields overlap. Response structure, coverage, and technical details differ. |
| Read registration date, actual color, or plate from the VIN decode | specifications.registrationDate, specifications.color, plateNumber | No direct field in the international VIN response | Unsupported in this workflow. Keep a registration source where these fields are required. |
CarAPI.dev documents US and European VIN coverage. International VIN Decoding returns the fields available for the specific VIN and market. Listing search, inspection reports, financing, and ownership-cost estimates are outside this VIN migration. CarAPI.dev VIN Decode reference · CarsXE International VIN Decoding
Before and after
CarAPI.dev. Set CARAPI_TOKEN to your key. The response excerpt is based on CarAPI.dev's published example.
curl --get 'https://api.carapi.dev/v1/vin-decode/WBAKU210X00R62021' \
--data-urlencode "token=${CARAPI_TOKEN}"{
"vin": "WBAKU210X00R62021",
"specifications": {
"make": "BMW",
"model": "X6",
"fuel": "petrol",
"enginePower": 225,
"enginePowerUnit": "kW"
}
}CarsXE. Set CARSXE_API_KEY to the literal YOUR_CARSXE_API_KEY to try the public sample VIN. For a coverage check, repeat both requests on the same VIN with real keys.
curl --get 'https://api.carsxe.com/v1/international-vin-decoder' \
--data-urlencode "key=${CARSXE_API_KEY}" \
--data-urlencode 'vin=WF0MXXGBWM8R43240'{
"success": true,
"attributes": {
"make": "Ford",
"model": "Galaxy",
"year": "2008",
"fuel_type": "Diesel",
"body": "Wagon"
}
}Map the response fields
| Application field | CarAPI.dev | CarsXE | Migration change |
|---|---|---|---|
| VIN | vin (string) | input.vin (string) | Keep the requested VIN in your application record. |
| Make and model | specifications.make, specifications.model (strings) | attributes.make, attributes.model (strings when present) | Read from attributes and review spelling differences before joining to a catalog. |
| Fuel and body | specifications.fuel, specifications.bodyStyle (strings when present) | attributes.fuel_type, attributes.body (strings when present) | Partial match. Normalize vocabulary, such as petrol and gasoline, to your own enums. |
| Model year | First registration date is a separate field | attributes.year (string when present) | Use the model year as its own field. Keep first registration date unknown if you lack a registration source. |
| Engine power | specifications.enginePower (number or null) and enginePowerUnit (string or null) | No power or unit field | Unsupported. Keep kW unknown unless a separate source supplies a value and its unit. |
Adapt your client and test failures
Move the VIN from the path into the query string and change token to key. Read the identity fields from attributes and return a no-result state on 404.
async function decodeInternationalVin(vin, key) {
const url = new URL("https://api.carsxe.com/v1/international-vin-decoder");
url.search = new URLSearchParams({ key, vin }).toString();
const response = await fetch(url, { signal: AbortSignal.timeout(10_000) });
if (response.status === 404) return null;
if (!response.ok) throw new Error(`CarsXE VIN decode returned HTTP ${response.status}`);
const result = await response.json();
if (result.success !== true) throw new Error("CarsXE VIN decode was unsuccessful");
const fields = result.attributes ?? {};
return {
vin,
make: fields.make?.trim() || null,
model: fields.model?.trim() || null,
fuelType: fields.fuel_type?.trim().toLowerCase() || null,
};
}Replacing the CarAPI.dev token in the before request with YOUR_CARAPI_TOKEN returned HTTP 403 with {"code":"invalid_token","error":"Invalid or missing API token"}. Handle that separately from a lookup miss. For CarsXE, omit vin in the after request to test the documented HTTP 400 validation path. CarAPI.dev exposes quota remaining and reset headers and can return 429; check CarsXE's account usage and handle its quota and credit failures separately. CarAPI.dev rate limits · CarsXE errors · CarsXE rate limits and quotas
Cut over production traffic
- Run both providers on the same VINs from your main markets, including an invalid VIN, a missing record, and a sparse decode.
- Compare normalized make and model, fuel labels, and missing fields. Keep workflows that require actual color or registration dates on their existing source.
- Send a small share of traffic to CarsXE. Track no-data and error rates, required-field completeness, latency, and usage.
- Keep the original client and credentials ready. Switch back if the rollout breaches your thresholds.
Move CarAPI.dev VIN lookups to CarsXE International VIN Decoding and update how you handle sparse registration and specification data.