Skip to main content

A powerful, easy-to-use API for vehicle data including specs, market value, license plate decoding, and more.

Project description

🚗 CarsXE API (Python Package)

PyPI version

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:

  1. Sign up for a CarsXE account:

  2. Install the CarsXE pip package:

    Run this command in your terminal:

    pip install carsxe
    
  3. Import the CarsXE API into your code:

    import asyncio
    from carsxe_api import CarsXE
    
  4. Initialize the API with your API key:

    API_KEY = 'YOUR_API_KEY'
    carsxe = CarsXE(API_KEY)
    
  5. Use the various endpoint methods provided by the API to access the data you need.

Usage

All API methods are asynchronous and must be called with await inside an async function or using asyncio.run().

Basic Example

import asyncio
from carsxe_api import CarsXE

async def main():
    carsxe = CarsXE('YOUR_API_KEY')
    vin = 'WBAFR7C57CC811956'
    
    try:
        vehicle = await carsxe.specs({"vin": vin})
        print(vehicle["input"]["vin"])
    except Exception as error:
        print(f"Error: {error}")

# Run the async function
asyncio.run(main())

Alternative Usage (without async function)

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}")

📚 Endpoints

The CarsXE API provides the following endpoint methods:

specs – Decode VIN & get full vehicle specifications

Required:

  • vin

Optional:

  • deepData
  • disableIntVINDecoding

Example:

vehicle = await carsxe.specs({"vin": "WBAFR7C57CC811956"})
# or using asyncio.run()
vehicle = asyncio.run(carsxe.specs({"vin": "WBAFR7C57CC811956"}))

int_vin_decoder – Decode VIN with worldwide support

Required:

  • vin

Optional:

  • None

Example:

intvin = await carsxe.int_vin_decoder({"vin": "WF0MXXGBWM8R43240"})

plate_decoder – Decode license plate info (plate, country)

Required:

  • plate
  • country (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 state parameter is required only when applicable (for specific countries such as US, AU, CA, etc.).
  • For Pakistan (country='pk'), both state and district are required.

Example:

decoded_plate = await carsxe.plate_decoder({"plate": "7XER187", "state": "CA", "country": "US"})

market_value – Estimate vehicle market value based on VIN

Required:

  • vin

Optional:

  • state
  • mileage
  • condition ('excellent' | 'clean' | 'average' | 'rough')

Example:

marketvalue = await carsxe.market_value({"vin": "WBAFR7C57CC811956", "mileage": "50000", "condition": "clean"})

history – Retrieve vehicle history

Required:

  • vin

Optional:

  • None

Example:

history = await carsxe.history({"vin": "WBAFR7C57CC811956"})

images – Fetch images by make, model, year, trim

Required:

  • make
  • model

Optional:

  • year
  • trim
  • color
  • transparent
  • angle
  • photoType
  • size
  • license

Example:

images = await carsxe.images({"make": "BMW", "model": "X5", "year": "2019"})

recalls – Get safety recall data for a VIN

Required:

  • vin

Optional:

  • None

Example:

recalls = await carsxe.recalls({"vin": "1C4JJXR64PW696340"})

plate_image_recognition – Read & decode plates from images

Required:

  • upload_url

Optional:

  • None

Example:

plateimg = await carsxe.plate_image_recognition({"upload_url": "https://api.carsxe.com/img/apis/plate_recognition.JPG"})

vin_ocr – Extract VINs from images using OCR

Required:

  • upload_url

Optional:

  • None

Example:

vinocr = await carsxe.vin_ocr({"upload_url": "https://api.carsxe.com/img/apis/plate_recognition.JPG"})

year_make_model – Query vehicle by year, make, model and trim (optional)

Required:

  • year
  • make
  • model

Optional:

  • trim

Example:

yymm = await carsxe.year_make_model({"year": "2012", "make": "BMW", "model": "5 Series"})

obd_codes_decoder – Decode OBD error/diagnostic codes

Required:

  • code

Optional:

  • None

Example:

obdcode = await carsxe.obd_codes_decoder({"code": "P0115"})

lien_and_theft – Get lien and theft information for a VIN

Required:

  • vin

Optional:

  • None

Example:

lien_and_theft = await carsxe.lien_and_theft({"vin": "2C3CDXFG1FH762860"})

Notes & Best Practices

  • Parameter requirements: Each endpoint requires specific parameters—see the Required/Optional fields above.
  • Return values: All responses are Python dictionaries for easy access and manipulation.
  • Error handling: Use try/except blocks to gracefully handle API errors.
  • More info: For advanced usage and full details, visit the official API documentation.

Overall

CarsXE API 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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

carsxe-1.2.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

carsxe-1.2.0-py3-none-any.whl (7.3 kB view details)

Uploaded Python 3

File details

Details for the file carsxe-1.2.0.tar.gz.

File metadata

  • Download URL: carsxe-1.2.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for carsxe-1.2.0.tar.gz
Algorithm Hash digest
SHA256 b6c0705983b6ffccac7481769260321d82a013cca7627429bb33a7d9a0d17078
MD5 26afe50e221040fc60d9512b937ad20e
BLAKE2b-256 acffb7e98183e67903d596fa3fdc2a1a5ee940290bf4be63aa105c6bf3215c0f

See more details on using hashes here.

File details

Details for the file carsxe-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: carsxe-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.13

File hashes

Hashes for carsxe-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f1c3c1423daad94aca27eecdac627ad27eb7dd5d42fde87d5d68be88ce1da8b
MD5 50fc1b0a8759613641086b087f5c2d62
BLAKE2b-256 fe178bafcef74bf0ffd5112325d80ac240d89a8bcd476e683d6ea7fff9ada639

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page