
You need to turn a VIN into trustworthy NCAP crash-test star ratings to power listings, underwriting, fleet eligibility checks, and AI agent prompts. By the end of this guide you will sign up, get an API key, call the NCAP Crash Ratings endpoint with curl or code, and correctly read the response envelope, match quality, null fields, and coverage caveats.
What you’ll build: NCAP crash ratings from a VIN
The Vehicle API exposes US NHTSA NCAP crash-test star ratings (frontal, side, rollover, and sometimes overall) through a single REST endpoint. You provide a VIN; the API returns a normalized document with star ratings, match quality, and the NHTSA vehicle identifier when available. Ratings are matched by make + model + year and only cover US-market vehicles.
Before writing code:
- Start your 7‑day free trial (Starter is $19/mo after trial).
- Copy your API key from the dashboard.
- Test the documented curl against the control VIN to validate your setup.
Access: sign up and get your key
Create an account to begin the trial and access the dashboard key:
- Sign up here: Register
- Review the API reference if needed: Documentation
Authentication:
- Use the X-API-Key header with your key: X-API-Key: YOUR_API_KEY
- Alternatively, Authorization: Bearer YOUR_API_KEY is also accepted.
Base URL for REST requests: https://vehicles-api.com/api/v1
If you prefer tool-less integration for agents and tools, you can connect to the MCP server at: MCP
Endpoint: GET /vin/safety-ratings
The NCAP Crash Ratings endpoint accepts a VIN and returns US NHTSA crash-test star ratings when available for the decoded make, model, and year. Ratings are US-market only; a valid non‑US VIN returns a coverage_us_only error.
- Method: GET
- URL: https://vehicles-api.com/api/v1/vin/safety-ratings
- Query parameters: vin (string)
- Headers: X-API-Key: YOUR_API_KEY
Step 1 — Test with the official curl
Copy this exact command to validate your setup with the control VIN (a 2003 Honda Accord). This is a known-good example to confirm your headers, endpoint path, and query string. Replace YOUR_API_KEY with your dashboard key when you are ready to run it.
curl
curl "https://vehicles-api.com/api/v1/vin/safety-ratings?vin=1HGCM82633A004352" -H "X-API-Key: YOUR_API_KEY"
Step 2 — Read the response envelope
Every Vehicle API response uses a consistent envelope:
- status: "success" or "error"
- source: data origin (for this endpoint, "nhtsa")
- data: the payload when status is "success"
When status is "error", the body contains error.code and error.message. For NCAP ratings, a valid VIN that is not covered in the US returns a coverage_us_only error. Do not retry this case; it indicates that crash ratings are US-only and this VIN is out of scope.
Official JSON example
Here is the exact result from the control VIN request above. Use this to map fields in your code and to build tests. Live ratings can change as NHTSA updates their datasets.
Official JSON
{
"status": "success",
"source": "nhtsa",
"data": {
"vin": "1HGCM82633A004352",
"coverage": "us",
"match": "partial",
"vehicle_description": "2003 Honda Accord 2-DR.",
"overall": null,
"front": {
"overall": null,
"driver": 5,
"passenger": 5
},
"side": {
"overall": null,
"driver": 5,
"passenger": 5
},
"rollover": 4,
"nhtsa_vehicle_id": 4736
}
}
Field-by-field: what to display and how to interpret
Key fields you will likely render or use in business logic:
- data.vin: Echo of the VIN you requested; can be used as a cache key.
- data.coverage: "us" for US-market coverage. Ratings are US-only for NCAP.
- data.match: Indicates how precisely the ratings matched your VIN. Ratings are matched by make + model + year:
- partial means not all sub-attributes (like trim/body) are distinguished by NHTSA for that year/model.
- data.vehicle_description: NHTSA’s vehicle description string for the matched record.
- data.overall: Overall star rating, or null if NHTSA did not publish it for that configuration/year.
- data.front: Object containing driver and passenger frontal crash star ratings. front.overall may be null.
- data.side: Object containing driver and passenger side-impact star ratings. side.overall may be null.
- data.rollover: Rollover resistance star rating (number).
- data.nhtsa_vehicle_id: The NHTSA internal ID for the matched record; useful for cross-referencing.
Null fields are expected when NHTSA did not publish a particular score (for example, overall may be null even when frontal, side, and rollover scores exist). Do not treat null as an API failure; it represents “not available.”
JavaScript example: fetch and render NCAP stars
This JavaScript example calls the same endpoint, uses the response envelope, and safely handles null fields. It demonstrates both X-API-Key and Authorization headers; pick one.
JavaScript (Node.js or modern browser)
async function getNcapRatings(vin) {
const url = `https://vehicles-api.com/api/v1/vin/safety-ratings?vin=${encodeURIComponent(vin)}`;
const res = await fetch(url, {
headers: {
// Use ONE of these two headers. X-API-Key shown here:
'X-API-Key': 'YOUR_API_KEY'
// Or Authorization: Bearer
// 'Authorization': 'Bearer YOUR_API_KEY'
}
});
const body = await res.json();
if (body.status !== 'success') {
// The API returns an envelope with error.code and error.message on failures.
const code = body?.error?.code || 'unknown_error';
const message = body?.error?.message || 'Request failed';
throw new Error(`${code}: ${message}`);
}
const data = body.data;
// Carefully read fields that may be null.
const result = {
vin: data.vin,
coverage: data.coverage, // 'us' for NCAP
match: data.match, // 'partial' or similar
description: data.vehicle_description, // e.g., '2003 Honda Accord 2-DR.'
overall: data.overall, // may be null
front_driver: data.front?.driver ?? null,
front_passenger: data.front?.passenger ?? null,
front_overall: data.front?.overall ?? null, // may be null
side_driver: data.side?.driver ?? null,
side_passenger: data.side?.passenger ?? null,
side_overall: data.side?.overall ?? null, // may be null
rollover: data.rollover,
nhtsa_vehicle_id: data.nhtsa_vehicle_id
};
return result;
}
// Example usage with the control VIN:
getNcapRatings('1HGCM82633A004352')
.then(r => {
// Render with null-safe fallbacks
console.log(`VIN: ${r.vin}`);
console.log(`Coverage: ${r.coverage}, Match: ${r.match}`);
console.log(`Vehicle: ${r.description}`);
console.log(`Overall: ${r.overall ?? 'N/A'}`);
console.log(`Front - Driver: ${r.front_driver ?? 'N/A'}, Passenger: ${r.front_passenger ?? 'N/A'}, Overall: ${r.front_overall ?? 'N/A'}`);
console.log(`Side - Driver: ${r.side_driver ?? 'N/A'}, Passenger: ${r.side_passenger ?? 'N/A'}, Overall: ${r.side_overall ?? 'N/A'}`);
console.log(`Rollover: ${r.rollover ?? 'N/A'}`);
console.log(`NHTSA Vehicle ID: ${r.nhtsa_vehicle_id}`);
})
.catch(err => {
// If the VIN is outside US coverage for NCAP, you'll get an error envelope with coverage_us_only code.
console.error('NCAP fetch failed:', err.message);
});
Important integration details
Response envelope and errors
All successful responses use: status = "success", source = "nhtsa", data = {...ratings...}.
Errors use: status = "error", with error.code and error.message explaining the issue. For this endpoint specifically, a valid non‑US VIN will return coverage_us_only. Handle this by informing users that NCAP crash ratings are US-market only and skipping retries.
Coverage and matching model
- NCAP crash-test ratings are US-market only. They are matched by make, model, and year.
- An overall rating can be null when NHTSA has not published it for that vehicle configuration.
- match indicates the fidelity of the mapping between your VIN and the NHTSA record. A partial match still returns valid stars for the model-year, but you should convey that it is not trim-specific.
What this API is and is not
- Vehicle API provides VIN decoding, official US safety data (recalls, owner complaints, NCAP ratings), and Dutch plates from RDW open data.
- VIN decoding works worldwide, with the fullest detail for US-market vehicles.
- Recalls, complaints, and NCAP ratings are US-market only.
- Dutch plates never include a VIN; they are sourced from RDW open data.
- This is not a vehicle history report; it does not include title, accident, or ownership history.
Rate limits and monthly quota
Plans enforce a monthly quota and rate limits. When you exceed your quota or hit a rate limit, the API returns an error envelope with error.code and error.message indicating what happened. Inspect the message and your dashboard to decide whether to back off, retry later, or upgrade your plan. Since NCAP data changes infrequently, you can minimize calls with caching (see below) and keep well within limits.
Caching decoded VINs and ratings
- Use the VIN as a cache key for NCAP results. Crash ratings do not change often for a given model-year.
- Store the entire data object for rendering, including match and vehicle_description to explain context to users.
- Establish a refresh policy appropriate to your product (for example, periodic refresh) rather than fetching on every page load.
- Handle null fields: do not overwrite or “fill in” missing values; display N/A or hide that sub-rating.
Resilience and retries
- Do not retry coverage_us_only errors; the data is out of scope for NCAP’s US-only coverage.
- Idempotent GETs can be retried on transient network issues with exponential backoff. Keep retries conservative to respect rate limits.
- Cache negative results intelligently. If overall is null but frontal/side/rollover are present, cache all fields as returned.
Putting it into dealer, marketplace, fleet, insurance, and agent workflows
Developers typically need just a handful of fields for a visible safety summary. For listings or quoting flows, render frontal, side, and rollover stars with a simple legend and indicate when overall is “Not available.” The match field helps explain to users and auditors that ratings are matched at the model-year level by NHTSA, not always at the trim level. For fleets and underwriting rules, use numeric comparisons (e.g., rollover ≥ 4) and remember to guard for nulls.
AI agents can fetch this endpoint via REST or the MCP server to ground responses in official US safety data.
End-to-end: from trial to production
1) Start the trial
Begin your 7‑day free trial to obtain your key: Register. The Starter plan is $19/mo after the trial. All plans include the same simple authentication approach and response envelope.
2) Validate with curl
Use the documented curl with the control VIN to confirm your environment, networking, and headers. Keep this in your project README as a quick sanity check.
3) Implement code with null-safe parsing
Integrate the JavaScript example above (or a similar Python implementation) and ensure that null fields do not crash your UI. Use default rendering such as “N/A.”
4) Add caching and error handling
- Cache by VIN to minimize duplicate calls.
- Respect the error envelope. Do not retry coverage_us_only.
- Surface match and vehicle_description to support audits and end-user clarity.
5) Monitor usage
Watch your plan’s monthly quota and rate limits in the dashboard. If you integrate VIN decoding and other safety data (recalls, complaints) alongside NCAP, consider batching lookups and caching shared VIN results across endpoints to stay efficient.
FAQ
Does the NCAP Crash Ratings endpoint return results for non‑US vehicles?
No. NCAP ratings are US-market only. A valid non‑US VIN will return an error with a coverage_us_only code. VIN decoding is worldwide, but NCAP, recalls, and complaints are US-only.
Why is overall null when frontal, side, and rollover are present?
NHTSA does not publish the overall star rating for every configuration and model-year. A null overall means “not published,” not an API error. Display the available sub-ratings and show N/A for overall.
What does match = partial mean?
Ratings are matched by make + model + year. partial indicates NHTSA’s record does not uniquely distinguish your VIN’s trim/body for that year but the stars are valid for the model-year record.
How should I cache ratings?
Cache by VIN and store the entire data object, including match and vehicle_description. Since NCAP ratings rarely change for past model-years, periodic refresh is sufficient for most apps.
Do Dutch plates include a VIN?
No. Dutch plate data comes from RDW open data and never includes a VIN. If you need NCAP ratings for a Dutch vehicle, you must supply a VIN, and remember NCAP coverage is US-only.
Ready to ship NCAP crash-test stars into your transportation app with a single request? Start your 7‑day free trial and get your API key now: Register. For reference and deeper details, see the Documentation and explore the MCP server for agent integrations.