Vehicle Safety Profile
GEThttps://api-vehicle-recalls.dataandapis.com/v1/complaints/stats
Vehicle Safety Profile é um endpoint da Vehicle Recalls API. Todos os recalls da NHTSA desde 1967 e 2,24 milhões de reclamações de proprietários por marca, modelo e ano.
Envie sua chave no header X-Api-Key. Cada chamada custa 1 token; uma chave gratuita inclui 500 tokens por mês.
Requisição
Parâmetros de consulta
| Parâmetro | Exemplo | |
|---|---|---|
| make | CHEVROLET | Obrigatório |
| model | BOLT EV | Opcional |
| year | 2019 | Opcional |
Exemplo de requisição
curl
curl "https://api-vehicle-recalls.dataandapis.com/v1/complaints/stats?make=CHEVROLET&model=BOLT%20EV&year=2019" \
-H "X-Api-Key: YOUR_API_KEY"JavaScript / TypeScript (pacote dataandapis)
// npm install dataandapis
import { DataAndApis } from "dataandapis";
const client = new DataAndApis(); // reads DATAANDAPIS_API_KEY
const data = await client.vehicleRecalls.vehicleSafetyProfile({
make: "CHEVROLET",
model: "BOLT EV",
year: 2019,
});Node.js (fetch)
const res = await fetch("https://api-vehicle-recalls.dataandapis.com/v1/complaints/stats?make=CHEVROLET&model=BOLT%20EV&year=2019", {
headers: { "X-Api-Key": process.env.DATAANDAPIS_KEY },
});
const data = await res.json();Python (pacote dataandapis)
# pip install dataandapis
from dataandapis import DataAndApis
client = DataAndApis() # reads DATAANDAPIS_API_KEY
data = client.vehicle_recalls.vehicle_safety_profile(
make="CHEVROLET",
model="BOLT EV",
year=2019,
)Python (requests)
import os, requests
r = requests.get(
"https://api-vehicle-recalls.dataandapis.com/v1/complaints/stats?make=CHEVROLET&model=BOLT%20EV&year=2019",
headers={"X-Api-Key": os.environ["DATAANDAPIS_KEY"]},
)
data = r.json()Guia do pacote npm dataandapis →Guia do pacote Python dataandapis →
Exemplo de resposta
Exemplo de resposta{
"ok": true,
"make": "CHEVROLET",
"model": "BOLT EV",
"year": 2019,
"totals": {
"complaints": 241,
"crashes": 2,
"fires": 15,
"injured": 5,
"deaths": 0
},
"top_components": [
{
"component": "ELECTRICAL SYSTEM",
"complaints": 80
},
{
"component": "STEERING",
"complaints": 45
},
{
"component": "FUEL/PROPULSION SYSTEM",
"complaints": 44
},
{
"component": "UNKNOWN OR OTHER",
"complaints": 20
…
Ver resposta completa
Exemplo de resposta
{
"ok": true,
"make": "CHEVROLET",
"model": "BOLT EV",
"year": 2019,
"totals": {
"complaints": 241,
"crashes": 2,
"fires": 15,
"injured": 5,
"deaths": 0
},
"top_components": [
{
"component": "ELECTRICAL SYSTEM",
"complaints": 80
},
{
"component": "STEERING",
"complaints": 45
},
{
"component": "FUEL/PROPULSION SYSTEM",
"complaints": 44
},
{
"component": "UNKNOWN OR OTHER",
"complaints": 20
…{
"ok": true,
"make": "CHEVROLET",
"model": "BOLT EV",
"year": 2019,
"totals": {
"complaints": 241,
"crashes": 2,
"fires": 15,
"injured": 5,
"deaths": 0
},
"top_components": [
{
"component": "ELECTRICAL SYSTEM",
"complaints": 80
},
{
"component": "STEERING",
"complaints": 45
},
{
"component": "FUEL/PROPULSION SYSTEM",
"complaints": 44
},
{
"component": "UNKNOWN OR OTHER",
"complaints": 20
},
{
"component": "POWER TRAIN",
"complaints": 13
},
{
"component": "VISIBILITY/WIPER",
"complaints": 4
},
{
"component": "SERVICE BRAKES",
"complaints": 4
},
{
"component": "FORWARD COLLISION AVOIDANCE: WARNINGS",
"complaints": 4
},
{
"component": "SEAT BELTS",
"complaints": 3
},
{
"component": "LANE DEPARTURE: BLIND SPOT DETECTION",
"complaints": 3
}
]
}