{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/carhunt-fr/json-schema/carhunt-fr-search-response-schema.json",
  "title": "SearchResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/carhunt-fr-recherche-api-openapi.yml#/components/schemas/SearchResponse",
  "properties": {
    "listings": {
      "items": {
        "$ref": "#/$defs/ListingOut"
      },
      "type": "array",
      "title": "Listings"
    },
    "total": {
      "type": "integer",
      "title": "Total",
      "description": "Total de résultats, plafonné à 10000 (voir total_capped)"
    },
    "total_capped": {
      "type": "boolean",
      "title": "Total Capped",
      "description": "true si le total réel dépasse 10000 — affinez vos critères",
      "default": false
    },
    "page": {
      "type": "integer",
      "title": "Page"
    },
    "page_size": {
      "type": "integer",
      "title": "Page Size"
    },
    "sync_until": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Sync Until",
      "description": "Checkpoint UTC pris avant cette page ; utilisable comme updated_since pour synchroniser les identifiants retournés"
    }
  },
  "type": "object",
  "required": [
    "listings",
    "total",
    "page",
    "page_size"
  ],
  "$defs": {
    "ListingOut": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "make": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Make"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Model"
        },
        "version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Version",
          "description": "Libellé de version brut de l'annonce"
        },
        "finition": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Finition",
          "description": "Finition normalisée (ex. « R-Line ») — disponible sur ~2/3 des annonces"
        },
        "year": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Year"
        },
        "mileage": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mileage"
        },
        "price": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Price"
        },
        "energy": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Energy"
        },
        "gearbox": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Gearbox"
        },
        "horsepower": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Horsepower"
        },
        "seller_type": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Seller Type",
          "description": "'pro' | 'private' | null (inconnu) — capturé depuis le 2026-07-17, couverture croissante au fil des re-scrapes"
        },
        "department": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Department"
        },
        "city": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "City"
        },
        "deal_score": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Deal Score",
          "description": "Score de sous-cote 0-100 (50 = prix médian marché, plus haut = meilleure affaire)"
        },
        "photo_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Photo Url"
        },
        "source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source",
          "description": "Site annonceur d'origine"
        },
        "source_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Url",
          "description": "Lien direct vers l'annonce d'origine"
        },
        "first_seen": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "First Seen",
          "description": "Découverte de l'annonce par CarHunt (base du paramètre `since`)"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At"
        }
      },
      "type": "object",
      "required": [
        "id"
      ],
      "title": "ListingOut",
      "description": "Une annonce. `source_url` pointe vers l'annonce chez l'annonceur d'origine."
    }
  }
}