The Cars API provides detailed information on thousands of vehicle models from over a hundred automakers.
Available endpoints:
https://api.api-ninjas.com/v1/cars
Get car data from given parameters. Returns a list of car models (and their information) that satisfy the parameters.
make
optionalVehicle manufacturer (e.g. audi
or toyota
).
model
optionalVehicle model (e.g. a4
or corolla
).
fuel_type
optionalType of fuel used. Possible values: gas
, diesel
, electricity
.
drive
optionalDrive transmission. Possible values: fwd
(front-wheel drive), rwd
(rear-wheel drive), awd
(all-wheel drive), 4wd
(four-wheel drive).
cylinders
optionalNumber of cylinders in engine. Possible values: 2
, 3
, 4
, 5
, 6
, 8
, 10
, 12
, 16
.
transmission
optionalType of transmission. Possible values: manual
, automatic
.
year
optionalVehicle model year (e.g. 2018
).
min_city_mpg
optionalMinimum city fuel consumption (in miles per gallon).
max_city_mpg
optionalMaximum city fuel consumption (in miles per gallon).
min_hwy_mpg
optionalMinimum highway fuel consumption (in miles per gallon).
max_hwy_mpg
optionalMaximum highway fuel consumption (in miles per gallon).
min_comb_mpg
optionalMinimum combination (city and highway) fuel consumption (in miles per gallon).
max_comb_mpg
optionalMaximum combination (city and highway) fuel consumption (in miles per gallon).
limit
optionalHow many results to return. Must be between 1
and 50
. Default is 5
.
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/cars?limit=2&model=camry
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
[
{
"city_mpg": 18,
"class": "midsize car",
"combination_mpg": 21,
"cylinders": 4,
"displacement": 2.2,
"drive": "fwd",
"fuel_type": "gas",
"highway_mpg": 26,
"make": "toyota",
"model": "camry",
"transmission": "a",
"year": 1993
},
{
"city_mpg": 19,
"class": "midsize car",
"combination_mpg": 22,
"cylinders": 4,
"displacement": 2.2,
"drive": "fwd",
"fuel_type": "gas",
"highway_mpg": 27,
"make": "toyota",
"model": "camry",
"transmission": "m",
"year": 1993
}
]
1
2
3
4
5
6
7
8
9
import requests
model = 'camry'
api_url = 'https://api.api-ninjas.com/v1/cars?model={}'.format(model)
response = requests.get(api_url, headers={'X-Api-Key': 'YOUR_API_KEY'})
if response.status_code == requests.codes.ok:
print(response.text)
else:
print("Error:", response.status_code, response.text)
If your programming language is not listed in the Code Example above, you can still make API calls by using a HTTP request library written in your programming language and following the above documentation.
Annual premium subscriptions only
https://api.api-ninjas.com/v1/carmakes
Returns a list of all car makes (manufacturers).
None
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/carmakes
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
[
...
"Lamborghini",
"Land Rover",
"Lexus",
"Lincoln",
...
]
Annual premium subscriptions only
https://api.api-ninjas.com/v1/carmodels
Returns a list of all car models for a given make (manufacturer).
make
requiredVehicle manufacturer (e.g. audi
).
X-Api-Key
requiredAPI Key associated with your account.
https://api.api-ninjas.com/v1/carmodels?make=audi
Headers
X-Api-Key
Log in or sign up to get your API Key
1
2
3
4
5
6
7
8
9
10
11
12
[
...
"A4",
"A4 Allroad Quattro",
"A4 Avant",
"A4 Avant Quattro",
"A4 Cabriolet",
"A4 Cabriolet Quattro",
"A4 Quattro",
"A4 S Line Quattro",
...
]