Go Quickstart Guide
Get started with CarsXE's Go package to integrate comprehensive vehicle data into your Go applications.
The CarsXE Go package provides a simple and powerful way to integrate vehicle data into your Go applications. This guide will help you get started quickly.
For more information, see the package on pkg.go.dev.
Installation
Install the CarsXE Go package using go get:
go get -u github.com/carsxe/carsxe-go-package
Setup
First, import the CarsXE client and initialize it with your API key:
main.go
package main
import (
"fmt"
"github.com/carsxe/carsxe-go-package"
)
func main() {
// Initialize the client
client := carsxe.New("YOUR_API_KEY_HERE")
}Basic Usage
VIN Specifications
main.go
vin := "WBAFR7C57CC811956"
vehicle := client.Specs(map[string]string{"vin": vin})
fmt.Println(vehicle["input"].(map[string]interface{})["vin"])International VIN Decoder
main.go
intvin := client.InternationalVINDecoder(map[string]string{
"vin": "WF0MXXGBWM8R43240",
})
fmt.Println(intvin)Market Value
main.go
marketvalue := client.MarketValue(map[string]string{
"vin": "WBAFR7C57CC811956",
})
fmt.Println(marketvalue)Vehicle History
main.go
history := client.History(map[string]string{
"vin": "WBAFR7C57CC811956",
})
fmt.Println(history)License Plate Decoder
main.go
decodedPlate := client.PlateDecoder(map[string]string{
"plate": "7XER187",
"state": "CA",
"country": "US",
})
fmt.Println(decodedPlate)Vehicle Images
main.go
images := client.Images(map[string]string{
"make": "BMW",
"model": "X5",
"year": "2019",
})
fmt.Println(images)Vehicle Recalls
main.go
recalls := client.Recalls(map[string]string{
"vin": "1C4JJXR64PW696340",
})
fmt.Println(recalls)Plate Image Recognition
main.go
plateimg := client.PlateImageRecognition(map[string]string{
"upload_url": "https://api.carsxe.com/img/apis/plate_recognition.JPG",
})
fmt.Println(plateimg)VIN OCR from Image
main.go
vinocr := client.VinOCR(map[string]string{
"upload_url": "https://api.carsxe.com/img/apis/plate_recognition.JPG",
})
fmt.Println(vinocr)Year-Make-Model Search
main.go
yymm := client.YearMakeModel(map[string]string{
"year": "2012",
"make": "BMW",
"model": "5 Series",
})
fmt.Println(yymm)OBD Code Decoder
main.go
obdcode := client.ObdCodesDecoder(map[string]string{
"code": "P0115",
})
fmt.Println(obdcode)Lien and Theft
main.go
lienAndTheft := client.LienAndTheft(map[string]string{
"vin": "2C3CDXFG1FH762860",
})
fmt.Println(lienAndTheft)Start building powerful automotive applications with CarsXE's Go package!