VIN Engine Specs API for Developers

By Vehicle API
VIN Engine Specs API for Developers

You need reliable engine specifications from a VIN, delivered in a predictable JSON envelope and easy to integrate on the server. By the end of this guide, you’ll be able to call the Vehicle API VIN Engine Specs endpoint from your backend, parse the engine fields you care about (cylinders, displacement_l, configuration, model, hp, fuel), handle nulls and errors, and cache results safely for speed and cost control.

What this endpoint returns (focus on engine specs)

The VIN Engine Specs lookup uses the Vehicle API VIN Decode endpoint to resolve a 17-character VIN into structured data sourced from NHTSA vPIC. You’ll receive:

Illustration: VIN Engine Specs API for Developers
  • Response envelope with status, source, and data.
  • High-confidence core attributes: year, make, model, trim, body, doors, vehicle_type.
  • Engine details in data.engine:
    • cylinders (integer)
    • displacement_l (liters, numeric)
    • configuration (e.g., “V-Shaped”)
    • model (e.g., engine family code)
    • hp (horsepower, integer)
    • fuel (e.g., “Gasoline”)
  • Transmission summary, manufacturing plant, and manufacturer label for context.

Coverage notes:

  • VIN decoding works worldwide; completeness is fullest for US-market vehicles.
  • US safety data (recalls, owner complaints, NCAP crash ratings) are matched by make + model + year and are US-market only. They are not part of the engine specs endpoint described here.
  • Dutch plates from RDW are supported elsewhere in Vehicle API and do not include a VIN.
  • This is not a vehicle history report (no title, accident, or ownership history).

Endpoint and authentication

Base URL: https://vehicles-api.com/api/v1

Endpoint: POST /vin/decode

Authentication: send your key with the X-API-Key header. Authorization: Bearer also works if you prefer bearer tokens. Always call from your server; never expose your key in browser code.

Official cURL and JSON example

Copy the official cURL and JSON exactly when testing your integration. The control VIN decodes to a 2003 Honda Accord. Use this to validate your parsing for engine fields and null handling.

curl -X POST "https://vehicles-api.com/api/v1/vin/decode" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"vin":"1HGCM82633A004352"}'
{
    "status": "success",
    "source": "nhtsa",
    "data": {
        "vin": "1HGCM82633A004352",
        "valid": true,
        "year": 2003,
        "make": "HONDA",
        "model": "Accord",
        "trim": "EX-V6",
        "body": "Coupe",
        "doors": 2,
        "vehicle_type": "PASSENGER CAR",
        "engine": {
            "cylinders": 6,
            "displacement_l": 3,
            "configuration": "V-Shaped",
            "model": "J30A4",
            "hp": 240,
            "fuel": "Gasoline"
        },
        "fuel_type": "Gasoline",
        "electrification_level": null,
        "ev_drive_unit": null,
        "battery_kwh": null,
        "charger_level": null,
        "charger_power_kw": null,
        "drive": null,
        "transmission": {
            "style": "Automatic",
            "speeds": 5
        },
        "plant": {
            "country": "UNITED STATES (USA)",
            "city": "MARYSVILLE",
            "state": "OHIO"
        },
        "manufacturer": "AMERICAN HONDA MOTOR CO., INC."
    }
}

Field-by-field: what you’ll actually use

Key envelope fields to check first:

  • status: "success" or "error". Branch your logic on this value.
  • source: "nhtsa" for VIN decoding from vPIC.
  • data: object with decoded values when status is "success".
  • error: present when status is "error", with error.code and error.message for programmatic handling and logs.

Engine-specific fields you’ll parse from data.engine:

  • engine.cylinders: integer count of cylinders.
  • engine.displacement_l: engine size in liters.
  • engine.configuration: e.g., "V-Shaped".
  • engine.model: engine family/model code.
  • engine.hp: horsepower (integer).
  • engine.fuel: e.g., "Gasoline".

Nullability and constraints:

  • Fields not published by NHTSA are returned as null. Do not infer values; handle nulls explicitly.
  • The example VIN is a gasoline vehicle, so electrification fields are null. Do not assume EV data will be present for non-EVs.
  • drive may be null when unavailable in NHTSA data.

Server-side integration in Python (requests)

This example shows a robust server-side POST with timeout, envelope handling, and safe parsing of engine fields. Keep API keys on the server only.

