CarsXECarsXE

The carsxe-api package is the official CarsXE client for Node.js and TypeScript.

Installation

npm install carsxe-api
# yarn add carsxe-api
# pnpm add carsxe-api
# bun add carsxe-api

Quick start

Decode a VIN

Code
import { CarsXE } from "carsxe-api";

const carsxe = new CarsXE("YOUR_API_KEY");

const vehicle = await carsxe.specs({ vin: "WBAFR7C57CC811956" });
console.log(vehicle);

The client is constructed with your API key as a positional argument. Every method takes a params object and returns a Promise.

Methods

MethodParamsDescription
specs(params){ vin, deepdata?, disableIntVINDecoding? }Decode a VIN into full vehicle specifications
internationalVinDecoder(params){ vin }Decode a non-US international VIN
marketvalue(params){ vin, state?, mileage?, condition? }Retail, trade-in, and auction value estimates
history(params){ vin }Title events, salvage, and insurance records
recalls(params){ vin }Open safety recalls by VIN
lienAndTheft(params){ vin }Lien records and theft/salvage status
platedecoder(params){ plate, country, state?, district? }Resolve a license plate to vehicle data
images(params){ make, model, year?, trim?, color?, angle?, photoType?, size?, transparent?, license? }Vehicle photos by make, model, and year
plateImageRecognition(params){ imageUrl }Extract plate info from an image URL
vinOcr(params){ imageUrl }Extract VIN text from an image via OCR
yearMakeModel(params){ year, make, model, trim? }Look up vehicles by year, make, and model
obdcodesdecoder(params){ code }Decode an OBD-II diagnostic trouble code

Endpoint examples

Runnable examples for each method. All of them assume the carsxe client from Quick start.

International VIN Decoder

const intVin = await carsxe.internationalVinDecoder({
  vin: "WF0MXXGBWM8R43240",
});
console.log(intVin);

Market Value

const value = await carsxe.marketvalue({
  vin: "WBAFR7C57CC811956",
});
console.log(value);

Vehicle History

const history = await carsxe.history({
  vin: "WBAFR7C57CC811956",
});
console.log(history);

License Plate Decoder

const plate = await carsxe.platedecoder({
  plate: "7XER187",
  state: "CA",
  country: "US",
});
console.log(plate);

Vehicle Images

const imgs = await carsxe.images({
  make: "BMW",
  model: "X5",
  year: "2019",
});
console.log(imgs);

Vehicle Recalls

const recalls = await carsxe.recalls({
  vin: "1C4JJXR64PW696340",
});
console.log(recalls);

Plate Image Recognition

const plateImg = await carsxe.plateImageRecognition({
  imageUrl:
    "https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/f49aed53-d736-4370-f3f4-97418841c800/public",
});
console.log(plateImg);

VIN OCR from Image

const vinOcr = await carsxe.vinOcr({
  imageUrl:
    "https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/base/images/vin-ocr/vin/public",
});
console.log(vinOcr);
const ymm = await carsxe.yearMakeModel({
  year: "2023",
  make: "Toyota",
  model: "Camry",
});
console.log(ymm);

OBD Code Decoder

const obd = await carsxe.obdcodesdecoder({
  code: "P0115",
});
console.log(obd);

Lien and Theft

const lienTheft = await carsxe.lienAndTheft({
  vin: "2C3CDXFG1FH762860",
});
console.log(lienTheft);

Error handling

Methods reject on failure. Wrap calls in try/catch:

import { CarsXE } from "carsxe-api";

const carsxe = new CarsXE("YOUR_API_KEY");

try {
  const vehicle = await carsxe.specs({ vin: "WBAFR7C57CC811956" });
  console.log(vehicle);
} catch (error) {
  console.error("CarsXE error:", error);
}

Best practices

Create one instance and reuse it. Construct the client once with your key and share it across your app instead of instantiating per request.

// lib/carsxe.ts
import { CarsXE } from "carsxe-api";

export const carsxe = new CarsXE(process.env.CARSXE_API_KEY as string);

Store your key in an environment variable. Never hardcode it or commit it to source control.

# .env
CARSXE_API_KEY=your_key_here

TypeScript types are included. The package ships type declarations for every method's input (SpecsInput, MarketValueInput, PlateDecoderParams, and so on) — no @types package needed.