Vehicle Report API for Developers

By Vehicle API
Vehicle Report API for Developers

You need a single server-side call that returns trustworthy vehicle specs from a VIN and, when available for US-market vehicles, the associated recall campaigns, owner complaint counts, and NCAP crash ratings. By the end of this guide you will post a VIN to one endpoint, parse the unified response envelope, handle errors and nulls correctly, cache results, and ship a production-ready integration of the Vehicle Report in your dealer, marketplace, fleet, insurance, or AI workflow.

What you get from the Vehicle Report endpoint

The Vehicle Report unifies VIN decoding with US safety data in one response:

Illustration: Vehicle Report API for Developers
  • Worldwide VIN decoding (year, make, model, trim, engine, transmission, assembly plant) sourced from NHTSA vPIC.
  • For US-market vehicles: official NHTSA recall campaigns, owner complaints count, and NCAP crash ratings by make + model + year.
  • Graceful coverage behavior: non-US VINs respond 200 with specs only.

This is not a vehicle history report; it does not include title events, accidents, or ownership history. Dutch registration (RDW) data is also available in the platform and never includes a VIN; it is separate from this VIN-based report. Learn more about the platform at https://vehicles-api.com and explore the Documentation.

Endpoint and authentication

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

Endpoint: POST /vin/report

Auth:

  • Preferred: X-API-Key: YOUR_API_KEY header.
  • Alternative: Authorization: Bearer YOUR_API_KEY also works.

Every response is wrapped in a consistent envelope with these top-level fields:

  • status: "success" or "error"
  • source: data origin (e.g., "nhtsa") when successful
  • data: the decoded vehicle and safety payload when successful
  • error: object with code and message when status is "error"

Implementers should never ship the key in browser code. Call this endpoint from your server or private worker only.

Official cURL and JSON example

Copy and run this exact example to verify your integration. It uses the control VIN 1HGCM82633A004352 for a 2003 Honda Accord. This is a fixture, not your user’s vehicle.

curl -X POST "https://vehicles-api.com/api/v1/vin/report" -H "X-API-Key: YOUR_API_KEY" -H "Content-Type: application/json" -d '{"vin":"1HGCM82633A004352"}'

Official example JSON (fields and values below are from the docs and may differ from live data as NHTSA and RDW publish updates):

{
    "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,
            "fuel": "Gasoline"
        },
        "fuel_type": "Gasoline",
        "electrification_level": null,
        "ev_drive_unit": null,
        "battery_kwh": null,
        "charger_level": null,
        "charger_power_kw": null,
        "plant": {
            "country": "UNITED STATES (USA)",
            "city": "MARYSVILLE",
            "state": "OHIO"
        },
        "manufacturer": "AMERICAN HONDA MOTOR CO., INC.",
        "coverage": "us",
        "recalls_count": 24,
        "recalls": [
            {
                "campaign": "19V182000",
                "component": "AIR BAGS:FRONTAL:DRIVER SIDE:INFLATOR MODULE",
                "received": "2019-03-06",
                "summary": "Replacement driver air bag inflator may explode.",
                "consequence": "Sharp metal fragments may strike occupants.",
                "remedy": "Dealers will replace the inflator, free of charge."
            }
        ],
        "complaints_count": 2013,
        "safety_ratings": {
            "match": "partial",
            "vehicle_description": "2003 Honda Accord 2-DR.",
            "overall": null,
            "front": {
                "driver": 5,
                "passenger": 5
            },
            "side": {
                "driver": 5,
                "passenger": 5
            },
            "rollover": 4
        }
    }
}

Field highlights you will actually use

  • data.vin and data.valid: echo and validity flag for the decoded VIN.
  • Core specs: data.year, data.make, data.model, data.trim, data.body, data.doors, data.vehicle_type.
  • Engine: data.engine.cylinders, data.engine.displacement_l (liters), data.engine.fuel and the top-level data.fuel_type for convenience.
  • Electrification: data.electrification_level, data.ev_drive_unit, data.battery_kwh, data.charger_level, data.charger_power_kw — expect null when not applicable.
  • Assembly plant: data.plant.country, data.plant.city, data.plant.state, plus data.manufacturer.
  • Coverage indicator: data.coverage = "us" when US-market safety joins are possible.
  • Recalls: data.recalls_count and data.recalls[].campaign/component/received/summary/consequence/remedy (NHTSA official text).
  • Complaints: data.complaints_count (integer count of owner complaints in NHTSA database).
  • NCAP ratings: data.safety_ratings with front/side/rollover stars; overall may be null when an exact trim/body match is not available.

Nulls are intentional when a field does not apply (e.g., EV fields on a gasoline vehicle) or when a specific safety rating is not published for the exact variant. Handle nulls without failing your UI.

Python server example (requests) with timeouts and envelope handling

This snippet posts a VIN, enforces a timeout, and demonstrates how to read the top-level envelope and handle error.code. Use json= for POST and keep your API key on the server. If you later use GET endpoints in the same platform, pass their filters via params= in requests.get(...).

import requests