import requests

API_URL = "https://vehicles-api.com/api/v1/vin/decode"
API_KEY = "YOUR_API_KEY"

def decode_vin_engine(vin: str, timeout_seconds: float = 5.0) -> dict:
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
# If you prefer bearer tokens:
# "Authorization": f"Bearer {API_KEY}",
}
payload = {"vin": vin}

try:
resp = requests.post(API_URL, headers=headers, json=payload, timeout=timeout_seconds)
except requests.exceptions.Timeout:
# Map to your app's retry/backoff policy
raise RuntimeError("vehicles-api timeout")

# Non-2xx still returns a JSON envelope you should inspect
try:
body = resp.json()
except ValueError:
raise RuntimeError(f"vehicles-api returned non-JSON (status {resp.status_code})")

status = body.get("status")
if status != "success":
err = body.get("error") or {}
code = err.get("code")
msg = err.get("message")
raise RuntimeError(f"vehicles-api error ({code}): {msg}")

data = body.get("data") or {}
engine = (data or {}).get("engine") or {}

# Extract the engine fields your app needs
result = {
"vin": data.get("vin"),
"year": data.get("year"),
"make": data.get("make"),
"model": data.get("model"),
"trim": data.get("trim"),
"engine": {
"cylinders": engine.get("cylinders"),
"displacement_l": engine.get("displacement_l"),
"configuration": engine.get("configuration"),
"model": engine.get("model"),
"hp": engine.get("hp"),
"fuel": engine.get("fuel"),
},
"fuel_type": data.get("fuel_type"),
"transmission": (data.get("transmission") or {}),
"source": body.get("source"),
}

return result

if __name__ == "__main__":
decoded = decode_vin_engine("1HGCM82633A004352")
print(decoded)

Server-side integration in PHP (cURL)

This PHP example posts JSON with the X-API-Key header, sets a connection and response timeout, and handles the JSON envelope with error.code and error.message.

<?php
$apiUrl = "https://vehicles-api.com/api/v1/vin/decode";
$apiKey = "YOUR_API_KEY";
$payload = ["vin" => "1HGCM82633A004352"];

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
"X-API-Key: " . $apiKey,
"Content-Type: application/json",
// If you prefer bearer tokens:
// "Authorization: Bearer " . $apiKey,
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 5);
curl_setopt($ch, CURLOPT_TIMEOUT, 10);

$response = curl_exec($ch);

if ($response === false) {
$err = curl_error($ch);
curl_close($ch);
throw new RuntimeException("vehicles-api network error: " . $err);
}

$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

$body = json_decode($response, true);
if (!is_array($body)) {
throw new RuntimeException("vehicles-api returned non-JSON (status $httpCode)");
}

if (($body["status"] ?? null) !== "success") {
$code = $body["error"]["code"] ?? null;
$msg = $body["error"]["message"] ?? "Unknown error";
throw new RuntimeException("vehicles-api error ($code): $msg");
}

$data = $body["data"] ?? [];
$engine = $data["engine"] ?? [];

$result = [
"vin" => $data["vin"] ?? null,
"year" => $data["year"] ?? null,
"make" => $data["make"] ?? null,
"model" => $data["model"] ?? null,
"trim" => $data["trim"] ?? null,
"engine" => [
"cylinders" => $engine["cylinders"] ?? null,
"displacement_l" => $engine["displacement_l"] ?? null,
"configuration" => $engine["configuration"] ?? null,
"model" => $engine["model"] ?? null,
"hp" => $engine["hp"] ?? null,
"fuel" => $engine["fuel"] ?? null,
],
"fuel_type" => $data["fuel_type"] ?? null,
"transmission" => $data["transmission"] ?? [],
"source" => $body["source"] ?? null,
];

print_r($result);
?>

Handling errors, rate limits, and quotas

Errors are returned in a consistent envelope with status set to "error" and an error object containing error.code and error.message. Always branch on status before reading data. Log error.code for triage and adjust client behavior where appropriate (e.g., invalid VIN vs. temporary upstream issue).

Rate limits and monthly quota apply per plan. Each plan includes a 7-day free trial, and the Starter tier begins at $19/mo. If you anticipate spikes (e.g., bulk decoding), implement short-term caching (see below) and backoff on HTTP or envelope-level errors. For current quotas and any per-minute limits, see the Documentation.

