Legacy v1

Migrate VIN decoding to v2

Last updated:

Move from /v1/vin to /v2/vin: the calls side by side, what each field became, and how billing changes.

Docs for the previous API generation. v1 endpoints keep working, but new work should target v2. See v2 VIN reference.

v1 stops answering on December 31st 2027. This page shows how to move a VIN integration to v2 before then. Your API key stays the same.

What changes in one minute

  • The address changes from /v1/vin to /v2/vin.
  • The answer is flat. make, model and year sit at the top level, not under components.vehicle.
  • Every fact also comes as a stable ID under refs, for example make:honda. Use these for joins, not the display names.
  • A VIN we cannot name returns valid: false with a list of reasons, not a free text error. A VIN that is not shaped like a VIN returns a 400 error.
  • v2 does not test the check digit. If you relied on components.checkDigit, you now need your own check.
  • Billing moves from requests to credits. A batch is billed per decoded VIN.

The calls side by side

One VIN

# v1
curl "https://api.cardog.app/v1/vin/corgi/2HGFC1F95HH204816" \
  -H "x-api-key: your-api-key"

# v2
curl "https://api.cardog.app/v2/vin/2HGFC1F95HH204816" \
  -H "x-api-key: your-api-key"

Many VINs

# v1
curl -X POST "https://api.cardog.app/v1/vin/batch" \
  -H "x-api-key: your-api-key" \
  -H "content-type: application/json" \
  -d '{"vins": ["2HGFC1F95HH204816"]}'

# v2
curl -X POST "https://api.cardog.app/v2/vin/batch" \
  -H "x-api-key: your-api-key" \
  -H "content-type: application/json" \
  -d '{"vins": ["2HGFC1F95HH204816"]}'

Both take up to 1,000 VINs in one call.

Which v1 address maps to which v2 address

v1v2
GET /v1/vin/{vin}GET /v2/vin/{vin}. The variants list moves to /v2/specs, see below.
GET /v1/vin/corgi/{vin}GET /v2/vin/{vin}
GET /v1/vin/corgi/v3/{vin}GET /v2/vin/{vin}
POST /v1/vin/batchPOST /v2/vin/batch
POST /v1/vin/batch/corgiPOST /v2/vin/batch
GET /v1/vin/nano/{vin}GET /v2/vin/{vin}, then follow links.specsBuild
POST /v1/vin/batch/nanoPOST /v2/vin/batch, then follow links.specsBuild on each result
POST /v1/vin/imageNo v2 replacement yet. Keep using v1 for now.

The answer, before and after

Both answers below are for the same 2017 Honda Civic, trimmed for length.

Before: v1

Example

5 keys
"response": {
"vin": "2HGFC1F95HH204816",
"valid": true,
"components": {
"checkDigit": {4 items},
"modelYear": {3 items},
"wmi": {6 items},
"vds": {2 items},
"vis": {2 items},
"vehicle": {9 items},
"plant": {3 items},
"engine": {2 items}
},
"errors": [
],
"metadata": {
"processingTime": 1637,
"confidence": 0.9866666666666667,
"schemaVersion": "1.0",
"matchedSchema": "Honda Civic Schema - 2017",
"totalPatterns": 15
}
}

The pattern lists under vds and vis are emptied here to save space. GET /v1/vin/{vin} wraps this same object as pass, next to a variants list.

After: v2

Example

18 keys
"response": {
"vin": "2HGFC1F95HH204816",
"valid": true,
"year": 2017,
"doors": 4,
"trim": "TOURING",
"numberOfWheels": null,
"numberOfAxles": null,
"shippingWeight": 2923,
"grossWeight": null,
"make": "Honda",
"model": "Civic",
"refs": {
"make": "make:honda",
"model": "model:honda/civic",
"modelYear": "model-year:honda/civic/2017",
"bodyStyle": "body-style:sedan-saloon",
"fuelType": "fuel-type:gasoline",
"driveType": "drive-type:4x2",
"transmission": "transmission:continuously-variable-transmission-cvt",
"vehicleType": "vehicle-type:passenger-car",
"gvwr": "gvwr:class-1b-3-001-4-000-lb-1-360-1-814-kg",
"country": "country:canada"
},
"nano": "nano:2HGFC1F9HH",
"squish": "squish:2HGFC1F9H",
"reasons": null,
"corgiBuild": "75213b25aa6e94b39dc2348d79535fc56c77263480b3d0ddd54cf182b21cef0e",
"attributes": {
"manufacturer": {1 item},
"plantCity": {1 item},
"plantState": {1 item},
"plantCountry": {2 items},
"engineModel": {1 item},
"cylinders": {1 item},
"displacementL": {2 items}
},
"links": {
"recalls": "/v2/vin/2HGFC1F95HH204816/recalls",
"listings": "/v2/vin/2HGFC1F95HH204816/listings",
"specsBuild": "/v2/specs/nano%3A2HGFC1F9HH",
"specs": "/v2/specs/model-year%3Ahonda%2Fcivic%2F2017"
}
}

