PHPackages                             amattu2/nhtsa-wrapper - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. amattu2/nhtsa-wrapper

ActiveLibrary[API Development](/categories/api)

amattu2/nhtsa-wrapper
=====================

A simple PHP based NHTSA (U.S. Department of Transportation) vehicle VIN decoder and Recall lookup API wrapper.

v1.1.0(1y ago)25481[3 issues](https://github.com/amattu2/NHTSA-wrapper/issues)AGPL-3.0PHPPHP &gt;=7.4

Since Mar 9Pushed 1y ago1 watchersCompare

[ Source](https://github.com/amattu2/NHTSA-wrapper)[ Packagist](https://packagist.org/packages/amattu2/nhtsa-wrapper)[ RSS](/packages/amattu2-nhtsa-wrapper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (9)DependenciesVersions (4)Used By (0)

Introduction
============

[](#introduction)

This is a simple VIN decoder wrapper for the [NHTSA (United States Department of Transportation) VIN decoder API](https://vpic.nhtsa.dot.gov/api/). Additionally, it includes the NHTSA vehicle recall API. See usage section below or the example `index.php` file.

Usage
=====

[](#usage)

Import
------

[](#import)

Install with composer

```
require amattu2/nhtsa-wrapper
```

```
require "vendor/autoload.php";
```

VIN Decode
----------

[](#vin-decode)

### Raw Decode

[](#raw-decode)

PHPDoc

```
/**
 * Decode a 17-digit VIN
 *
 * @param string vin number
 * @param ?integer model year
 * @return ?array raw NHTSA result
 * @throws TypeError
 * @author Alec M.
 * @date 2021-04-04T16:19:40-040
 */
```

Usage

```
$decode = amattu2\NHTSA\Client::decodeVIN("VIN_NUMBER");
```

Success return result

```
Array
(
  [Error Text] =>
  [Make] =>
  [Manufacturer Name] =>
  [Model] =>
  [Model Year] =>
  [Plant City] =>
  [Series] =>
  [Trim] =>
  [Vehicle Type] =>
  [Plant Country] =>
  ...
)
```

### Pretty Decode

[](#pretty-decode)

PHPDoc

```
/**
* Parse a raw decode call
* Converts a decodeVIN call into a pretty parsed Year, Make, Model, Trim, Engine array
*
* @param array raw decode result
* @return ?array pretty parsed NHTSA result
* @throws TypeError
* @author Alec M.
* @date 2021-04-04T16:52:15-040
*/
```

Usage

```
$decode = amattu2\NHTSA\Client::decodeVIN("VIN_NUMBER");
$pretty_decode = amattu2\NHTSA\Client::parseDecode($decode);
```

Success return result (Example)

```
Array
(
  [Model_Year] => 2011
  [Make] => MERCEDES-BENZ
  [Model] => M-CLASS
  [Trim] =>  4-MATIC
  [Engine] => 3.5L 6-CYL (3,500CC)
)
```

Recalls
-------

[](#recalls)

### Raw Recalls

[](#raw-recalls)

PHPDoc

```
/**
 * Get vehicle recalls by Year, Make, Model
 *
 * @param int model year
 * @param string make
 * @param string model
 * @return ?array NHTSA raw result
 * @throws TypeError
 * @author Alec M.
 * @date 2021-04-04T16:48:24-040
 */
```

Usage

```
$recalls = amattu2\NHTSA\Client::getRecalls(2015, "Ford", "Mustang");
```

Success return result

```
Array
(
  [0] => Array
  (
      [Manufacturer] =>
      [NHTSACampaignNumber] =>
      [ReportReceivedDate] =>
      [Component] =>
      [Summary] =>
      [Conequence] =>
      [Remedy] =>
      [Notes] =>
      [ModelYear] =>
      [Make] =>
      [Model] =>
  )
  ...
)
```

### Pretty Recalls

[](#pretty-recalls)

PHPDoc

```
/**
 * Parse a raw recall result
 *
 * @param array raw recall result
 * @return ?array parsed recall result
 * @throws TypeError
 * @author Alec M.
 * @date 2021-04-04T18:16:26-040
*/
```

Usage

```
$recalls = amattu2\NHTSA\Client::getRecalls(2015, "Ford", "Mustang");
$pretty_recalls = amattu2\NHTSA\Client::parseRecalls($recalls);
```

Success return result

```
Array
(
  [2] => Array
  (
    [Campaign_Number] =>
    [Component] => Array
    (
      [0] => FUEL SYSTEM, GASOLINE
      [1] => STORAGE
      [2] => TANK ASSEMBLY /* The last element is the actual component */
    )
    [Date] => 2015-06-02
    [Description] =>
    [Remedy] =>
  )
  ...
)
```

getModelsForMakeByYear
----------------------

[](#getmodelsformakebyyear)

PHPDoc

```
/**
 * Get all available models for a make by year
 *
 * @note This is a free-text match. Recommend using `getModelsForMakeIdByYear`
 * @param int $year The model year
 * @param string $make The make
 */
```

Usage

```
$models = amattu2\NHTSA\Client::getModelsForMakeByYear(2015, "Ford");
```

Success return result

```
Array
(
  [0] => Array
  (
    [Make_ID] => 441
    [Make_Name] => FORD
    [Model_ID] => 2021
    [Model_Name] => C-MAX
  )
  ...
)
```

getModelsForMakeIdByYear
------------------------

[](#getmodelsformakeidbyyear)

PHPDoc

```
/**
 * Get all available models for a make by year
 *
 * @param int $year The model year
 * @param int $make_id The make ID
 */
```

Usage

```
$models = amattu2\NHTSA\Client::getModelsForMakeIdByYear(2015, 441);
```

Success return result

```
Array
(
  [0] => Array
  (
    [Make_ID] => 441
    [Make_Name] => FORD
    [Model_ID] => 2021
    [Model_Name] => C-MAX
  )
  ...
)
```

getModelsForMake
----------------

[](#getmodelsformake)

PHPDoc

```
/**
 * Get all available models for a make
 *
 * @param string $make The make
 */
```

Usage

```
$models = amattu2\NHTSA\Client::getModelsForMake("Ford");
```

Success return result

```
Array
(
  [0] => Array
  (
    [Make_ID] => 441
    [Make_Name] => FORD
    [Model_ID] => 2021
    [Model_Name] => C-MAX
  )
  ...
)
```

getModelsForMakeId
------------------

[](#getmodelsformakeid)

PHPDoc

```
/**
 * Get all available models for a make
 *
 * @param int $make_id The make ID
 */
```

Usage

```
$models = amattu2\NHTSA\Client::getModelsForMakeId(441);
```

Success return result

```
Array
(
  [0] => Array
  (
    [Make_ID] => 441
    [Make_Name] => FORD
    [Model_ID] => 2021
    [Model_Name] => C-MAX
  )
  ...
)
```

Requirements &amp; Dependencies
===============================

[](#requirements--dependencies)

- PHP 7.4+
- cURL Extension

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance26

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity47

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~362 days

Total

3

Last Release

432d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/45d27ac587ba85712309c969ca2e277df1044c60ce9f2f8a5ca69118211e30d6?d=identicon)[amattu2](/maintainers/amattu2)

---

Top Contributors

[![amattu2](https://avatars.githubusercontent.com/u/38357871?v=4)](https://github.com/amattu2 "amattu2 (55 commits)")

---

Tags

nhtsaphpvdotwrapper

### Embed Badge

![Health badge](/badges/amattu2-nhtsa-wrapper/health.svg)

```
[![Health](https://phpackages.com/badges/amattu2-nhtsa-wrapper/health.svg)](https://phpackages.com/packages/amattu2-nhtsa-wrapper)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M33](/packages/facebook-php-business-sdk)[microsoft/microsoft-graph

The Microsoft Graph SDK for PHP

65723.5M95](/packages/microsoft-microsoft-graph)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
