{
  "openapi": "3.1.0",
  "info": {
    "title": "Akhodro Public Vehicle Listings API",
    "version": "1.0.0",
    "description": "Read-only public API for current vehicle listings and brands. Listings include imported and regional-market cars from Iran, Georgia, Iraq, the UAE and Oman. Prices are stored in USD. Data can change; cite the canonical listing URL and retrieval date.",
    "contact": {
      "name": "Akhodro Support",
      "email": "support@akhodro.com",
      "url": "https://akhodro.com/contact"
    }
  },
  "servers": [
    {
      "url": "https://api.rikafelix.com"
    }
  ],
  "paths": {
    "/imported-cars": {
      "get": {
        "operationId": "listVehicleListings",
        "summary": "List and filter current vehicle listings",
        "parameters": [
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brand",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "brands",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "priceFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "priceTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "number"
            }
          },
          {
            "name": "yearFrom",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "yearTo",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Paginated listings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/VehicleListing"
                      }
                    },
                    "meta": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/imported-cars/brands": {
      "get": {
        "operationId": "listVehicleBrands",
        "summary": "List vehicle brands and listing counts",
        "responses": {
          "200": {
            "description": "Brand list"
          }
        }
      }
    },
    "/imported-cars/brands/{brandId}/cars": {
      "get": {
        "operationId": "listVehiclesByBrand",
        "summary": "List vehicles for one brand",
        "parameters": [
          {
            "name": "brandId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "page",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Brand vehicles"
          }
        }
      }
    },
    "/imported-cars/{id}": {
      "get": {
        "operationId": "getVehicleListing",
        "summary": "Get complete details and gallery for one vehicle",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Vehicle detail",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "$ref": "#/components/schemas/VehicleListing"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Listing not found"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "VehicleListing": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "titleFa": {
            "type": [
              "string",
              "null"
            ],
            "description": "Persian listing title"
          },
          "brand": {
            "type": [
              "object",
              "null"
            ]
          },
          "modelNameFa": {
            "type": [
              "string",
              "null"
            ]
          },
          "year": {
            "type": [
              "integer",
              "null"
            ]
          },
          "priceUsd": {
            "type": [
              "number",
              "null"
            ]
          },
          "mileageKm": {
            "type": [
              "number",
              "null"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ]
          },
          "countryFa": {
            "type": [
              "string",
              "null"
            ]
          },
          "descriptionFa": {
            "type": [
              "string",
              "null"
            ]
          },
          "primaryImageUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "images": {
            "type": "array",
            "items": {
              "type": "object"
            }
          },
          "createdAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      }
    }
  }
}