CarsXE is a powerful and developer-friendly API that gives you instant access to a wide range of vehicle data. From VIN decoding and market value estimation to vehicle history, images, OBD code explanations, and plate recognition, CarsXE provides everything you need to build automotive applications at scale.
π Website: https://api.carsxe.com
π Docs: https://api.carsxe.com/docs
π¦ All Products: https://api.carsxe.com/all-products
To get started with the CarsXE API, follow these steps:
-
Sign up for a CarsXE account:
- Register here
- Add a payment method to activate your subscription and get your API key.
-
Install the CarsXE Go package:
Run this command in your terminal:
go get -u github.com/carsxe/carsxe-go-package
-
Import the CarsXE API into your code:
import "github.com/carsxe/carsxe-go-package"
-
Initialize the API with your API key:
client := carsxe.New("YOUR_API_KEY")
-
Use the various endpoint methods provided by the API to access the data you need.
package main
import (
"fmt"
"github.com/carsxe/carsxe-go-package"
)
func main() {
client := carsxe.New("YOUR_API_KEY")
vin := "WBAFR7C57CC811956"
vehicle := client.Specs(map[string]string{"vin": vin})
fmt.Println(vehicle["input"].(map[string]interface{})["vin"])
}The CarsXE API provides the following endpoint methods:
Required:
vin
Optional:
deepdatadisableIntVINDecoding
Example:
vehicle := client.Specs(map[string]string{"vin": "WBAFR7C57CC811956"})Required:
vin
Optional:
- None
Example:
intvin := client.InternationalVINDecoder(map[string]string{"vin": "WF0MXXGBWM8R43240"})Required:
platecountry(always required except for US, where it is optional and defaults to 'US')
Optional:
state(required for some countries, e.g. US, AU, CA)district(required for Pakistan)
Note:
- The
stateparameter is required only when applicable (for specific countries such as US, AU, CA, etc.).- For Pakistan (
country='pk'), bothstateanddistrictare required.
Example:
decodedPlate := client.PlateDecoder(map[string]string{"plate": "7XER187", "state": "CA", "country": "US"})Required:
vin
Optional:
state
Example:
marketvalue := client.MarketValue(map[string]string{"vin": "WBAFR7C57CC811956"})Required:
vin
Optional:
- None
Example:
history := client.History(map[string]string{"vin": "WBAFR7C57CC811956"})Required:
makemodel
Optional:
yeartrimcolortransparentanglephotoTypesizelicense
Example:
images := client.Images(map[string]string{"make": "BMW", "model": "X5", "year": "2019"})Required:
vin
Optional:
- None
Example:
recalls := client.Recalls(map[string]string{"vin": "1C4JJXR64PW696340"})Required:
imageURL
Optional:
- None
Example:
plateimg := client.PlateImageRecognition("https://api.carsxe.com/img/apis/plate_recognition.JPG")Required:
imageURL
Optional:
- None
Example:
vinocr := client.VinOCR("https://api.carsxe.com/img/apis/plate_recognition.JPG")Required:
yearmakemodel
Optional:
trim
Example:
yymm := client.YearMakeModel(map[string]string{"year": "2012", "make": "BMW", "model": "5 Series"})Required:
code
Optional:
- None
Example:
obdcode := client.ObdCodesDecoder(map[string]string{"code": "P0115"})Required:
vin
Optional:
- None
Example:
lienTheft := client.LienAndTheft(map[string]string{"vin": "2C3CDXFG1FH762860"})- Parameter requirements: Each endpoint requires specific parametersβsee the Required/Optional fields above.
- Return values: All responses are Go maps (
map[string]any) for easy access and manipulation. - Error handling: The client currently panics on network or JSON decode errors. Consider wrapping calls with
recoveror modifying the client to return errors for production use. - More info: For advanced usage and full details, visit the official API documentation.
The CarsXE Go package provides a wide range of powerful, easy-to-use tools for accessing and integrating vehicle data into your applications and services. Whether you're a developer or a business owner, you can quickly get the information you need to take your projects to the next levelβwithout hassle or inconvenience.