GnistAI GnistAI
Log in

Getting Started with NHTSA Vehicle Safety

NHTSA vehicle safety data — VIN decoding, safety recalls, consumer complaints, and NCAP crash test ratings.

All Tutorials   |   Overview   |   Playground   |   MCP   |   REST API   |   Home
Government

Data source: NHTSA (US Department of Transportation)

Overview

NHTSA Vehicle Safety wraps NHTSA (US Department of Transportation), handling authentication, pagination, and rate limits for you. This tutorial covers all 6 tools with working code examples you can copy and run.

Prerequisites

  1. Sign up at https://context.gnist.ai/signup for a free API key (100 calls/day).
  2. Choose your integration method: MCP protocol or REST API.

Connect via MCP

Add to your MCP client config (Claude Desktop, Cursor, etc.):

MCP Config
{
  "mcpServers": {
    "gnist-nhtsa": {
      "url": "https://context.gnist.ai/mcp/nhtsa/",
      "headers": {
        "Gnist-API-Key": "YOUR_API_KEY"
      }
    }
  }
}

Tools (6)

decode_vin

Decode a VIN to get vehicle specifications — make, model, year, engine, drivetrain, and more. Returns decoded vehicle details from the NHTSA Vehicle Product Information Catalog (vPIC). Supports all standard 17-character VINs for vehicles sold in the US and Canada.

ParameterTypeRequiredDescription
vinstringrequired17-character Vehicle Identification Number (e.g. "1HGCM82633A004352").
curl -X POST "https://context.gnist.ai/mcp/nhtsa/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "decode_vin", "arguments": {"vin": "1HGCM82633A004352"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/nhtsa/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'vin': '1HGCM82633A004352'}, 'name': 'decode_vin'}},
)
print(resp.json())

get_recalls

Get safety recalls for a specific vehicle make, model, and year. Returns recall campaigns with component affected, summary, consequence, remedy, and NHTSA campaign numbers. Covers all federally mandated recalls.

ParameterTypeRequiredDescription
makestringrequiredVehicle manufacturer (e.g. "Honda", "Toyota", "Ford").
modelstringrequiredVehicle model name (e.g. "Accord", "Camry", "F-150").
model_yearstringrequired4-digit model year (e.g. "2020").
curl -X POST "https://context.gnist.ai/mcp/nhtsa/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_recalls", "arguments": {"make": "Honda", "model": "Accord", "model_year": "2020"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/nhtsa/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'make': 'Honda',
                          'model': 'Accord',
                          'model_year': '2020'},
            'name': 'get_recalls'}},
)
print(resp.json())

get_complaints

Get consumer complaints filed with NHTSA for a specific vehicle. Returns complaints with crash/fire indicators, injury/death counts, affected components, incident summaries, and dates. Useful for identifying common issues with a vehicle.

ParameterTypeRequiredDescription
makestringrequiredVehicle manufacturer (e.g. "Honda", "Toyota", "Ford").
modelstringrequiredVehicle model name (e.g. "Accord", "Camry", "F-150").
model_yearstringrequired4-digit model year (e.g. "2020").
limitintegeroptionalMax complaints to return (1-100). Default 20. (default: 20)
curl -X POST "https://context.gnist.ai/mcp/nhtsa/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_complaints", "arguments": {"make": "Honda", "model": "Accord", "model_year": "2020"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/nhtsa/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'make': 'Honda',
                          'model': 'Accord',
                          'model_year': '2020'},
            'name': 'get_complaints'}},
)
print(resp.json())

get_safety_ratings

Get NHTSA crash test safety ratings (NCAP 5-star system). Returns overall, frontal crash, side crash, and rollover ratings. Also includes complaint, recall, and investigation counts per vehicle variant.

ParameterTypeRequiredDescription
makestringrequiredVehicle manufacturer (e.g. "Honda", "Toyota", "Ford").
modelstringrequiredVehicle model name (e.g. "Accord", "Camry", "F-150").
model_yearstringrequired4-digit model year (e.g. "2020").
curl -X POST "https://context.gnist.ai/mcp/nhtsa/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "get_safety_ratings", "arguments": {"make": "Honda", "model": "Accord", "model_year": "2020"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/nhtsa/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'make': 'Honda',
                          'model': 'Accord',
                          'model_year': '2020'},
            'name': 'get_safety_ratings'}},
)
print(resp.json())

search_makes

List all vehicle makes with safety rating data for a given model year. Useful to discover which manufacturers and brands are available before querying specific models. Returns make names and IDs.

ParameterTypeRequiredDescription
model_yearstringrequired4-digit model year to list makes for (e.g. "2024").
curl -X POST "https://context.gnist.ai/mcp/nhtsa/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "search_makes", "arguments": {"model_year": "2024"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/nhtsa/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'model_year': '2024'}, 'name': 'search_makes'}},
)
print(resp.json())

report_feedback

Report a bug, feature request, or general feedback for this data source. Use this when something doesn't work as expected, when you'd like a new feature, or when you have suggestions for improvement. Args: feedback: Describe the issue or suggestion. feedback_type: One of 'bug', 'feature_request', or 'general'.

ParameterTypeRequiredDescription
feedbackstringrequired
feedback_typestringoptional (default: general)
curl -X POST "https://context.gnist.ai/mcp/nhtsa/" \
  -H "Content-Type: application/json" \
  -H "Gnist-API-Key: YOUR_API_KEY" \
  -d '{"jsonrpc": "2.0", "method": "tools/call", "id": 1, "params": {"name": "report_feedback", "arguments": {"feedback": "example"}}}'
import httpx

resp = httpx.post(
    "https://context.gnist.ai/mcp/nhtsa/",
    headers={"Gnist-API-Key": "YOUR_API_KEY"},
    json={'id': 1,
 'jsonrpc': '2.0',
 'method': 'tools/call',
 'params': {'arguments': {'feedback': 'example'}, 'name': 'report_feedback'}},
)
print(resp.json())

Common Patterns

Search then retrieve
Use search_makes to find items, then get_recalls to get full details. This two-step pattern is common for exploring data before drilling down.
Pagination
Several tools support limit, offset, or page parameters. Start with small limits during development, then increase for production queries.

FAQ

What data does NHTSA Vehicle Safety provide?

NHTSA vehicle safety data — VIN decoding, safety recalls, consumer complaints, and NCAP crash test ratings. It exposes 6 tools: decode_vin, get_recalls, get_complaints, get_safety_ratings, search_makes, report_feedback.

What do I need to get started?

A Gnist API key (free tier: 100 calls/day). Sign up at https://context.gnist.ai/signup.

What format does the NHTSA Vehicle Safety API return?

JSON, via either MCP protocol (JSON-RPC 2.0) or REST API.

Next Steps

Related Tutorials