Skip to main content
GET
/
api
/
vehicles
/
year
Get Vehicles by Year
curl --request GET \
  --url https://api.example.com/api/vehicles/year
{
  "vehicles": [
    {}
  ]
}

Request

year
integer
required
The manufacturing year to filter by

Response

Returns an array of vehicles from the specified year.
vehicles
Vehicle[]
Array of vehicle objects

Example

curl -X GET "http://localhost:8080/api/vehicles/year?year=2024"

Response Example

[
  {
    "id": 1,
    "reference": "BMW2024A1B2",
    "brand": "BMW",
    "model": "X5",
    "year": 2024,
    "price": 150.00,
    "vehicleType": "SUV"
  },
  {
    "id": 5,
    "reference": "AUD2024F7G8",
    "brand": "Audi",
    "model": "Q7",
    "year": 2024,
    "price": 145.00,
    "vehicleType": "SUV"
  }
]
Use /api/vehicles/year-range to search for vehicles within a range of years.

Build docs developers (and LLMs) love