The Cars API provides detailed information on thousands of vehicle models from over a hundred automakers.
Available endpoints:
For electric vehicle (EV)-specific data, see the Electric Vehicle API.
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
optional Premium OnlyHow many results to return. Must be between 1
and 50
. Default is 1
.
offset
optional Premium OnlyNumber of results to skip. Used for pagination. Default is 0
.
X-Api-Key
requiredAPI Key associated with your account.
city_mpg
premium onlyCity fuel consumption in miles per gallon
highway_mpg
premium onlyHighway fuel consumption in miles per gallon
combination_mpg
premium onlyCombined city and highway fuel consumption in miles per gallon
class
Vehicle class category (e.g. "midsize car", "suv", etc.)
cylinders
Number of cylinders in the engine
displacement
Engine displacement in liters
drive
Drive type (e.g. "fwd" for front-wheel drive, "awd" for all-wheel drive, etc.)
fuel_type
Type of fuel the vehicle uses (e.g. "gas", "diesel", etc.)
make
Vehicle manufacturer (e.g. "toyota")
model
Vehicle model name (e.g. "camry")
transmission
Transmission type (e.g. "a" for automatic, "m" for manual)
year
Vehicle model year
https://api.api-ninjas.com/v1/cars?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
[
{
"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
},
...
]
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).
year
optionalFilter manufacturers by year (e.g. 2018
).
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
).
year
optionalVehicle model year (e.g. 2018
).
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",
...
]