Cars API

The Cars API provides detailed information on thousands of vehicle models from over a hundred automakers.

/v1/cars GET

https://api.api-ninjas.com/v1/cars?limit=2&model=

Get car data from given parameters. Returns a list of car models (and their information) that satisfy the parameters.


Parameters

  • make  optional

    Vehicle manufacturer (e.g. audi or toyota).

  • model  optional

    Vehicle model (e.g. a4 or corolla).

  • fuel_type  optional

    Type of fuel used. Possible values: gas, diesel, electricity.

  • drive  optional

    Drive transmission. Possible values: fwd (front-wheel drive), rwd (rear-wheel drive), awd (all-wheel drive), 4wd (four-wheel drive).

  • cylinders  optional

    Number of cylinders in engine. Possible values: 2, 3, 4, 5, 6, 8, 10, 12, 16.

  • transmission  optional

    Type of transmission. Possible values: manual, automatic.

  • year  optional

    Vehicle model year (e.g. 2018).

  • min_city_mpg  optional

    Minimum city fuel consumption (in miles per gallon).

  • max_city_mpg  optional

    Maximum city fuel consumption (in miles per gallon).

  • min_hwy_mpg  optional

    Minimum highway fuel consumption (in miles per gallon).

  • max_hwy_mpg  optional

    Maximum highway fuel consumption (in miles per gallon).

  • min_comb_mpg  optional

    Minimum combination (city and highway) fuel consumption (in miles per gallon).

  • max_comb_mpg  optional

    Maximum combination (city and highway) fuel consumption (in miles per gallon).

  • limit  optional

    How many results to return. Must be between 1 and 50. Default is 5.

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request Live Demo!

model
https://api.api-ninjas.com/v1/cars?limit=2&model=camry

Sample Response

JSON
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 } ]

Code Examples

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

/v1/carmakes GET

https://api.api-ninjas.com/v1/carmakes

Returns a list of all car makes (manufacturers).


Parameters

None

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request

https://api.api-ninjas.com/v1/carmakes

Sample Response

JSON
1 2 3 4 5 6 7 8 [ ... "Lamborghini", "Land Rover", "Lexus", "Lincoln", ... ]

Annual premium subscriptions only

/v1/carmodels GET

https://api.api-ninjas.com/v1/carmodels

Returns a list of all car models for a given make (manufacturer).


Parameters

  • make  required

    Vehicle manufacturer (e.g. audi).

Headers

  • X-Api-Key  required

    API Key associated with your account.

Sample Request

https://api.api-ninjas.com/v1/carmodels?make=audi

Sample Response

JSON
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", ... ]