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 NuGet package:
Run this command in your terminal:
dotnet add package carsxe
-
Import the CarsXE API into your code:
using carsxe;
-
Initialize the API with your API key:
string API_KEY = "YOUR_API_KEY"; CarsXE carsxe = new CarsXE(API_KEY);
-
Use the various endpoint methods provided by the API to access the data you need.
string vin = "WBAFR7C57CC811956";
try
{
var specs = carsxe.Specs(new Dictionary<string, string> { { "vin", vin } }).Result;
Console.WriteLine("API Response:");
Console.WriteLine(specs.RootElement.GetProperty("input").GetProperty("vin").ToString());
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
The CarsXE API provides the following endpoint methods:
Required:
vin
Optional:
deepdata
disableIntVINDecoding
Example:
var vehicle = carsxe.Specs(new Dictionary<string, string> { { "vin", "WBAFR7C57CC811956" } }).Result;
Required:
vin
Optional:
- None
Example:
var intvin = carsxe.InternationalVinDecoder(new Dictionary<string, string> { { "vin", "WF0MXXGBWM8R43240" } }).Result;
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'
), bothstate
anddistrict
are required.
Example:
var decodedPlate = carsxe.PlateDecoder(new Dictionary<string, string>
{
{ "plate", "7XER187" },
{ "state", "CA" },
{ "country", "US" }
}).Result;
Required:
vin
Optional:
state
Example:
var marketvalue = carsxe.MarketValue(new Dictionary<string, string> { { "vin", "WBAFR7C57CC811956" } }).Result;
Required:
vin
Optional:
- None
Example:
var history = carsxe.History(new Dictionary<string, string> { { "vin", "WBAFR7C57CC811956" } }).Result;
Required:
make
model
Optional:
year
trim
color
transparent
angle
photoType
size
license
Example:
var images = carsxe.Images(new Dictionary<string, string>
{
{ "make", "BMW" },
{ "model", "X5" },
{ "year", "2019" }
}).Result;
Required:
vin
Optional:
- None
Example:
var recalls = carsxe.Recalls(new Dictionary<string, string> { { "vin", "1C4JJXR64PW696340" } }).Result;
Required:
imageUrl
Optional:
- None
Example:
var plateimg = carsxe.PlateImageRecognition("https://api.carsxe.com/img/apis/plate_recognition.JPG").Result;
Required:
imageUrl
Optional:
- None
Example:
var vinocr = carsxe.VinOcr("https://api.carsxe.com/img/apis/plate_recognition.JPG").Result;
Required:
year
make
model
Optional:
trim
Example:
var yymm = carsxe.YearMakeModel(new Dictionary<string, string>
{
{ "year", "2012" },
{ "make", "BMW" },
{ "model", "5 Series" }
}).Result;
Required:
code
Optional:
- None
Example:
var obdcode = carsxe.ObdCodesDecoder(new Dictionary<string, string> { { "code", "P0115" } }).Result;
For better performance and non-blocking operations, use async/await instead of .Result:
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using carsxe;
class Program
{
static async Task Main(string[] args)
{
string API_KEY = "YOUR_API_KEY_HERE";
await using var carsxe = new CarsXE(API_KEY);
try
{
var specs = await carsxe.Specs(new Dictionary<string, string> { { "vin", "WBAFR7C57CC811956" } });
Console.WriteLine("Year: " + specs.RootElement.GetProperty("attributes").GetProperty("year").ToString());
}
catch (Exception ex)
{
Console.WriteLine($"Error: {ex.Message}");
}
}
}
- Parameter requirements: Each endpoint requires specific parametersβsee the Required/Optional fields above.
- Return values: All responses are JsonDocument objects for easy access and manipulation using System.Text.Json.
- Error handling: Use try/catch blocks to gracefully handle API errors.
- Async operations: Use async/await for better performance instead of blocking with .Result.
- Resource management: The CarsXE client implements IAsyncDisposable, so use
await using
or call DisposeAsync() when done. - More info: For advanced usage and full details, visit the official API documentation.
CarsXE API provides a wide range of powerful, easy-to-use tools for accessing and integrating vehicle data into your .NET 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.