With the Search capability on Auto Trader Connect, you can get advert details for a given set of retailers, using the Search API and parameters to filter the results returned.
Here's a full list of the functionality:
- Retrieve advert details
- Filter the results
- Faceting to return a list of results
- Sorting of results
- Pagination of results
- Retrieve feature details
- Retrieve charge time data
Retrieve advert details
As part of this capability, you can search for adverts for a set of retailers via the Search API.
To see data from the Search API, you will need to make a GET request to the Search API, including any required filtering, facets, sorting, and pagination.
Filtering results
You can include a variety of parameters in your request to filter out adverts that are irrelevant to your request. Some examples of these filters might be:
- advertiserId=XXX - Return adverts for a specific dealer using their advertiser ID. This parameter can be included multiple times to return data for multiple advertisers.
- advertisingLocation=advertiserWebsite - Return adverts that have been set to be published on the dealer's website
- standardMake=Ford - Return adverts where a vehicle make is Ford
A complete list of the available filters on the Search API is available in our developer documentation.
Check out some examples of search filters on the Search API
Faceting to return a list of results
Once you have added search filters, you also have the option to include facet parameters in your request.
This will return a list of available values for each of the facets you include in your request, as well as quantities returned by the search for each of those values. You can include multiple facets in your request.
For example:
- facet=standardMakes - Including this parameter will return an object at the end of the results with a list of vehicle make values in the results and the respective number of adverts with each value.
- facet=doors - Including this parameter will return an object at the end of the results with a list of number of doors values in the results and the respective number of adverts with each value.
A complete list of available facets on the Search API is available in our developer documentation.
Check out some examples of faceting on the Search API
Sorting of results:
You can sort the results returned by the API by including the sort parameter and the type of sort order.
The available sort options are:
- totalPriceAsc and totalPriceDesc - Will sort the results by total price, ascending or descending
- suppliedPriceAsc and suppliedPriceDesc - Will sort the results by supplied price (the price of the vehicle minus any admin fee), ascending or descending
- vehicleAgeAsc and vehicleAgeDesc - Will sort the results by the age of the vehicle, ascending or descending
- odometerReadingMilesAsc and odometerReadingMilesDesc - Will sort the results by the current mileage of the vehicle, ascending or descending
- distance - Will sort the results by the distance from the supplied postcode in the filters. This will always be in ascending order, with the closest adverts to the postcode coming first.
Check out some examples of sorting on the Search API
Retrieve feature details
Where a vehicle has a derivative ID, you can get a list of all the possible standard and optional features for that derivative.
To see this data, you should perform a GET request to the Search API on the features path using the vehicle's search ID.
Check out an example of retrieving feature details on the Search API
Retrieve charge time data
Where an electric vehicle has a derivative ID, you can get charge time data for the vehicle.
To see this data, you should perform a GET request to the Search API on the charge-times path using the vehicle's search ID.
Check out an example of retrieving charge time data on the Search API
Error handling
When using the APIs above, you may get error response codes that you need to handle. This makes sure you have a smooth service for both you, as a partner, and your end user.