API_BASE = "https://vehicles-api.com/api/v1"
API_KEY = "YOUR_API_KEY"
TIMEOUT_SECONDS = 8.0

def fetch_vehicle_report(vin: str) -> dict:
url = f"{API_BASE}/vin/report"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
}
try:
resp = requests.post(
url,
json={"vin": vin},
headers=headers,
timeout=TIMEOUT_SECONDS,
)
except requests.RequestException as ex:
# Network or DNS error; decide whether to retry upstream.
raise RuntimeError(f"vehicles-api network error: {ex}") from ex

# The API responds with a JSON envelope on success and on error.
try:
payload = resp.json()
except ValueError:
raise RuntimeError(f"vehicles-api returned non-JSON with HTTP {resp.status_code}")

status = payload.get("status")
if status != "success":
err = payload.get("error") or {}
code = err.get("code", "unknown_error")
message = err.get("message", "Unspecified error")
# Map or log the provider error code for observability.
raise RuntimeError(f"vehicles-api error {code}: {message}")

data = payload.get("data", {})
# Example: read core fields you will display or store.
normalized = {
"vin": data.get("vin"),
"valid": data.get("valid"),
"year": data.get("year"),
"make": data.get("make"),
"model": data.get("model"),
"trim": data.get("trim"),
"engine_cyl": (data.get("engine") or {}).get("cylinders"),
"engine_displacement_l": (data.get("engine") or {}).get("displacement_l"),
"fuel_type": data.get("fuel_type"),
"plant_city": (data.get("plant") or {}).get("city"),
"plant_state": (data.get("plant") or {}).get("state"),
"plant_country": (data.get("plant") or {}).get("country"),
"coverage": data.get("coverage"),
"recalls_count": data.get("recalls_count"),
"complaints_count": data.get("complaints_count"),
"ncap_front_driver": ((data.get("safety_ratings") or {}).get("front") or {}).get("driver"),
"ncap_front_passenger": ((data.get("safety_ratings") or {}).get("front") or {}).get("passenger"),
"ncap_side_driver": ((data.get("safety_ratings") or {}).get("side") or {}).get("driver"),
"ncap_side_passenger": ((data.get("safety_ratings") or {}).get("side") or {}).get("passenger"),
"ncap_rollover": (data.get("safety_ratings") or {}).get("rollover"),
}
return normalized

if __name__ == "__main__":
report = fetch_vehicle_report("1HGCM82633A004352")
print(report)

PHP server example (cURL) with timeouts and envelope handling

This PHP example posts the same VIN with X-API-Key, applies a connection and response timeout, and handles the standard response envelope including error.code and error.message.

<?php
$apiBase = "https://vehicles-api.com/api/v1";
$apiKey = "YOUR_API_KEY";
$vin = "1HGCM82633A004352";

$url = $apiBase . "/vin/report";
$payload = json_encode(["vin" => $vin]);

$ch = curl_init($url);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-API-Key: " . $apiKey,
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_CONNECTTIMEOUT => 5, // seconds to establish TCP connection
CURLOPT_TIMEOUT => 8, // total seconds for the request
]);

$raw = curl_exec($ch);
if ($raw === 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);

$payload = json_decode($raw, true);
if (!is_array($payload)) {
throw new RuntimeException("vehicles-api returned non-JSON (HTTP $httpCode): " . substr($raw, 0, 200));
}

if (($payload["status"] ?? "error") !== "success") {
$code = $payload["error"]["code"] ?? "unknown_error";
$message = $payload["error"]["message"] ?? "Unspecified error";
throw new RuntimeException("vehicles-api error $code: $message");
}

$data = $payload["data"] ?? [];
$result = [
"vin" => $data["vin"] ?? null,
"valid" => $data["valid"] ?? null,
"year" => $data["year"] ?? null,
"make" => $data["make"] ?? null,
"model" => $data["model"] ?? null,
"trim" => $data["trim"] ?? null,
"engine_displacement_l" => $data["engine"]["displacement_l"] ?? null,
"fuel_type" => $data["fuel_type"] ?? null,
"recalls_count" => $data["recalls_count"] ?? 0,
"complaints_count" => $data["complaints_count"] ?? 0,
"ncap_rollover" => $data["safety_ratings"]["rollover"] ?? null,
];
// Do something with $result, e.g. persist to DB or render as JSON.
echo json_encode($result, JSON_PRETTY_PRINT);

Caching strategy and deduplication

VIN decodes are stable and excellent candidates for caching. Cache the entire success envelope (or at least the data node) keyed by VIN. Suggested TTLs:

  • Core specs: long TTL (e.g., 7–30 days) because year/make/model/trim/plant do not change.
  • Safety overlays (recalls, complaints_count, safety_ratings): shorter TTL (e.g., 1–7 days) to pick up new campaigns or updated counts.

Persist the response version you displayed to users to avoid mid-session changes. Always handle nulls and absent fields on reads to keep your UI resilient.

