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, and more.
🌐 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.0.3</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);
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 codes
Refer to the CarsXE API Documentation for more details about parameters and response formats.