Python Quickstart Guide
Get started with CarsXE's Python SDK to integrate comprehensive vehicle data into your Python applications.
The CarsXE Python SDK provides a simple and powerful way to integrate vehicle data into your Python applications. This guide will help you get started quickly.
For more information, see the package on PyPI.
Installation
Install the CarsXE Python package using pip:
pip install carsxe
Setup
First, import the CarsXE client and initialize it with your API key:
app.py
import asyncio
from carsxe_api import CarsXE
# Initialize the client
carsxe = CarsXE('YOUR_API_KEY_HERE') Basic Usage
VIN Specifications
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
vin = 'WBAFR7C57CC811956'
try:
vehicle = asyncio.run(carsxe.specs({"vin": vin}))
print(vehicle["input"]["vin"])
except Exception as error:
print(f"Error: {error}")International VIN Decoder
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
intvin = asyncio.run(carsxe.int_vin_decoder({"vin": "WF0MXXGBWM8R43240"}))
print(intvin)
except Exception as error:
print(f"Error: {error}")Market Value
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
marketvalue = asyncio.run(carsxe.market_value({"vin": "WBAFR7C57CC811956"}))
print(marketvalue)
except Exception as error:
print(f"Error: {error}")Vehicle History
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
history = asyncio.run(carsxe.history({"vin": "WBAFR7C57CC811956"}))
print(history)
except Exception as error:
print(f"Error: {error}")License Plate Decoder
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
decoded_plate = asyncio.run(carsxe.plate_decoder({"plate": "7XER187", "state": "CA", "country": "US"}))
print(decoded_plate)
except Exception as error:
print(f"Error: {error}")Vehicle Images
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
images = asyncio.run(carsxe.images({"make": "BMW", "model": "X5", "year": "2019"}))
print(images)
except Exception as error:
print(f"Error: {error}")Vehicle Recalls
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
recalls = asyncio.run(carsxe.recalls({"vin": "1C4JJXR64PW696340"}))
print(recalls)
except Exception as error:
print(f"Error: {error}")Plate Image Recognition
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
plateimg = asyncio.run(carsxe.plate_image_recognition({"upload_url": "https://api.carsxe.com/img/apis/plate_recognition.JPG"}))
print(plateimg)
except Exception as error:
print(f"Error: {error}")VIN OCR from Image
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
vinocr = asyncio.run(carsxe.vin_ocr({"upload_url": "https://api.carsxe.com/img/apis/plate_recognition.JPG"}))
print(vinocr)
except Exception as error:
print(f"Error: {error}")Year-Make-Model Search
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
yymm = asyncio.run(carsxe.year_make_model({"year": "2012", "make": "BMW", "model": "5 Series"}))
print(yymm)
except Exception as error:
print(f"Error: {error}")OBD Code Decoder
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
obdcode = asyncio.run(carsxe.obd_codes_decoder({"code": "P0115"}))
print(obdcode)
except Exception as error:
print(f"Error: {error}")Lien and Theft
app.py
import asyncio
from carsxe_api import CarsXE
carsxe = CarsXE('YOUR_API_KEY')
try:
lien_and_theft = asyncio.run(carsxe.lien_and_theft({"vin": "2C3CDXFG1FH762860"}))
print(lien_and_theft)
except Exception as error:
print(f"Error: {error}")Start building powerful automotive applications with CarsXE's Python SDK!