Find cars, or fetch known cars by id. Always returns full specifications. Premium only.
The main endpoint. Search the whole catalogue by any combination of filters, or fetch cars you already know with id/ids. Every car is returned with its complete specification sheet attached, so no second call is needed. Each row also carries its own make, model, generation, body and engine context. At least one filter, or an id, is required. The total number of matches is returned in the X-Total-Count response header.
Example code
// Using @orth/sdk - The simplest way to call APIs
// Install: npm install @orth/sdk
import Orthogonal from "@orth/sdk";
const orthogonal = new Orthogonal({
apiKey: process.env.ORTHOGONAL_API_KEY,
});
const output = await orthogonal.run({
api: "api-ninjas",
path: "/v2/cars"
});
console.log(output);Query parameters
A car handle from a previous search, e.g. car_e71ff3416a. Safe to store: it is derived from the car's identity and survives data refreshes.
Comma-separated car handles, at most 50. Request order is preserved and a handle matching nothing is returned as null.
Manufacturer, as a word. Case and punctuation are ignored, so bmw, BMW and Bmw all resolve.
Model, as a word. '3 Series', '3-series' and '3series' all resolve.
Generation, as a word, e.g. e90 or 'E90/E91/E92/E93'. Optional -- nothing requires going through a generation.
Filter to one chassis code, e.g. E91. Matches anything whose chassis_codes contains it.
Body style. One of Sedan, Coupe, Convertible, Wagon, Hatchback, Liftback, SUV, MPV, Van, Pickup. (Allowed: Sedan, Coupe, Convertible, Wagon, Hatchback, Liftback, SUV, MPV, Van, Pickup)
Number of doors.
Model designation, e.g. 320d. Spacing and case are ignored.
Fuel type. (Allowed: gasoline, diesel, electric, hybrid, plugin_hybrid, lpg, cng, hydrogen, ethanol)
Transmission type. (Allowed: manual, automatic, cvt, dual_clutch, automated_manual, single_speed)
Driven wheels. (Allowed: fwd, rwd, awd, 4wd)
Number of cylinders.
Manufacturer engine code.
Minimum engine power in horsepower.
Maximum engine power in horsepower.
Cars still in production in or after this year.
Cars in production in or before this year.
Cars in production in this year. A filter, not a starting point.
Sort order. (Allowed: power_hp, -power_hp, year, -year, name, make)
How many results to return, between 1 and 100. Default 10 -- each car carries a full specification sheet of roughly 2 KB. A value outside the range is rejected rather than silently clamped. (Default: 10)
Number of results to skip, for pagination. Default 0. (Default: 0)