{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/api-ninjas-com/json-schema/api-ninjas-com-car-schema.json",
  "title": "Car",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/api-ninjas-com-cars-api-openapi.yml#/components/schemas/Car",
  "type": "object",
  "properties": {
    "id": {
      "type": "string",
      "description": "Handle for this exact car, e.g. car_e71ff3416a. Pass back as ?id= to re-fetch it. Safe to store: it is derived from the car's identity and survives data refreshes."
    },
    "make": {
      "type": "string",
      "description": "Manufacturer name, e.g. BMW."
    },
    "model": {
      "type": "string",
      "description": "Model name, e.g. 3 Series."
    },
    "generation": {
      "type": [
        "string",
        "null"
      ],
      "description": "Generation this car belongs to, e.g. E90/E91/E92/E93. Names the whole code family, because a code cannot be mapped to one body."
    },
    "chassis_codes": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Every chassis code the car's generation covers, e.g. [E90, E91, E92, E93]. A property of the generation: the source does not map a code to a body, so a car claims none of them individually. Empty for generations with no published code."
    },
    "year_begin": {
      "type": [
        "integer",
        "null"
      ],
      "description": "First production year."
    },
    "year_end": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Last production year."
    },
    "body": {
      "type": [
        "string",
        "null"
      ],
      "description": "One of Sedan, Coupe, Convertible, Wagon, Hatchback, Liftback, SUV, MPV, Van, Pickup."
    },
    "doors": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of doors, where known."
    },
    "body_name": {
      "type": [
        "string",
        "null"
      ],
      "description": "Manufacturer's own name for the body, e.g. Touring, Avant."
    },
    "trim_line": {
      "type": [
        "string",
        "null"
      ],
      "description": "Performance or equipment line, e.g. AMG, GTI."
    },
    "market": {
      "type": [
        "string",
        "null"
      ],
      "description": "Regional variant, where the car is market-specific."
    },
    "name": {
      "type": "string",
      "description": "Full name as published, e.g. 320d AT (177 hp)."
    },
    "badge": {
      "type": [
        "string",
        "null"
      ],
      "description": "Model designation on its own, e.g. 320d. Not unique within a generation."
    },
    "edition": {
      "type": [
        "string",
        "null"
      ],
      "description": "Marketing edition, e.g. EfficientDynamics Edition."
    },
    "engine": {
      "type": [
        "string",
        "null"
      ],
      "description": "Short engine summary, e.g. 2.0 turbo diesel."
    },
    "power_hp": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Engine power in horsepower."
    },
    "power_kw": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Engine power in kilowatts."
    },
    "displacement_l": {
      "type": [
        "number",
        "null"
      ],
      "description": "Engine displacement in litres."
    },
    "cylinders": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of cylinders."
    },
    "transmission": {
      "type": [
        "string",
        "null"
      ],
      "description": "One of manual, automatic, cvt, dual_clutch, automated_manual, single_speed."
    },
    "gearbox": {
      "type": [
        "string",
        "null"
      ],
      "description": "Manufacturer's name for the gearbox, e.g. Steptronic."
    },
    "gears": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of gears."
    },
    "drive": {
      "type": [
        "string",
        "null"
      ],
      "description": "One of fwd, rwd, awd, 4wd."
    },
    "fuel": {
      "type": [
        "string",
        "null"
      ],
      "description": "One of gasoline, diesel, electric, hybrid, plugin_hybrid, lpg, cng, hydrogen, ethanol."
    },
    "engine_code": {
      "type": [
        "string",
        "null"
      ],
      "description": "Manufacturer engine code, e.g. OM646.962."
    },
    "spec_count": {
      "type": [
        "integer",
        "null"
      ],
      "description": "Number of specification fields present in specs."
    },
    "specs": {
      "type": "object",
      "additionalProperties": {
        "type": "object",
        "properties": {
          "value": {
            "description": "Numeric where the source value is a clean number, otherwise the original text."
          },
          "unit": {
            "type": "string",
            "description": "Unit of measurement, where the source records one."
          }
        }
      },
      "description": "Full specification sheet, always present. Values keep their unit as a separate field, e.g. {\"value\": 1995, \"unit\": \"cm3\"}."
    }
  }
}