Build a UK shortlist with the AutoTrader API
Start with the vehicle family, then add separate constraints for budget, age, distance and location. A BMW 3 Series search pairs its make with its model rather than using the model as a standalone vehicle description. For a UK request, the price boundaries are in pounds sterling and the mileage boundaries are in miles.
- Select
ukinbody.market, then setbody.makeandbody.modelto the intended vehicle family. - Set
body.min_priceandbody.max_pricefor the budget interval, and use the year and mileage boundaries to narrow the vehicle characteristics. - Supply
body.postcodewithbody.radiusto anchor the geographic search area around the chosen UK postcode. - Add
body.fuel,body.body_typeorbody.transmissionwhen a fuel choice, body style or gearbox belongs in the search.
The location radius expresses miles around the postcode, not vehicle mileage. If the postcode is omitted, the search uses a central England postcode instead of the intended local anchor.
Move between result pages without changing the query
Treat the page number as a selection within the search, rather than as a substitute for its filters. Search begins at page 1 when the page input is omitted.
To request a later page, retain the vehicle and regional criteria and change the page input. That keeps the page selection tied to the same budget, location and vehicle family.
Read page_info together with the returned listing rows. Its page identifies the selected page, page_count gives the page count and total_results gives the result count. Use these values to present page navigation separately from the details of an individual car.
The operation ignores a page value below 1 and applies its default; a positive page selection expresses the requested position. The advertId on a row identifies an advert, not a page, so preserve it for subsequent advert inspection.
Inspect a selected vehicle rather than repeating its search
Once a row is selected, switch from autotrader-search to autotrader-listing-detail. The link between those operations is the search row's advert identifier, supplied as the detail request's id. Keep the market choice with the selected advert; a Canadian UUID and a numeric identifier from another supported market represent different regional identifier formats.
- Take the chosen row's
advertIdand place it inbody.idwith the matching market selection. - Alternatively, place the advert's full link in
body.urlto select the detail record by URL. - Read the detail specification for the vehicle's fuel, gearbox, body style, cabin layout and engine information.
- Present the written description and images beside that structured specification, keeping the dealer's name, reviews and location in a seller group.
Use the detail price indicator and price deviation as price context, alongside the advert's asking figure. The registration and year entries describe the vehicle independently of the seller presentation.
Carry the regional units through the workflow
When adapting the search to Canada, South Africa or Australia, use the regional make, model and page inputs. Canadian result prices use CAD, South African prices use ZAR and Australian prices use AUD; mileage in these regional searches uses kilometres.
Keep the returned market next to stored search rows so a display can associate each amount and distance with its region. The UK filter amounts instead describe pounds sterling, and its distance filters use miles.
Choose a market explicitly when the workflow moves between regions, since omission selects the UK. An unrecognised market value is ignored and the default applies.
Invalid make and model values are ignored as well, so retain the intended vehicle labels when changing the region. These operations support the UK, Canadian, South African and Australian selections; the US selection is unavailable.
[
{
"body": {
"market": "uk",
"make": "BMW",
"model": "3 Series",
"postcode": "SW1A 1AA",
"radius": 50,
"min_price": 5000,
"max_price": 25000,
"page": 1
}
},
{
"body": {
"market": "uk",
"make": "BMW",
"model": "3 Series",
"postcode": "SW1A 1AA",
"radius": 50,
"min_price": 5000,
"max_price": 25000,
"page": 2
}
}
]{
"body": {
"market": "uk",
"url": "https://www.autotrader.co.uk/car-details/202401011234567"
}
}Server-side request template
This server-side template shows authentication and request identity using the first operation of this API. Choose the operation for your use case and check its current availability and price on the API page. After a timeout, resend the unchanged request with the same Idempotency-Key.
The gateway request is always POST.
Use a JSON object with the documented path, query, headers and body locations; omit unused locations. input.headers is JSON data for the operation, not browser request headers. Do not put credentials here. Keep body arrays, scalar values and null as documented; omission is different from null.
# Server-side only. Set KAKIAPI_API_KEY in your secret manager.
# Every gateway operation is called with POST.
# Only operations shown as enabled on the API page can be called.
# Generate once per intent; retain the same value on status checks.
REQUEST_ID="$(uuidgen)"
curl --request POST 'https://kakiapi.com/api/v1/autotrader/autotrader-listing-detail' \
--header "Content-Type: application/json" \
--header "x-api-key: $KAKIAPI_API_KEY" \
--header "Idempotency-Key: $REQUEST_ID" \
--data '{"body":{"url":"https://www.autotrader.co.uk/car-details/202401011234567"}}'Integration checklist
- The API key is stored in a server-side secret manager and never sent to a browser.
- Each request carries its own Idempotency-Key, kept until the request has a final answer.
- The integration reads ok and error.code and handles each error code as the error table describes.
- An uncertain POST is inspected using its original identity, never blindly repeated with a new one.
- The operation’s current availability and price have been checked on its API page.
AutoTrader API overview and prices · Read the API reference · Try it in the playground