CarsXECarsXE

The carsxe NuGet package is the official CarsXE client for C# and .NET. It wraps the REST API with async methods and handles authentication. Requires .NET 6 or later.

Installation

dotnet add package carsxe

Or via the NuGet Package Manager in Visual Studio: search for carsxe.

Quick start

using carsxe;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

class Program
{
    static async Task Main(string[] args)
    {
        CarsXE carsxe = new CarsXE(Environment.GetEnvironmentVariable("CARSXE_API_KEY")!);

        try
        {
            var vehicle = await carsxe.Specs(new Dictionary<string, string>
            {
                { "vin", "WBAFR7C57CC811956" },
            });
            Console.WriteLine(vehicle);
        }
        catch (Exception ex)
        {
            Console.WriteLine($"Error: {ex.Message}");
        }
    }
}

Methods

Core

MethodDescription
Specs(params)Decode a 17-character VIN into full vehicle specifications
MarketValue(params)Retail, trade-in, and auction value estimates
Recalls(params)Open safety recalls by VIN, make, model, or year
PlateDecoder(params)VIN lookup from a license plate (50+ countries)
History(params)Title events, salvage, junk, and insurance records

Bulk recall batch

MethodDescription
SubmitBulkRecallBatch(params)Submit a batch of VINs for recall lookup
GetBulkRecallBatchStatus(batchId)Poll job status
GetBulkRecallBatchResults(batchId)Retrieve completed results
GetBulkRecallBatchDownloadUrl(batchId)Get a CSV download URL

Endpoint examples

Runnable examples for each method. All of them assume the carsxe instance from Quick start and run inside an async method.

International VIN Decoder

var intvin = await carsxe.InternationalVinDecoder(new Dictionary<string, string>
{
    { "vin", "WF0MXXGBWM8R43240" },
});
Console.WriteLine(intvin);

Market Value

var marketvalue = await carsxe.MarketValue(new Dictionary<string, string>
{
    { "vin", "WBAFR7C57CC811956" },
});
Console.WriteLine(marketvalue);

Vehicle History

var history = await carsxe.History(new Dictionary<string, string>
{
    { "vin", "WBAFR7C57CC811956" },
});
Console.WriteLine(history);

License Plate Decoder

var decodedPlate = await carsxe.PlateDecoder(new Dictionary<string, string>
{
    { "plate", "7XER187" },
    { "state", "CA" },
    { "country", "US" },
});
Console.WriteLine(decodedPlate);

Vehicle Images

var images = await carsxe.Images(new Dictionary<string, string>
{
    { "make", "BMW" },
    { "model", "X5" },
    { "year", "2019" },
});
Console.WriteLine(images);

Vehicle Recalls

var recalls = await carsxe.Recalls(new Dictionary<string, string>
{
    { "vin", "1C4JJXR64PW696340" },
});
Console.WriteLine(recalls);

Plate Image Recognition

Takes the image URL directly rather than a dictionary.

var plateimg = await carsxe.PlateImageRecognition(
    "https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/f49aed53-d736-4370-f3f4-97418841c800/public"
);
Console.WriteLine(plateimg);

VIN OCR from Image

var vinocr = await carsxe.VinOcr(
    "https://imagedelivery.net/moyiiSImjJPI_EZVxNMBBw/f49aed53-d736-4370-f3f4-97418841c800/public"
);
Console.WriteLine(vinocr);
var yymm = await carsxe.YearMakeModel(new Dictionary<string, string>
{
    { "year", "2012" },
    { "make", "BMW" },
    { "model", "5 Series" },
});
Console.WriteLine(yymm);

OBD Code Decoder

var obdcode = await carsxe.ObdCodesDecoder(new Dictionary<string, string>
{
    { "code", "P0115" },
});
Console.WriteLine(obdcode);

Lien and Theft

var lienAndTheft = await carsxe.LienAndTheft(new Dictionary<string, string>
{
    { "vin", "2C3CDXFG1FH762860" },
});
Console.WriteLine(lienAndTheft);

Error handling

Methods throw Exception on API errors. Wrap calls in a try/catch block:

try
{
    var vehicle = await carsxe.Specs(new Dictionary<string, string> { { "vin", vin } });
    Console.WriteLine(vehicle);
}
catch (Exception ex)
{
    Console.WriteLine($"CarsXE error: {ex.Message}");
}

Best practices

Store your key in environment variables or .NET User Secrets for local development:

# .NET User Secrets (local dev)
dotnet user-secrets set "CARSXE_API_KEY" "your_key_here"

Create one instance and reuse it. All methods are async — don't create a new CarsXE instance per request.

In ASP.NET Core, register the client as a singleton via dependency injection:

// Program.cs
builder.Services.AddSingleton(new CarsXE(
    builder.Configuration["CARSXE_API_KEY"]!
));