The CarsXE Java API Library is a powerful and developer-friendly library that enables seamless integration with the CarsXE API. Access a wide range of vehicle data, including VIN decoding, market value estimation, license plate recognition, vehicle history, lien & theft checks, and more.
Java Version: Java 21 LTS
π Website: https://api.carsxe.com
π Docs: https://api.carsxe.com/docs
π¦ All Products: https://api.carsxe.com/all-products
Add the following dependency to your pom.xml file:
<dependency>
<groupId>io.github.carsxe</groupId>
<artifactId>carsxe</artifactId>
<version>1.1.0</version>
</dependency>To use the library, you need to create an instance of the CarsXE class with your API key:
import io.github.carsxe.CarsXE;
CarsXE carsxe = new CarsXE("YOUR_API_KEY");Replace YOUR_API_KEY with your own CarsXE API key. You can get your API key by signing up at CarsXE.
The CarsXE Java library provides methods corresponding to multiple endpoints. Below are examples for all available products:
Map<String, String> params = new HashMap<>();
params.put("vin", "WBAFR7C57CC811956");
Map<String, Object> specs = carsxe.specs(params);
System.out.println(specs);Map<String, String> params = new HashMap<>();
params.put("vin", "WBAFR7C57CC811956");
Map<String, Object> marketValue = carsxe.marketvalue(params);
System.out.println(marketValue);Map<String, String> params = new HashMap<>();
params.put("vin", "WBAFR7C57CC811956");
Map<String, Object> history = carsxe.history(params);
System.out.println(history);Map<String, String> params = new HashMap<>();
params.put("plate", "7XER187");
params.put("state", "CA");
params.put("country", "US");
Map<String, Object> plateInfo = carsxe.platedecoder(params);
System.out.println(plateInfo);String imageUrl = "https://api.carsxe.com/img/apis/plate_recognition.JPG";
Map<String, Object> plateRecognition = carsxe.plateImageRecognition(imageUrl);
System.out.println(plateRecognition);String imageUrl = "https://user-images.githubusercontent.com/5663423/30922082-64edb4fa-a3a8-11e7-873e-3fbcdce8ea3a.png";
Map<String, Object> vinOcr = carsxe.vinOcr(imageUrl);
System.out.println(vinOcr);Map<String, String> params = new HashMap<>();
params.put("year", "2023");
params.put("make", "Toyota");
params.put("model", "Camry");
Map<String, Object> ymm = carsxe.yearMakeModel(params);
System.out.println(ymm);Map<String, String> params = new HashMap<>();
params.put("make", "BMW");
params.put("model", "X5");
params.put("year", "2019");
Map<String, Object> images = carsxe.images(params);
System.out.println(images);Map<String, String> params = new HashMap<>();
params.put("vin", "1C4JJXR64PW696340");
Map<String, Object> recalls = carsxe.recalls(params);
System.out.println(recalls);Map<String, String> params = new HashMap<>();
params.put("vin", "WF0MXXGBWM8R43240");
Map<String, Object> internationalVin = carsxe.internationalVinDecoder(params);
System.out.println(internationalVin);Map<String, String> params = new HashMap<>();
params.put("code", "P0115");
Map<String, Object> obdCodes = carsxe.obdcodesdecoder(params);
System.out.println(obdCodes);Map<String, String> params = new HashMap<>();
params.put("vin", "2C3CDXFG1FH762860");
Map<String, Object> lienTheft = carsxe.LienAndTheft(params);
System.out.println(lienTheft);Here is the list of supported endpoints:
specsβ Decode VIN & get full vehicle specificationsinternationalVinDecoderβ Decode VIN with worldwide supportplatedecoderβ Decode license plate info (plate, state, country)marketvalueβ Estimate vehicle market value based on VINhistoryβ Retrieve vehicle history (ownership, accidents, etc.)imagesβ Fetch images by make, model, year, trimrecallsβ Get safety recall data for a VINplateImageRecognitionβ Read & decode plates from imagesvinOcrβ Extract VINs from images using OCRyearMakeModelβ Query vehicle by year, make, model, and trim (optional)obdcodesdecoderβ Decode OBD error/diagnostic codesLienAndTheftβ Check for lien and theft records on a vehicle
Refer to the CarsXE API Documentation for more details about parameters and response formats.