Skip to content

Latest commit

 

History

History
37 lines (26 loc) · 1.15 KB

README.md

File metadata and controls

37 lines (26 loc) · 1.15 KB

Arex388.NhtsaVpic

A VIN decoding library using the National Highway Traffic Safety Administration (NHTSA) vPIC API.

NOTE: The API is only minimally implemented because the project that spawned this library does not have a need for anything but the year, make and model of a vehicle. I will revisit and complete this library in the future, I just wanted to separate it out as a NuGet package for now.

To use create a new instance of NhtsaVpicClient and pass in an instance of HttpClient. The original API documentation can be found here.

For dependency injection use the Arex388.NhtsaVpic.Extensions.Microsoft.DependencyInjection. NuGet package with the AddNhtsaVpic() extension method. This will register INhtsaVpicClient to NhtsaVpicClient. Use INhtsaVpicClient interface in your code.

Available as a NuGet package here.

var nhtsaVpic = new NhtsaVpicClient(
    httpClient,
    //	debug = true/false
);

Decode

var response = await nhtsaVpic.DecodeAsync(
    "VIN"
);

Decode Batch

var response = await nhtsaVpic.DecodeBatchAsync(
    "VIN1",
    "VIN2",
    ...
);