{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/theusedcarindex-com/json-schema/theusedcarindex-com-listing-changes-schema.json",
  "title": "ListingChanges",
  "x-generated": "2026-11-26",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/theusedcarindex-com-openapi.json#/components/schemas/ListingChanges",
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/ListingEvent"
      }
    },
    "next_cursor": {
      "type": [
        "string",
        "null"
      ]
    },
    "collectors": {
      "type": "object",
      "properties": {
        "status": {
          "enum": [
            "no_active_sources",
            "active"
          ]
        },
        "sources_active": {
          "type": "integer",
          "minimum": 0
        },
        "last_run_at": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "status",
        "sources_active",
        "last_run_at"
      ]
    },
    "notes": {
      "type": "array",
      "items": {
        "type": "string"
      }
    }
  },
  "required": [
    "events",
    "next_cursor",
    "collectors",
    "notes"
  ],
  "$defs": {
    "ListingEvent": {
      "type": "object",
      "properties": {
        "id": {
          "type": "integer",
          "minimum": 0
        },
        "event_date": {
          "type": "string",
          "format": "date"
        },
        "event_type": {
          "enum": [
            "new",
            "price_drop",
            "relisted",
            "delisted"
          ]
        },
        "vin": {
          "type": "string",
          "pattern": "^[A-HJ-NPR-Z0-9]{17}$"
        },
        "make": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "model": {
          "type": "string",
          "minLength": 1,
          "maxLength": 64
        },
        "year": {
          "type": "integer",
          "minimum": 2000,
          "maximum": 2027
        },
        "price_old": {
          "type": [
            "number",
            "null"
          ]
        },
        "price_new": {
          "type": [
            "number",
            "null"
          ]
        },
        "mileage": {
          "type": [
            "number",
            "null"
          ]
        },
        "listing_url": {
          "type": "string",
          "format": "uri"
        },
        "source": {
          "type": "string"
        }
      },
      "required": [
        "id",
        "event_date",
        "event_type",
        "vin",
        "make",
        "model",
        "year",
        "price_old",
        "price_new",
        "mileage",
        "listing_url",
        "source"
      ],
      "additionalProperties": false
    }
  }
}