Skip to main content
GET
/
api
/
vehicles
/
search
curl -X GET "http://localhost:8080/api/vehicles/search?q=BMW"
[
  {
    "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": 2,
    "reference": "BMW20233F8D",
    "brand": "BMW",
    "model": "320i",
    "hp": 184,
    "autonomy": 700,
    "averageconsumption": 6.2,
    "description": "Compact executive sedan",
    "price": 42000.00,
    "year": 2023,
    "fuelType": "gasoline",
    "mileage": 25000,
    "extras": "Sport seats, LED headlights",
    "createdAt": "2024-01-10T09:15:00",
    "updatedAt": "2024-02-15T11:20:00",
    "doors": 4,
    "vehicleType": "sedan",
    "offers": "No",
    "images": []
  }
]
Searches for vehicles where either the brand or model contains the search term (case-insensitive).

Query Parameters

q
string
required
Search term to match against brand or model (case-insensitive partial match)

Response

Returns an array of Vehicle objects matching the search criteria.
id
long
Unique identifier for the vehicle
reference
string
Auto-generated unique reference code
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
mileage
long
Mileage in kilometers
extras
string
Additional features and extras
createdAt
datetime
Timestamp when created
updatedAt
datetime
Timestamp when last updated
doors
integer
Number of doors
vehicleType
string
Type of vehicle
offers
string
Special offers status
images
array
Array of vehicle images
curl -X GET "http://localhost:8080/api/vehicles/search?q=BMW"
[
  {
    "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": 2,
    "reference": "BMW20233F8D",
    "brand": "BMW",
    "model": "320i",
    "hp": 184,
    "autonomy": 700,
    "averageconsumption": 6.2,
    "description": "Compact executive sedan",
    "price": 42000.00,
    "year": 2023,
    "fuelType": "gasoline",
    "mileage": 25000,
    "extras": "Sport seats, LED headlights",
    "createdAt": "2024-01-10T09:15:00",
    "updatedAt": "2024-02-15T11:20:00",
    "doors": 4,
    "vehicleType": "sedan",
    "offers": "No",
    "images": []
  }
]

Build docs developers (and LLMs) love