Caching decoded VINs

VIN decoding results are stable for a given 17-character VIN. To reduce latency and cost:

  • Cache by VIN key: vin → parsed engine spec object.
  • On cache hit, serve immediately; on miss, call /vin/decode and populate the cache.
  • Choose a long TTL appropriate for your use case. Since engine specs for a VIN do not change, a long-lived cache is reasonable.
  • Handle null fields: store them as nulls rather than substituting defaults, so your UI/logic reflects true source completeness.

Practical notes for production

  • Server-side only: never ship your X-API-Key in browser code or mobile apps. Use your backend as the only caller to Vehicle API.
  • Timeouts: set a connect timeout and an overall timeout. Retry once on transient network errors with jittered backoff.
  • Validation: ensure VINs are 17 characters before calling; handle invalid VINs gracefully using the envelope’s status and data.valid flag when present.
  • Units and types: displacement is in liters; horsepower is an integer. Do not coerce nulls into numbers.
  • Coverage: global VIN decoding; fullest for US-market vehicles. US safety datasets are separate and US-only by design.
  • MCP server: if you are building AI agents or tool-calling experiences, the same capabilities are available via MCP at MCP.

Security and deployment checklist

  • Secrets management: store YOUR_API_KEY in your server’s secret manager or environment, not in source control.
  • Network egress: allow outbound HTTPS to vehicles-api.com.
  • Observability: log status, source, and error.code on failures; capture latency and timeout counts.
  • Graceful degradation: if decoding is temporarily unavailable, serve cached results when possible.
  • Data governance: these specs are not a vehicle history report. Communicate that engine data reflects manufacturer/NHTSA publication and may include nulls for unavailable attributes.

How this fits into your stack

Typical use cases include dealer websites, marketplace listing ingestion, fleet inventory audit, underwriting enrichment, and agent tools. For each VIN:

  • Call POST /vin/decode once (or read from cache) to obtain engine specs.
  • Persist normalized engine attributes in your domain model (e.g., engine.cylinders, engine.displacement_l, engine.hp).
  • Render or score based on engine characteristics (e.g., fuel type, displacement).
  • Optionally combine with US safety data endpoints in your backend if you serve US market vehicles; those are matched by make + model + year, not by VIN for non-decoding datasets.

If you are building multi-agent or LLM systems, the same functionality is offered via MCP to keep tool access consistent with your agent runtime. Learn more at https://vehicles-api.com or use the MCP link above.

Testing with the control VIN

The official example VIN (1HGCM82633A004352) is a 2003 HONDA Accord EX-V6 Coupe. Use it to validate your parsing and presentation:

  • Engine is a V-shaped 3.0L J30A4, 6 cylinders, 240 hp, Gasoline.
  • Electrification fields (electrification_level, ev_drive_unit, battery_kwh, charger_level, charger_power_kw) are null. Confirm your UI hides EV-only badges when these are null.
  • Some ancillary fields like drive may be null; ensure your mappers tolerate this.

Response envelope recap

  • On success:
    • status: "success"
    • source: "nhtsa"
    • data: object with vin, valid, year, make, model, trim, body, doors, vehicle_type, engine, fuel_type, electrification fields (nullable), drive (nullable), transmission, plant, manufacturer
  • On error:
    • status: "error"
    • error.code: machine-readable error key
    • error.message: human-readable explanation

Build your client around status first, then parse the fields you need from data when successful.

Where to go next

FAQ

Does VIN decoding work outside the US?
Yes. VIN decoding works worldwide, with the most complete data coverage for US-market vehicles.

Are recalls, complaints, and NCAP ratings included in this response?
No. This guide covers the VIN engine specs decode. US safety datasets are available separately and are matched by make + model + year for US-market vehicles.

Can Dutch plates return a VIN?
No. Dutch plates (from RDW open data) never include a VIN. Use the VIN decode endpoint when you have a VIN.

How should I handle null engine fields?
Keep nulls as-is and adjust your UI/logic accordingly. Fields that NHTSA does not publish are returned as null.

What’s the best way to reduce costs?
Cache decoded VINs on your server. Engine specs for a VIN are stable, so you can safely serve future requests from your cache.

Start your integration now. Every plan includes a 7-day free trial, and the Starter tier begins at $19/mo. Create your key at Register and follow the Documentation to ship your VIN Engine Specs integration.