This is a basic library/wrapper for digital vehicle state safety/emissions inspection record lookups. If you need to check the last date(s) a vehicle was state inspected, and you know the state, this library is for you. A few states also support returning information on the last emissions/smog test. Originally designed for integration within a automotive service management SaaS application.
State | Supported Operations | Notes |
---|---|---|
Maryland | Emissions/Smog, Safety | Pending further tests, but it appears that MD only keeps the e-inspection record until it expires (6 months) |
Using composer
composer require amattu2/state-inspection-lookup
Manually
git clone https://github.com/amattu2/state-inspection-lookup
Composer: Import the autoload
require("vendor/autoload.php");
Manually: Import the core files
require("src/Inspections.php");
require("src/StateInspectionBase.php");
require("src/StateInspectionInterface.php");
require("src/Utils.php");
Retrieve all inspection types (smog/safety inspections)
$all = amattu2\Inspections::all("VIN", "STATE_ABBR");
VIN
is the 17 digit VIN number of the vehicle of interest. STATE_ABBR
is the 2 digit ISO-3166-2 state abbreviation.
Returns an array containing Emissions
, Safety
multi-dimensional arrays.
Retrieve all state safety (mechanical) inspection reports.
PHPDoc
/**
* A endpoint wrapper to return a structured state safety inspection search result
* All return attributes are nullable, given that each state returns different information.
*
* @param string VIN number
* @return array Array<Array<?bool result, ?string date, ?string url>, ...>
* @return array Structured return result
* @throws TypeError
* @throws UnsupportedStateOperationException
* @author Alec M. <https://amattu.com>
* @date 2021-04-07T11:05:27-040
*/
Usage
amattu2\Inspections::safety("VIN", "STATE_ABBR");
VIN
is the 17 digit VIN number of the vehicle of interest. STATE_ABBR
is the 2 digit ISO-3166-2 state abbreviation.
Returns the following array:
Array
(
[0] => Array
(
[date] => ?string (Format: YYYY-MM-DD)
[result] => ?bool
[url] => ?string
)
)
Pull all emissions records for a vehicle.
PHPDoc
/**
* A endpoint wrapper to return a structured state emissions test result
* All return attributes are nullable, given that each state returns different information.
*
* @param string VIN number
* @return array Array<Array<?string type, ?string date, ?bool result, ?string url>, ...>
* @throws TypeError
* @throws UnsupportedStateOperationException
* @author Alec M. <https://amattu.com>
* @date 2021-04-07T14:51:13-040
*/
Usage
amattu2\Inspections::emissions("VIN", "STATE_ABBR")
VIN
is the 17 digit VIN number of the vehicle of interest. STATE_ABBR
is the 2 digit ISO-3166-2 state abbreviation.
Returns the following array:
Array
(
[0] => Array
(
[date] => ?string (Format: YYYY-MM-DD)
[result] => ?bool
[type] => ?string
[url] => ?string
)
)
A list of potential integrations with state systems. These require advanced parsing or endpoint manipulation to grab the information.
State | Portal |
---|---|
Delaware | Link |
California | Link |
Virginia | Link |
Georgia | Link |
Texas | Link |
State | Portal |
---|
https://haynes.com/en-us/tips-tutorials/what-know-about-vehicle-inspections-all-50-states
PHP 7+