
You need to determine a vehicle’s fuel type from a VIN and wire it into dealer tools, marketplace listings, fleet dashboards, insurance quotes, or an AI agent. By the end of this post you’ll be able to call the Vehicle API VIN decoder, read fuel_type and engine.fuel reliably, handle nulls for non-published fields, and ship production-grade error handling and caching.
What this endpoint returns and when to use it
The VIN decode endpoint returns core vehicle specs decoded from a 17-character VIN, including the specific fuel type reported by NHTSA vPIC. For most use cases focused on fuel, you will read two fields:
- fuel_type: a top-level convenience field, e.g., "Gasoline".
- engine.fuel: the engine’s fuel as reported by vPIC, e.g., "Gasoline".
Both come from the same authoritative source (NHTSA) when available. For the control VIN used below, both return “Gasoline”. Electrification fields (electrification_level, battery_kwh, charger_level, charger_power_kw, ev_drive_unit) are null for non-electrified vehicles—do not expect values for gasoline-only powertrains.
Coverage details you should plan around:
- VIN decoding works worldwide but is fullest for US-market vehicles.
- US safety data (recalls, complaints, NCAP ratings) are matched by year + make + model and apply to US-market vehicles only.
- Dutch plate data is sourced from RDW open data and never includes a VIN.
- This is not a vehicle history report—no title, accident, or ownership history.
Base URL for REST: https://vehicles-api.com/api/v1. Authentication header: X-API-Key: YOUR_API_KEY. Authorization: Bearer also works. You can also reach the service as an MCP server at MCP.
VIN Fuel Type: official request and response
The following request decodes the control VIN 1HGCM82633A004352 (a 2003 Honda Accord EX-V6). Copy this verbatim to validate your integration:
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 example JSON response:
{
"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."
}
}
Parsing fuel_type and engine.fuel in code
Below is a minimal Python example that posts the VIN and reads the fuel type fields. It also demonstrates envelope handling and null checks.
import os
import json
import requests
API_KEY = os.getenv("VEHICLES_API_KEY", "YOUR_API_KEY")
URL = "https://vehicles-api.com/api/v1/vin/decode"
payload = {"vin": "1HGCM82633A004352"}
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json",
}
resp = requests.post(URL, headers=headers, data=json.dumps(payload), timeout=10)
resp.raise_for_status()
body = resp.json()
# Envelope: status, source, data OR status=error with error.code and error.message
if body.get("status") != "success":
err = body.get("error", {})
code = err.get("code", "unknown_error")
msg = err.get("message", "Request failed")
raise RuntimeError(f"Vehicle API error: {code} - {msg}")
data = body.get("data", {}) or {}
top_level_fuel = data.get("fuel_type") # e.g., "Gasoline" or None
engine = data.get("engine", {}) or {}
engine_fuel = engine.get("fuel") # e.g., "Gasoline" or None
# Prefer the explicit engine.fuel if you need consistency with other engine specs;
# otherwise fuel_type is a convenient single field:
resolved_fuel = engine_fuel or top_level_fuel
print({
"vin": data.get("vin"),
"year": data.get("year"),
"make": data.get("make"),
"model": data.get("model"),
"fuel_type": top_level_fuel,
"engine_fuel": engine_fuel,
"resolved_fuel": resolved_fuel,
})
Field-by-field notes for fuel detection
Focus fields you will likely use:
- data.fuel_type: String fuel, e.g., "Gasoline". Use this for simple UI labels and filtering.
- data.engine.fuel: The engine’s fuel as published by vPIC. Use this if you are already reading engine details and need a single engine object to represent fuel and power specs together.
Related fields you can use to present a coherent spec sheet (units in parentheses):
- data.engine.hp (horsepower): 240
- data.engine.displacement_l (liters): 3
- data.engine.cylinders: 6
- data.transmission.style: "Automatic"
- data.transmission.speeds: 5
Electrification-specific fields are null for the gasoline control vehicle:
- data.electrification_level: null
- data.ev_drive_unit: null
- data.battery_kwh: null
- data.charger_level: null
- data.charger_power_kw: null
Expect nulls for any field NHTSA does not publish for a given VIN. Handle nulls explicitly rather than attempting to infer values. For example, do not assume hybrid or EV details exist when fuel is "Gasoline."
Understanding the response envelope, errors, and nulls
Every response is an envelope:
- status: "success" or "error".
- source: "nhtsa" for VIN decoding.
- data: present only when status is "success".
On errors, the envelope includes:
- error.code: a short machine-friendly string.
- error.message: a human-readable explanation.
Production code should check status first, then parse data. A missing field or a null value means it is not available from vPIC for that VIN. Prefer defensive parsing and defaulting behavior in your application layer. For example, if both data.fuel_type and data.engine.fuel are null, hide fuel-related UI and mark the record for review.
Caching decoded VINs safely
VIN decode outputs are effectively static for a given 17-character VIN: year, make, model, trim, engine, transmission, and plant do not change. As a result:
- Cache decoded VINs keyed by VIN. Because the output is static, you can retain cache entries long-term.
- Invalidate only when your upstream data dependencies change or you add new fields your app needs.
- When caching, store both fuel_type and engine.fuel so you can serve consistent data even if one is null.
For rate limits and monthly quota, check your plan and the Documentation. If you anticipate spikes, caching decoded VINs and batching requests will reduce latency and quota consumption.
Coverage boundaries to plan for
- VIN decoding: Works worldwide; completeness is strongest for US-market vehicles.
- US safety data: Recalls, owner complaints, and NCAP ratings are US-market only and matched by make + model + year, not VIN-level. These are not included in the fuel-type example above but may inform your downstream UX.
- Dutch plates (RDW): Useful for plate-first lookups in the Netherlands but never include a VIN. Keep that in mind if you are building flows that expect to join by VIN later.
- No history: Vehicle API does not provide title, accident, or ownership history.
If your workflow combines VIN-first and plate-first paths, normalize your data around the year + make + model when crossing into US safety data, and keep a separate path for RDW plate records that do not include VINs.
Practical implementation details
Authentication
REST: send X-API-Key: YOUR_API_KEY on each request. Authorization: Bearer is also accepted if that better fits your client libraries. The base URL is https://vehicles-api.com/api/v1.
Transport and payload
- Method: POST
- Endpoint: /vin/decode
- Body: JSON with vin set to a 17-character string
- Content-Type: application/json
Rate limits and monthly quota
Plans apply rate limits and monthly quotas. Exact numbers depend on your plan; see the Documentation. Design your client to:
- Cache VIN decodes to minimize repeat calls.
- Handle 429 or quota-exceeded responses by retrying with backoff and serving from cache.
Error handling
- Check status in the envelope. If status is "error", read error.code and error.message for actionable diagnostics.
- Vin validation: If data.valid is false, treat the VIN as invalid even if the request succeeded.
- Transport-level errors (timeouts, 5xx): retry with jittered backoff when appropriate.
Units and formatting
- engine.displacement_l: liters (numeric)
- engine.hp: horsepower (numeric)
- fuel_type and engine.fuel: string enums such as "Gasoline"
- electrification and charging fields: numeric where applicable (e.g., battery_kwh, charger_power_kw) or string enums (e.g., charger_level), otherwise null
MCP integration
If you are building an AI agent or toolchain that uses the Model Context Protocol, Vehicle API is also available as an MCP server at MCP. This can simplify agent access to the same VIN decoding data without custom HTTP code.
Designing your fuel-type logic
Use a straightforward resolution strategy that guards against nulls:
- Prefer engine.fuel when present to keep engine attributes together.
- Fallback to the top-level fuel_type when engine.fuel is null.
- If both are null, mark the record as “Fuel: Unknown” in UI and log for review.
When displaying electrification info:
- Show electrification_level and battery_kwh only if not null.
- Do not infer EV status from other fields; a gasoline car can still have modern driver assistance features, but its electrification fields will remain null.
Frequently asked questions
Does the API return accurate fuel type for non-US VINs?
Yes, the VIN decoder works worldwide, but completeness is strongest for US-market vehicles. If a field is not published by NHTSA for the VIN, it will be null. Always handle nulls defensively.
Should I store both fuel_type and engine.fuel?
Yes. Store both and prefer engine.fuel when building engine-centric UIs. Use fuel_type as a simple top-level label or filter.
Can I rely on this for EV battery and charger details?
Only when those fields are not null. For non-electrified vehicles, electrification fields will be null. Do not infer battery_kwh or charger_level.
How should I cache VIN decodes?
Cache by VIN because decode results are static. Retain long-term and update only if your application starts reading additional fields.
What about quotas and rate limits?
They depend on your plan. Cache decodes to reduce usage and consult the Documentation for specifics.
Start building with the VIN Fuel Type endpoint now. The Starter plan is $19/month and every plan includes a 7-day free trial. Create your key here: Register. Explore more at vehicles-api.com and integrate via REST or MCP. For full reference, see the Documentation and keep vehicles-api.com handy for updates.