Vehicle recommendation API
Audience: CMS editors and developers.
The local engine returns recommendations for a deal or inventory vehicle seed.
API
GET /v1/recommendations/cars/inventory/2527110?page=1&pageSize=6&crossSellEnabled=true| Parameter | Location | Behavior |
|---|---|---|
mode | Path | Required: deal or inventory |
id | Path | Required: reference vehicle identifier |
page | Query | One-based page; default 1 |
pageSize | Query | Default 10; maximum 50; also sets the fallback threshold |
crossSellEnabled | Query | Optional boolean true or false; default false |
Keep pageSize unchanged between pages. recommendationLimit is a banner display limit, not an API query parameter. Archive filter/sort settings are not forwarded into recommendation candidate selection.
The endpoint is public and uses the default request throttle. Session context is optional. It returns Cache-Control: no-store because rankings can include personalization. Invalid modes and boolean values fail validation. An unresolved seed returns 404.
Response
The HTTP response contains the paginated result in data. Each recommendation contains the complete source-specific car payload.
The example below abbreviates this payload. Its identifiers and scores are examples only.
{
"data": {
"data": [
{
"source": "inventory",
"id": "candidate-id",
"similarity": 0.625,
"score": 0.725,
"matchedSignals": ["purchase-price", "vehicle-class", "fuel", "vehicle-type", "session-result"],
"car": { "id": "candidate-id", "vehicleClass": "Motorbike" }
}
],
"resultCount": 1,
"totalPages": 1,
"hasPrevPage": false,
"hasNextPage": false
}
}Possible matched signals are purchase-price, monthly-price, brand, vehicle-class, model-id, model, fuel, vehicle-type, session-result, and session-search.
resultCount counts eligible results after seed exclusion and fallback selection. It does not count cards on the current page or specify the banner display limit.
Requests beyond the last page return an empty recommendation array.
Sources and vehicle classes
Source describes the listing: deal or inventory. Vehicle class describes the vehicle, such as Car or Motorbike. These are independent.
| Seed source | crossSellEnabled | Eligible sources |
|---|---|---|
inventory | false | Inventory only |
deal | false | Deals only |
| Either | true | Deals and inventory |
Cross-sell permits candidates from the other source. It does not guarantee results from both sources or reserve positions for either source. The engine ranks same-class candidates from both enabled sources together.
Same-class priority and backfill
The engine excludes the seed from its own source. It first ranks candidates that match the seed’s normalized vehicle class. It uses candidates from other classes only when all same-class candidates fill less than one page. This includes candidates without class data. Fallback candidates fill the remaining positions on that page. They never replace same-class results.
For a page size of 10:
| Same-class candidates | Result |
|---|---|
| 14 | Page one has 10; page two has 4. No cross-class backfill. |
| 10 | One full page of same-class results. |
| 6 | Six same-class results, then up to four fallback results. |
| 0 | Up to ten fallback results. |
There are no additional fallback pages. If the seed has no vehicle class, the engine cannot compare classes and ranks all candidates normally.
Cross-class backfill works with crossSellEnabled=false within the selected source. A motorcycle inventory seed can therefore receive car inventory fallback without cross-sell. Car deals require crossSellEnabled=true.
The banner requests pages of min(6, recommendationLimit). The normal fallback threshold is six, including when the display limit is ten.
Five same-class results can receive one fallback card. Eight same-class results receive no fallback cards to reach ten.
Direct API callers select their own page size.
Recommendation ranking
The engine uses weighted attribute matching, not machine learning. It normalizes text attributes before exact comparison. Missing seed attributes add no available weight. Missing candidate attributes cannot match.
| Attribute | Weight | Match rule |
|---|---|---|
| Price | 3 | Within an inclusive ±20% range on the same price basis |
| Brand | 3 | Exact normalized match |
| Vehicle class | 3 | Exact normalized match; also determines the priority group |
| Model id | 4 | Exact normalized match when the seed has a model id |
| Model name | 3 | Used instead of model id only when the seed has no model id |
| Fuel | 2 | Exact normalized match |
| Vehicle type/category | 2 | Exact normalized match |
The engine first compares purchase prices. If the seed has no purchase price, it compares the seed’s monthly price with each candidate’s monthly price. It never compares a purchase price with a monthly price. It reads gross offer prices in cents. Inventory also supports its purchase-price field.
Inventory class and category come from its vehicle fields. Deals read class and category/type from their optional line payload. Missing deal class data places that deal in the fallback group when the seed class is known.
Similarity and ranking score
similarity = matched attribute weight / available seed attribute weight
score = similarity + history bonussimilarity ranges from 0 to 1. It is 0 when the seed has no available attributes.
Multiply it by 100 to get a feature-match percentage. This percentage does not predict whether a visitor will buy or prefer the vehicle.
The API does not return a separate percentage.
score includes personalization and can reach 1.2. Within each class group, the engine sorts by descending score.
It then sorts by the number of unique matched signals, and finally by stable candidate order.
The same-class group always comes before fallback candidates, including those with higher scores.
Session personalization
The engine reads the 50 latest product-search events at most for the current session. It uses deal and inventory events from that set. These events are archive or search responses. They are not clicks or recommended vehicles.
| History signal | Bonus |
|---|---|
| Candidate appeared in a previous archive result from the same source | 0.1, awarded once |
| Distinct search/filter term occurs in the candidate’s normalized search text | 0.05 per term, at most 0.1 total |
The maximum total bonus is 0.2. Duplicate events and repeated terms add no points. Result identifiers are source-specific; search terms can match across both sources. Search text contains brand, model, class, vehicle type, and fuel.
Without session history, the bonus is zero. Displaying recommendations does not record a product-search event. Reloading the banner therefore does not increase its result scores. An archive response shows exposure, not a card click. Recommendation ranking does not use clicks or conversions.
Limits
The engine uses the archive services to load at most 300 candidates per enabled source. It evaluates vehicle classes and ranking within this set, not across the complete catalog. A larger banner limit does not increase the candidate set. Catalog or session changes between requests can change the order. Pagination is not a fixed snapshot.
The engine does not persist or cache recommendations. It has no source quota and does not require a price increase. It does not guarantee an exact model match. The banner suggests alternatives. An “upsell” can cost less than the seed.
For concepts, see how recommendations work. For banner setup, see configure vehicle recommendations.