Coverage details that affect your UI

  • VIN decoding: works worldwide and is fullest for US-market vehicles. Non-US VINs return specs and indicate coverage for safety as applicable.
  • Recalls, complaints, NCAP ratings: US-market only and matched by make + model + year. For vehicles without US coverage, expect recalls_count = 0, complaints_count = 0, and safety_ratings fields possibly null or absent.
  • Dutch plates: provided from RDW open data and never include a VIN. Plate lookups are a separate flow from this VIN report and can be combined in your application logic as needed.

Document these rules in your product UI so users understand why some vehicles show safety data while others show specs only. For an introduction to the platform modes, see https://vehicles-api.com and the MCP server for AI agents and tools.

Error handling, rate limits, and quotas

In all cases, check the top-level status in the JSON. When status is "error", read error.code and error.message to determine whether to retry or present a message to the user. Implement idempotent retries only on network failures and transient errors surfaced by your own retry policy.

  • Rate limits: enforce client-side throttling and exponential backoff. If you receive an error envelope that indicates throttling in error.code or error.message, slow down and retry later.
  • Monthly quota: monitor your usage and handle over-quota conditions via the error envelope. Surface a clear message to your operators when approaching a plan cap.
  • Timeouts: set both connect and total timeouts (examples above). Treat timeouts as transient and consider a single retry.
  • Data freshness: null or missing fields are legitimate states, not errors, when coverage is partial or not applicable.

Plans start at $19/month, and every plan has a 7-day free trial. You can start a trial instantly: Register.

Production notes: schema stability, units, and observability

  • Schema stability: The envelope (status, source, data | error) is consistent. New fields may be added; write defensive parsers that ignore unknown keys.
  • Units: engine.displacement_l is liters. Star ratings are integers. Dates (e.g., recalls[].received) are ISO-like YYYY-MM-DD strings; store as date or normalized UTC timestamps in your system.
  • Text fields: recall summaries, consequences, and remedies are official NHTSA text. Store as UTF-8 and preserve punctuation.
  • Observability: log the request VIN, the provider source, coverage, and any error.code for rapid triage.
  • Security: only call from server-side code. Never embed the API key in mobile or browser JavaScript.

Server-side integration checklist

  • Authentication: set X-API-Key header, optionally Authorization: Bearer as an alternative.
  • POST body: {"vin": "…"} using application/json and a reasonable timeout.
  • Envelope parsing: require status == "success" before reading data; otherwise inspect error.code and error.message.
  • Null-safe reads: check for null on electrification, safety ratings, and other optional fields.
  • Caching: long TTL for specs, shorter TTL for safety overlays; key by VIN and invalidate predictably.
  • Backoff: respect rate limits using exponential backoff; avoid hot loops on persistent errors.
  • Coverage logic: gate safety UI on data.coverage == "us" and the counts/ratings actually present.

Common field mappings to your domain models

  • Vehicle entity: vin, valid, year, make, model, trim, body, doors, vehicle_type, manufacturer, plant.city/state/country.
  • Powertrain: engine.cylinders, engine.displacement_l, engine.fuel or fuel_type. EV-related fields if not null (electrification_level, ev_drive_unit, battery_kwh, charger_level, charger_power_kw).
  • Safety snapshot: recalls_count, complaints_count, and safety_ratings (front/side/rollover). Store a copy of recalls[] if you need detailed display, including campaign IDs.
  • Coverage flag: coverage used to conditionally fetch or display US safety data.

MCP endpoint for agents and tools

In addition to the JSON REST API at /api/v1, the same data is hosted as an MCP server for agent ecosystems: MCP. Use this when integrating LLM-based agents or tools that natively support MCP transport so your agent can retrieve VIN specs and US safety overlays without scraping.

Troubleshooting tips

  • 200 with partial data: expected for non-US vehicles; specs will be present, safety fields may be null or zero.
  • Null NCAP overall: ratings can be partial. Use front/side/rollover individually when overall is null.
  • VIN invalid: status may still be success with valid=false; present a helpful message and ask the user to recheck the VIN.
  • Intermittent timeouts: reduce concurrency and add backoff; increase your cache hit rate to lower pressure on upstream calls.

FAQ

Does the Vehicle Report include title, accident, or ownership history?
No. It provides decoded specs from the VIN and, for US-market vehicles, official NHTSA recalls, owner complaints count, and NCAP ratings. It is not a vehicle history report.

What happens for a non-US VIN?
You still receive a 200 with specs populated. Safety overlays (recalls, complaints, NCAP) are US-market only and may be absent or null.

Why are some electrification fields null?
They are null when the vehicle is not electrified or when the specific attribute is not applicable. Always treat null as a valid state.

How should I cache results?
Cache by VIN. Use a long TTL for specs and a shorter TTL for safety overlays. Invalidate or refresh at login, listing edit, or scheduled intervals depending on your product.

Can I call this endpoint from the browser?
Do not expose your API key in browser or mobile apps. Call from your server or private worker only and forward a minimal response to the client.

Start building

You now have a server-side template for posting a VIN to the Vehicle Report endpoint, parsing the stable response envelope, handling nulls and partial coverage gracefully, and caching decoded data. Create your key and start the 7-day free trial: Register. For full parameter and field references, see the Documentation and learn about the agent integration path at MCP.