Use smart drop downs to find a vehicle.
The Vehicle Facets API allows you to narrow down the matching vehicle based on the vehicle's parameters. The facets available are: year
, make
, model
, badge
, series
, transmission
, body
, body_style
, fuel
, engine
and wheelbase
.
If you would like to return aggregations of factes, use a comma-separated list in the facets
field: eg. facets=badge,series,transmission
.
This function is useful when supplying data to drop-downs for display on a form. A good example of using the Facets API is Westside Auto.
For a preview of how facets in implemented inside the AutoGrab web app see the video below.
Read a step by step example guide on how to work with Facets.
Let's work backwards from the end result which is one or a few results for your user to pick from driven by previous drop-down. There are a few ways to make facets work for you, we'll go through the most common integration method.
Form your GET request for makes
/v2/vehicles/facets?region=nz&facet=make
Ask your user to choose a make from the list then call all available models based on that selection. Let's say your user chose Toyota.
Form your request for a list of Models
/v2/vehicles/facets?region=nz&make=Toyota&facet=model
Ask your user to choose a Model from the list then call all available models based on that selection. Let's say your user chose Corolla.
Form your request for a list of badges
v2/vehicles/facets?model=Corolla®ion=nz&make=Toyota&facet=badge
Select A Badge A Load Vehicles From A Search
Ask your user to choose a badge from the list. Let's say your user chose Sprint. You can see the count is 3, meaning there are only 2 badges. You could send that directly to them or repeat the process with the year (&facet=year
) to refine it further.
Let's say you'd like to present the three options to the user.
/v2/vehicles/facets/search?region=nz&badge=Sprint&make=Toyota&model=Corolla
If you do not pay attention to the counts under each facet there may be to many vehicle to perform a search on. You will know you have triggered this limitation if you see the error below.