
You need to reliably extract a vehicle’s transmission from a VIN and wire it into your server-side workflow. By the end of this guide, you’ll decode a VIN with Vehicle API, read the transmission fields from the response envelope, handle errors and nulls, cache results, and ship a production-ready integration—without exposing your API key in the browser.
What this endpoint returns and when to use it
The VIN decode endpoint parses any 17-character VIN worldwide and returns normalized year, make, model, trim, engine, transmission, assembly plant and related fields. Transmission appears under data.transmission, including style (e.g., Automatic or Manual) and speeds (e.g., 5). Coverage is fullest for US-market vehicles because the data source is the NHTSA vPIC database.
- US-market safety data (recalls, owner complaints, NCAP crash ratings) is available separately and is matched by make + model + year, not by VIN. It is US-only.
- Dutch plate lookups come from RDW open data and never include a VIN.
- This is not a vehicle history report. It does not include title, accident, or ownership history.
Every API response follows an envelope with status, source, and data. On error, you’ll receive status=error with error.code and error.message. Unpublished fields from NHTSA return as null rather than being omitted. That includes electrification fields for gasoline vehicles.
Endpoint and authentication
Base URL: https://vehicles-api.com/api/v1
Endpoint: POST /vin/decode
- Auth header: X-API-Key: YOUR_API_KEY (you may also send Authorization: Bearer YOUR_API_KEY)
- Content-Type: application/json
- Never embed keys in client-side code. Call this endpoint from your server.
Start your 7-day free trial (Starter is $19/mo) and get an API key here: Register. See the full API reference at Documentation, and explore the MCP server at MCP.
Quick start: cURL request
Use the official sample below to decode the control VIN (a 2003 Honda Accord). This VIN is for documentation; use your users’ VINs in production.
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"}'
Official JSON response (envelope and transmission fields)
{
"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."
}
}
Fields you’ll use for transmission-aware features:
- status: "success" or "error"
- source: "nhtsa" (origin of decoded data)
- data.vin: the VIN you requested
- data.valid: boolean checksum/format validation
- data.year, data.make, data.model, data.trim: normalize a vehicle listing or build filters
- data.transmission.style: "Automatic" or "Manual" (string)
- data.transmission.speeds: gear count (integer)
- data.drive: drivetrain; may be null when not published
- Electrification fields: null here because the sample VIN is a gasoline vehicle
Server-side integration in Python (requests)
This example decodes a VIN, extracts the transmission style and speeds safely, and handles envelope errors. It sets a timeout and never exposes the key client-side. Use json= for POST bodies.
import os
import requests
API_BASE = "https://vehicles-api.com/api/v1"
API_KEY = os.environ.get("VEHICLES_API_KEY") or "YOUR_API_KEY"
def decode_vin(vin: str, timeout_s: float = 5.0) -> dict:
url = f"{API_BASE}/vin/decode"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
}
body = {"vin": vin}
try:
resp = requests.post(url, headers=headers, json=body, timeout=timeout_s)
except requests.RequestException as e:
# Network, DNS, or TLS error; retry with backoff in production
raise RuntimeError(f"request_failed: {e}") from e
# HTTP-level errors: still try to parse JSON for API envelope if present
try:
payload = resp.json()
except ValueError:
resp.raise_for_status()
raise RuntimeError("invalid_json")
status = payload.get("status")
if status != "success":
err = payload.get("error", {}) or {}
code = err.get("code", "unknown_error")
msg = err.get("message", "unknown message")
raise RuntimeError(f"api_error code={code} message={msg}")
return payload
def get_transmission(vin: str) -> dict:
payload = decode_vin(vin)
data = payload.get("data") or {}
trans = data.get("transmission") or {}
# Fields may be null when not published
return {
"style": trans.get("style"),
"speeds": trans.get("speeds"),
"year": data.get("year"),
"make": data.get("make"),
"model": data.get("model"),
}
if __name__ == "__main__":
result = get_transmission("1HGCM82633A004352")
print(result)
Note: For GET endpoints elsewhere in the API, pass query strings with params= in requests.get(..., params={"key": "value"}). The VIN decode endpoint shown here is POST and uses json=.
Server-side integration in PHP (cURL)
This PHP example posts a VIN, checks the envelope, handles error.code and error.message, and extracts the transmission fields. It uses a short timeout; tune for your environment.
<?php
$apiBase = "https://vehicles-api.com/api/v1";
$apiKey = getenv("VEHICLES_API_KEY") ?: "YOUR_API_KEY";
$vin = "1HGCM82633A004352";
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $apiBase . "/vin/decode",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => [
"X-API-Key: " . $apiKey,
"Content-Type: application/json",
],
CURLOPT_POSTFIELDS => json_encode(["vin" => $vin], JSON_UNESCAPED_SLASHES),
CURLOPT_TIMEOUT => 5, // seconds
]);
$raw = curl_exec($ch);
if ($raw === false) {
$err = curl_error($ch);
curl_close($ch);
throw new RuntimeException("request_failed: " . $err);
}
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
$payload = json_decode($raw, true);
if (!is_array($payload)) {
if ($httpCode >= 400) {
throw new RuntimeException("http_error: " . $httpCode);
}
throw new RuntimeException("invalid_json");
}
if (($payload["status"] ?? null) !== "success") {
$code = $payload["error"]["code"] ?? "unknown_error";
$msg = $payload["error"]["message"] ?? "unknown message";
throw new RuntimeException("api_error code=$code message=$msg");
}
$data = $payload["data"] ?? [];
$trans = $data["transmission"] ?? [];
$result = [
"style" => $trans["style"] ?? null,
"speeds" => $trans["speeds"] ?? null,
"year" => $data["year"] ?? null,
"make" => $data["make"] ?? null,
"model" => $data["model"] ?? null,
];
print json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . PHP_EOL;
Understanding nulls, coverage, and field availability
VIN decoding works worldwide. However, data availability differs by market and model year. If NHTSA does not publish a field for a given VIN, the API returns that field as null. In the official sample, all electrification fields are null because the control vehicle is gasoline. The drivetrain (data.drive) can also be null.
- Plan for nulls when you map transmission into forms, filters, or UI labels. Never assume data.transmission.style or data.transmission.speeds are present.
- US safety datasets (recalls, complaints, NCAP crash ratings) are US-only and matched on make + model + year, not VIN.
- Dutch plate data from RDW is separate and does not include a VIN; do not try to join by VIN.
Response envelope, errors, and timeouts
Every response is an envelope. Expect:
- On success: status=success, source=nhtsa, data={...}
- On error: status=error, error.code, error.message
Design your integration to:
- Use server-side HTTPS with a short timeout (e.g., 3–10s) and retries with backoff on transient network failures.
- Check status before reading data.* keys. If status != success, read error.code and error.message and surface a useful message.
- Log the source to aid debugging when comparing results across providers.
Rate limits, monthly quota, and production considerations
Vehicle API enforces per-plan rate limits and a monthly quota. Exact values depend on your plan; consult the Documentation for current details. Common production patterns include:
- Caching: VIN decodes are stable for a given VIN. Cache the result keyed by the VIN (or a normalized uppercase VIN) and avoid re-decoding until you change your schema or refresh policy.
- Deduplication: Hash and coalesce concurrent decode requests for the same VIN.
- Backoff: Respect HTTP 429 or error.code signaling throttling by backing off before retrying.
- Server-only usage: Never send your key from the browser or mobile client. Proxy via your backend.
Using transmission in real features
- Search filters: Derive an “Automatic” or “Manual” filter from data.transmission.style. Fall back gracefully if null.
- Form autofill: Pre-populate transmission and gear count when a sales rep scans a VIN; let users override on edge cases.
- Insurance/fleet rules: Use style and speeds to drive underwriting logic or maintenance schedules; record the raw JSON alongside normalized fields.
Field map for transmission-centric builds
| Field | Type | Purpose | Notes |
|---|---|---|---|
| data.transmission.style | string | Automatic/Manual labeling; search filters; pricing rules | Nullable; treat unknown as “Unspecified” in UI |
| data.transmission.speeds | integer | Gear count; maintenance rules; configuration | Nullable; not all records publish this value |
| data.drive | string | Drivetrain context for listings | Nullable; not all records publish drive |
| data.engine.* | object | Complement to transmission: power, displacement, fuel | Useful for search facets and compatibility checks |
MCP access for agents and tools
Beyond REST, Vehicle API is available as an MCP server at MCP, enabling AI agents and internal tools to request the same VIN decoding capability with structured responses. MCP returns the same transmission fields, so your server logic and caching strategy can remain consistent.
Testing, observability, and rollback
- Golden VINs: Keep a small set of test VINs (including the control VIN shown here) in your CI to catch schema regressions.
- Schema monitoring: Alert when the API envelope (status, source, data) is missing or transmission fields are absent for a non-trivial percentage of calls.
- Shadow logging: Store the raw JSON for a limited time to diagnose mismatches between UI and source fields, with PII controls appropriate for your organization.
- Feature flags: Gate new mapping logic (e.g., re-labeling transmission styles) behind a flag for safe experiment rollout.
Security and compliance notes
- Keys in servers only: Terminate TLS on your backend and call the API server-to-server. Do not embed keys in web or mobile clients.
- Header choice: Prefer X-API-Key. Authorization: Bearer also works if your platform standardizes on Bearer tokens.
- Input validation: Ensure VIN strings are 17 characters, uppercase, and trimmed before calling to reduce unnecessary requests.
Troubleshooting common errors
- HTTP 401 or status=error with auth code: Ensure the X-API-Key header is present server-side and correct. Do not pass it in query params.
- HTTP timeouts: Use a short timeout and implement retries with jitter. Check that you are not blocking outbound HTTPS in your network.
- Null transmission fields: The source may not publish them for that VIN. Keep UI render-safe defaults and avoid hard failures on null.
- High request volume: Employ caching by VIN to reduce repeated decodes and to stay within rate and quota limits.
FAQ
Is transmission always available from a VIN?
Not always. If the source does not publish transmission details for that VIN, data.transmission.style or data.transmission.speeds can be null. Handle nulls gracefully.
Does this include US safety data?
VIN decoding is worldwide, but recalls, complaints, and NCAP crash ratings are available for US-market vehicles only and are matched by make + model + year, not by VIN.
Can I get a VIN from a Dutch plate?
No. Dutch plates are sourced from RDW open data and never include a VIN.
Is this a vehicle history report?
No. This endpoint decodes a VIN to specifications like transmission, engine, and body. It does not include title, accident, or ownership history.
How should I cache decoded VINs?
Cache by the 17-character VIN (normalized uppercase). VIN decode results are stable; refresh on your schedule and invalidate if your mapping or schema changes.
Ready to add transmission decoding to your app? Start your 7-day free trial and get an API key in minutes: Register. Explore more options and coverage details in the Documentation and the MCP reference at vehicles-api.com.