Skip to main content
GET
/
api
/
vehicles
curl -X GET "http://localhost:8080/api/vehicles"
[
  {
    "id": 1,
    "reference": "BMW2024A1B2",
    "brand": "BMW",
    "model": "X5",
    "hp": 335,
    "autonomy": 650,
    "averageconsumption": 8.5,
    "description": "Luxury SUV with advanced features",
    "price": 65000.00,
    "year": 2024,
    "fuelType": "diesel",
    "mileage": 15000,
    "extras": "Navigation, Leather seats, Sunroof",
    "createdAt": "2024-01-15T10:30:00",
    "updatedAt": "2024-02-20T14:45:00",
    "doors": 5,
    "vehicleType": "SUV",
    "offers": "Yes",
    "images": [
      {
        "id": 1,
        "imageUrl": "https://example.com/bmw-x5-front.jpg"
      }
    ]
  }
]
Returns a list of all vehicles in the system, ordered by brand in ascending order. You can optionally filter by brand using a query parameter.

Query Parameters

marca
string
Filter vehicles by brand name (case-insensitive partial match)

Response

Returns an array of Vehicle objects.
id
long
Unique identifier for the vehicle
reference
string
Auto-generated unique reference code in format: {BRAND}{YEAR}{RANDOM} (e.g., BMW2024A1B2)
brand
string
Vehicle brand name
model
string
Vehicle model name
hp
integer
Horsepower
autonomy
integer
Autonomy/range in kilometers
averageconsumption
double
Average fuel consumption
description
string
Vehicle description
price
decimal
Vehicle price
year
integer
Manufacturing year
fuelType
string
Fuel type (e.g., gasoline, diesel, electric, hybrid)
mileage
long
Mileage in kilometers
extras
string
Additional features and extras
createdAt
datetime
Timestamp when the vehicle was created
updatedAt
datetime
Timestamp when the vehicle was last updated
doors
integer
Number of doors
vehicleType
string
Type of vehicle (e.g., sedan, suv, truck, motorcycle)
offers
string
Special offers status (e.g., “Yes” or “No”)
images
array
Array of vehicle images
id
long
Image ID
imageUrl
string
Image URL
curl -X GET "http://localhost:8080/api/vehicles"
[
  {
    "id": 1,
    "reference": "BMW2024A1B2",
    "brand": "BMW",
    "model": "X5",
    "hp": 335,
    "autonomy": 650,
    "averageconsumption": 8.5,
    "description": "Luxury SUV with advanced features",
    "price": 65000.00,
    "year": 2024,
    "fuelType": "diesel",
    "mileage": 15000,
    "extras": "Navigation, Leather seats, Sunroof",
    "createdAt": "2024-01-15T10:30:00",
    "updatedAt": "2024-02-20T14:45:00",
    "doors": 5,
    "vehicleType": "SUV",
    "offers": "Yes",
    "images": [
      {
        "id": 1,
        "imageUrl": "https://example.com/bmw-x5-front.jpg"
      }
    ]
  }
]

Build docs developers (and LLMs) love