Vehicle identity

Decode a VIN

Last updated:

Send a VIN, get the vehicle back, and the IDs every other endpoint takes.

Send a VIN:

curl "https://api.cardog.app/v2/vin/2T3R1RFV7MW180266" \
  -H "x-api-key: $CARDOG_API_KEY" \
  -H "Cardog-Version: 2026-10-26"

Get the vehicle back:

Example

10 keys
"response": {
"vin": "2T3R1RFV7MW180266",
"valid": true,
"year": 2021,
"make": "Toyota",
"model": "RAV4",
"trim": "XLE HV",
"refs": {
"make": "make:toyota",
"model": "model:toyota/rav4",
"modelYear": "model-year:toyota/rav4/2021",
"bodyStyle": "body-style:sport-utility-vehicle-suv-multi-purpose-vehicle-mpv",
"fuelType": "fuel-type:gasoline",
"driveType": "drive-type:4wd-4-wheel-drive-4x4",
"transmission": null,
"country": "country:canada"
},
"nano": "nano:2T3R1RFVMW",
"squish": "squish:2T3R1RFVM",
"links": {
"recalls": "/v2/vin/2T3R1RFV7MW180266/recalls",
"listings": "/v2/vin/2T3R1RFV7MW180266/listings",
"instrument": "/v2/vin/2T3R1RFV7MW180266/instrument",
"specs": "/v2/specs/model-year%3Atoyota%2Frav4%2F2021",
"quote": "/v2/quotes/model-year%3Atoyota%2Frav4%2F2021"
}
}

A decode costs 2 credits. The response above is trimmed; the VIN reference lists every field.

What comes back

Exploded line drawing of a generic SUV: the body lifted above the engine, the transmission and the chassis with its axles and wheels.
  1. 1Bodyrefs.bodyStyle
  2. 2Enginerefs.fuelType; the full sheet at links.specs
  3. 3Transmissionrefs.transmission, null when the VIN does not say
  4. 4Driverefs.driveType
  • valid: true when the VIN decoded. When false, every other field is null and reasons says why. We never fill in a VIN from similar vehicles.
  • year, make, model, trim: names to show your users.
  • refs: the same facts as IDs, such as model-year:toyota/rav4/2021. Other endpoints take these.
  • nano and squish: codes for grouping identical vehicles, covered below.
  • links: the next calls for this VIN, ready to request.

Store the refs, show the names

Write make:toyota into your database, not "Toyota". Every endpoint takes the ref, and it never changes meaning. The names are for display.

A null ref means the VIN does not tell us that fact. It is not a lookup that failed, and retrying will not change it. Every ref that is not null is safe to store as is.

Decode many VINs at once

Send up to 1,000 VINs in one call. Each is billed as one decode.

curl -X POST "https://api.cardog.app/v2/vin/batch" \
  -H "x-api-key: $CARDOG_API_KEY" \
  -H "Cardog-Version: 2026-10-26" \
  -H "content-type: application/json" \
  -d '{"vins":["2T3R1RFV7MW180266","2T3R1RFV7MW18026"]}'

You get one row per VIN, in the order you sent them. A bad VIN fails only its own row: here the second VIN is one character short, so its row has ok: false and an error, and the first still decodes. meta counts requested, decoded and failed.

With the TypeScript SDK

import { CardogClient } from "@cardog/api";

const client = new CardogClient({ apiKey: process.env.CARDOG_API_KEY });
const vehicle = await client.v2.vin.getByVin("2T3R1RFV7MW180266");

await db.vehicles.update(id, {
  makeRef: vehicle.refs.make,           // "make:toyota"
  modelYearRef: vehicle.refs.modelYear, // "model-year:toyota/rav4/2021"
  squish: vehicle.squish,               // "squish:2T3R1RFVM"
});

Group vehicles with nano and squish

Both are read straight from the VIN's characters:

  • squish groups VINs of the same configuration and model year. Market prices are quoted at this level, so it works as a market data key.
  • nano is squish plus the assembly plant: VINs that share it are the same build. Use it to find identical vehicles.

You can compute both without calling the API, using @cardog/entities:

import { squishFromVin, nanoFromVin } from "@cardog/entities";

squishFromVin("2T3R1RFV7MW180266"); // "2T3R1RFVM"
nanoFromVin("2T3R1RFV7MW180266");   // "2T3R1RFV*MW"

The API returns the same codes with a prefix, squish:2T3R1RFVM and nano:2T3R1RFVMW (the * stands for the check digit and is dropped). VIN structure shows which characters each one keeps.

Next calls

Each entry in links is a path you can request as is:

  • recalls: recalls for this VIN. See Recalls.
  • specs: the full spec sheet for the model year.
  • quote and instrument: market prices. See Market data.
  • listings: listings for this VIN.

Errors

Every error has the same shape. A malformed VIN:

Example

5 keys
"response": {
"code": "invalid_vin",
"message": "Not a valid VIN: 2T3R1RFV7MW18026",
"hint": "A VIN is 17 characters, A–Z (no I/O/Q) and 0–9. If the vehicle is real and we have it wrong, report it at POST /v2/feedback",
"docs_url": "https://cardog.app/docs/errors/invalid_vin.md",
"links": {
"feedback": "/v2/feedback"
}
}

Branch on code; hint says what to do next. If we decoded a VIN wrong, report it at no charge. All codes are in Errors.