Java Quickstart Guide
Get started with CarsXE's Java SDK to integrate comprehensive vehicle data into your Java applications.
The CarsXE Java SDK provides a simple and powerful way to integrate vehicle data into your Java applications. This guide will help you get started quickly.
For more information, see the package on Maven Central.
Installation
Maven
Add the following dependency to your pom.xml:
pom.xml
<dependency>
<groupId>io.github.carsxe</groupId>
<artifactId>carsxe</artifactId>
<version>1.0.3</version>
</dependency>Setup
Initialize the CarsXE object with your API key:
Main.java
import io.github.carsxe.CarsXE;
public class Main {
public static void main(String[] args) {
// Initialize the CarsXE object
CarsXE carsxe = new CarsXE("YOUR_API_KEY_HERE");
}
}Basic Usage
VIN Specifications
Main.java
import io.github.carsxe.CarsXE;
import java.util.Map;
import java.util.HashMap;
public class Main {
public static void main(String[] args) {
CarsXE carsxe = new CarsXE("YOUR_API_KEY_HERE");
Map<String, String> params = new HashMap<>();
params.put("vin", "WBAFR7C57CC811956");
Map<String, Object> specs = carsxe.specs(params);
System.out.println(specs);
}
}International VIN Decoder
Main.java
Map<String, String> params = new HashMap<>();
params.put("vin", "WF0MXXGBWM8R43240");
Map<String, Object> internationalVin = carsxe.internationalVinDecoder(params);
System.out.println(internationalVin);Market Value
Main.java
Map<String, String> params = new HashMap<>();
params.put("vin", "WBAFR7C57CC811956");
Map<String, Object> marketValue = carsxe.marketvalue(params);
System.out.println(marketValue);Vehicle History
Main.java
Map<String, String> params = new HashMap<>();
params.put("vin", "WBAFR7C57CC811956");
Map<String, Object> history = carsxe.history(params);
System.out.println(history);License Plate Decoder
Main.java
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);Vehicle Images
Main.java
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);Vehicle Recalls
Main.java
Map<String, String> params = new HashMap<>();
params.put("vin", "1C4JJXR64PW696340");
Map<String, Object> recalls = carsxe.recalls(params);
System.out.println(recalls);Plate Image Recognition
Main.java
String imageUrl = "https://api.carsxe.com/img/apis/plate_recognition.JPG";
Map<String, Object> plateRecognition = carsxe.plateImageRecognition(imageUrl);
System.out.println(plateRecognition);VIN OCR from Image
Main.java
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);Year-Make-Model Search
Main.java
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);OBD Code Decoder
Main.java
Map<String, String> params = new HashMap<>();
params.put("code", "P0115");
Map<String, Object> obdCodes = carsxe.obdcodesdecoder(params);
System.out.println(obdCodes);Lien and Theft
Main.java
Map<String, String> params = new HashMap<>();
params.put("vin", "2C3CDXFG1FH762860");
Map<String, Object> lienTheft = carsxe.LienAndTheft(params);
System.out.println(lienTheft);Start building powerful automotive applications with CarsXE's Java SDK!