{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/theusedcarindex-com/json-schema/theusedcarindex-com-market-index-schema.json",
  "title": "MarketIndex",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/theusedcarindex-com-openapi.json#/components/schemas/MarketIndex",
  "type": "object",
  "properties": {
    "schema_version": {
      "const": 1
    },
    "name": {
      "const": "The Used Car Index market snapshot"
    },
    "status": {
      "enum": [
        "ok",
        "empty"
      ]
    },
    "as_of": {
      "type": [
        "string",
        "null"
      ]
    },
    "generated_from": {
      "type": "object",
      "properties": {
        "listing_events_through_id": {
          "type": "integer",
          "minimum": 0
        },
        "first_event_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "latest_event_date": {
          "type": [
            "string",
            "null"
          ]
        },
        "event_days": {
          "type": "integer",
          "minimum": 0
        },
        "nhtsa_data_built_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "sources": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "detail": {
                "type": "string"
              }
            },
            "required": [
              "name",
              "detail"
            ]
          }
        }
      },
      "required": [
        "listing_events_through_id",
        "first_event_date",
        "latest_event_date",
        "event_days",
        "nhtsa_data_built_at",
        "sources"
      ]
    },
    "coverage": {
      "type": "object",
      "properties": {
        "region": {
          "const": "Chicago area"
        },
        "dealers_registered": {
          "type": "integer",
          "minimum": 0
        },
        "dealers_collecting": {
          "type": "integer",
          "minimum": 0
        },
        "dealers_with_active_listings": {
          "type": "integer",
          "minimum": 0
        },
        "last_collector_run_at": {
          "type": [
            "string",
            "null"
          ]
        },
        "dealers": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "name": {
                "type": "string"
              },
              "site_url": {
                "type": "string"
              },
              "active_listings": {
                "type": "integer",
                "minimum": 0
              }
            },
            "required": [
              "name",
              "site_url",
              "active_listings"
            ]
          },
          "maxItems": 200
        },
        "dealers_truncated": {
          "type": "boolean"
        },
        "basis": {
          "type": "string"
        }
      },
      "required": [
        "region",
        "dealers_registered",
        "dealers_collecting",
        "dealers_with_active_listings",
        "last_collector_run_at",
        "dealers",
        "dealers_truncated",
        "basis"
      ]
    },
    "inventory": {
      "type": "object",
      "properties": {
        "active_listings": {
          "type": "integer",
          "minimum": 0
        },
        "delisted_listings": {
          "type": "integer",
          "minimum": 0
        },
        "tracked_listings": {
          "type": "integer",
          "minimum": 0
        },
        "priced_listings": {
          "type": "integer",
          "minimum": 0
        },
        "listings_with_mileage": {
          "type": "integer",
          "minimum": 0
        },
        "median_price": {
          "type": [
            "number",
            "null"
          ]
        },
        "median_mileage": {
          "type": [
            "number",
            "null"
          ]
        },
        "basis": {
          "type": "string"
        }
      },
      "required": [
        "active_listings",
        "delisted_listings",
        "tracked_listings",
        "priced_listings",
        "listings_with_mileage",
        "median_price",
        "median_mileage",
        "basis"
      ]
    },
    "latest_day": {
      "type": "object",
      "properties": {
        "date": {
          "type": [
            "string",
            "null"
          ]
        },
        "new": {
          "type": "integer",
          "minimum": 0
        },
        "price_drops": {
          "type": "integer",
          "minimum": 0
        },
        "relisted": {
          "type": "integer",
          "minimum": 0
        },
        "delisted": {
          "type": "integer",
          "minimum": 0
        },
        "median_price_drop_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "median_price_drop_percent": {
          "type": [
            "number",
            "null"
          ]
        },
        "basis": {
          "type": "string"
        }
      },
      "required": [
        "date",
        "new",
        "price_drops",
        "relisted",
        "delisted",
        "median_price_drop_amount",
        "median_price_drop_percent",
        "basis"
      ]
    },
    "window": {
      "type": "object",
      "properties": {
        "days": {
          "const": 30
        },
        "start": {
          "type": [
            "string",
            "null"
          ]
        },
        "end": {
          "type": [
            "string",
            "null"
          ]
        },
        "new": {
          "type": "integer",
          "minimum": 0
        },
        "price_drops": {
          "type": "integer",
          "minimum": 0
        },
        "relisted": {
          "type": "integer",
          "minimum": 0
        },
        "delisted": {
          "type": "integer",
          "minimum": 0
        },
        "median_price_drop_amount": {
          "type": [
            "number",
            "null"
          ]
        },
        "median_price_drop_percent": {
          "type": [
            "number",
            "null"
          ]
        },
        "basis": {
          "type": "string"
        }
      },
      "required": [
        "days",
        "start",
        "end",
        "new",
        "price_drops",
        "relisted",
        "delisted",
        "median_price_drop_amount",
        "median_price_drop_percent",
        "basis"
      ]
    },
    "nhtsa_exposure": {
      "type": "object",
      "properties": {
        "level": {
          "const": "model_year"
        },
        "matched_listings": {
          "type": "integer",
          "minimum": 0
        },
        "unmatched_listings": {
          "type": "integer",
          "minimum": 0
        },
        "with_recall_campaign": {
          "type": "integer",
          "minimum": 0
        },
        "with_open_investigation": {
          "type": "integer",
          "minimum": 0
        },
        "with_either": {
          "type": "integer",
          "minimum": 0
        },
        "share_with_either": {
          "type": [
            "number",
            "null"
          ],
          "minimum": 0,
          "maximum": 1
        },
        "basis": {
          "type": "string"
        },
        "caveat": {
          "type": "string"
        }
      },
      "required": [
        "level",
        "matched_listings",
        "unmatched_listings",
        "with_recall_campaign",
        "with_open_investigation",
        "with_either",
        "share_with_either",
        "basis",
        "caveat"
      ]
    },
    "makes": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "make": {
            "type": "string"
          },
          "make_key": {
            "type": "string"
          },
          "active_listings": {
            "type": "integer",
            "minimum": 0
          },
          "share_of_active": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "priced_listings": {
            "type": "integer",
            "minimum": 0
          },
          "median_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "listings_with_mileage": {
            "type": "integer",
            "minimum": 0
          },
          "median_mileage": {
            "type": [
              "number",
              "null"
            ]
          }
        },
        "required": [
          "make",
          "make_key",
          "active_listings",
          "share_of_active",
          "priced_listings",
          "median_price",
          "listings_with_mileage",
          "median_mileage"
        ]
      },
      "maxItems": 10
    },
    "models": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "make": {
            "type": "string"
          },
          "make_key": {
            "type": "string"
          },
          "active_listings": {
            "type": "integer",
            "minimum": 0
          },
          "share_of_active": {
            "type": "number",
            "minimum": 0,
            "maximum": 1
          },
          "priced_listings": {
            "type": "integer",
            "minimum": 0
          },
          "median_price": {
            "type": [
              "number",
              "null"
            ]
          },
          "listings_with_mileage": {
            "type": "integer",
            "minimum": 0
          },
          "median_mileage": {
            "type": [
              "number",
              "null"
            ]
          },
          "model": {
            "type": "string"
          },
          "family_key": {
            "type": "string"
          },
          "matched_listings": {
            "type": "integer",
            "minimum": 0
          },
          "with_either": {
            "type": "integer",
            "minimum": 0
          }
        },
        "required": [
          "make",
          "make_key",
          "active_listings",
          "share_of_active",
          "priced_listings",
          "median_price",
          "listings_with_mileage",
          "median_mileage",
          "model",
          "family_key",
          "matched_listings",
          "with_either"
        ]
      },
      "maxItems": 15
    },
    "trend": {
      "type": "object",
      "properties": {
        "window_days": {
          "const": 30
        },
        "days_with_data": {
          "type": "integer",
          "minimum": 0
        },
        "has_history": {
          "type": "boolean"
        },
        "days": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "date": {
                "type": "string"
              },
              "new": {
                "type": "integer",
                "minimum": 0
              },
              "price_drops": {
                "type": "integer",
                "minimum": 0
              },
              "relisted": {
                "type": "integer",
                "minimum": 0
              },
              "delisted": {
                "type": "integer",
                "minimum": 0
              },
              "net_change": {
                "type": "integer"
              },
              "active_end_of_day": {
                "type": "integer",
                "description": "Current active inventory minus later net changes; derived, not a stored snapshot."
              },
              "median_new_price": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "new_priced": {
                "type": "integer",
                "minimum": 0
              },
              "median_price_drop_amount": {
                "type": [
                  "number",
                  "null"
                ]
              }
            },
            "required": [
              "date",
              "new",
              "price_drops",
              "relisted",
              "delisted",
              "net_change",
              "active_end_of_day",
              "median_new_price",
              "new_priced",
              "median_price_drop_amount"
            ]
          },
          "maxItems": 30
        },
        "basis": {
          "type": "string"
        },
        "note": {
          "type": "string"
        }
      },
      "required": [
        "window_days",
        "days_with_data",
        "has_history",
        "days",
        "basis",
        "note"
      ]
    },
    "methodology": {
      "type": "object",
      "properties": {
        "counted": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "delisted_means": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "coverage_notes": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "limits": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "counted",
        "delisted_means",
        "coverage_notes",
        "limits"
      ]
    }
  },
  "required": [
    "schema_version",
    "name",
    "status",
    "as_of",
    "generated_from",
    "coverage",
    "inventory",
    "latest_day",
    "window",
    "nhtsa_exposure",
    "makes",
    "models",
    "trend",
    "methodology"
  ]
}