Skip to main content
GET
/
api
/
vehicles
/
{id}
curl -X GET "http://localhost:8080/api/vehicles/1"
{
  "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"
    },
    {
      "id": 2,
      "imageUrl": "https://example.com/bmw-x5-interior.jpg"
    }
  ]
}
Returns details of a single vehicle identified by its unique ID.

Path Parameters

id
long
required
The unique identifier of the vehicle

Response

Returns a single Vehicle object or 404 if not found.
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/1"
{
  "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"
    },
    {
      "id": 2,
      "imageUrl": "https://example.com/bmw-x5-interior.jpg"
    }
  ]
}

Build docs developers (and LLMs) love