Refs that are null for this car, most of attributes (59 entries in the full answer) and most of links are left out here.

Where each v1 field went

v1 fieldv2 fieldNote
vinvinSame.
validvalidWhen false, the vehicle fields are null and reasons says why.
components.vehicle.makemake and refs.make
components.vehicle.modelmodel and refs.model
components.vehicle.year, components.modelYear.yearyear and refs.modelYear
components.vehicle.trimtrim
components.vehicle.doorsdoorsWas the text "4", now the number 4.
components.vehicle.bodyStylerefs.bodyStyle
components.vehicle.fuelType, components.engine.fuelrefs.fuelType
components.vehicle.gvwrrefs.gvwr
components.wmi.vehicleTyperefs.vehicleType
components.wmi.country, components.plant.countryrefs.country
components.vehicle.manufacturer, components.wmi.manufacturerattributes.manufacturer.value
components.plant.cityattributes.plantCity.value
components.engine.modelattributes.engineModel.value
errorsreasonsFree text became fixed codes such as UNSEEN_BUILD.
variants on GET /v1/vin/{vin}links.specsBuild, links.specsThe catalogue rows moved out of the VIN answer. Follow the link to /v2/specs.

New in v2

  • refs: a stable ID for each fact. A ref stays the same when a display name changes.
  • nano: the build code. Vehicles that share it are the same build, so it works as a key for removing duplicates.
  • squish: the configuration key. Market prices are quoted at this level.
  • reasons: why a VIN could not be named. Null when valid is true.
  • corgiBuild: which version of the decoder produced the answer.
  • attributes: everything else the decoder found for this build, such as plant, engine and safety equipment. Its contents vary by vehicle, so read the keys you need and do not expect a fixed list.
  • links: paths to the recalls, listings, specs, safety and parts answers for this vehicle.
  • shippingWeight, grossWeight, numberOfWheels, numberOfAxles: at the top level when known.

Gone in v2

  • components.checkDigit. v2 does not test the check digit at all. A VIN with a wrong check digit still returns its build with valid: true. If you used this field to catch typing mistakes, compute the check digit yourself before you call.
  • components.vds.patterns and components.vis.patterns, the position by position trace of the decode.
  • components.wmi.code, components.wmi.region and components.plant.code. The WMI is the first three characters of the VIN and the plant code is character eleven.
  • components.modelYear.source and components.modelYear.confidence.
  • metadata: processingTime, confidence, schemaVersion, matchedSchema, totalPatterns.

Batch answers

The wrapper around a batch changed too.

v1v2
countmeta.requested
successfulmeta.decoded
failedmeta.failed
success, processingTime, avgTimePerVinGone.
results[].resultresults[].identity, the same object a single v2 call returns
results[].ok: true with identity, or false with error

Results come back in the order you sent the VINs. One bad VIN does not fail the batch. On v1, one VIN that was not 17 characters failed the whole call.

ok: true only means the VIN was shaped like a VIN. To know if it decoded, read identity.valid.

Billing

  • v1 counts requests. One call is one request against your monthly limit, and a batch of 1,000 VINs is also one request.
  • v2 counts credits. A VIN decode costs 2 credits. A batch costs 2 credits for each VIN that decodes, and VINs that do not decode cost nothing. A single call costs 2 credits whenever it returns an answer, including an answer with valid: false. A 400 error costs nothing.

So a v1 batch of 1,000 VINs was one request, and the same batch on v2 costs up to 2,000 credits. Check your plan's credit allowance before moving batch work over. Every v2 answer carries x-credits-rate and x-credits-remaining headers so you can track this. See Credits.

Checklist

  1. Change the address from /v1/vin to /v2/vin.
  2. Read make, model, year, trim and doors from the top level.
  3. Switch joins and comparisons to refs.
  4. Handle valid: false by reading reasons, and handle a 400 invalid_vin error for a VIN that is not 17 valid characters.
  5. If you used components.checkDigit, add your own check digit test.
  6. For batches, check results[].ok, then read results[].identity and its valid field.
  7. If you used variants, follow links.specsBuild or links.specs.
  8. Review your credit allowance for batch volume.

Back to all v1 to v2 guides.

Was this helpful?