Filter facets
Discover live filter values and counts. Facet responses cache for about 600 seconds. A filter sidebar can read every flat dimension in one call with /api/facets.
Every flat facet dimension in one request instead of six.
Requires the search scope.
Parameters
fieldsstring · query stringComma-separated subset of brands, years, fuels, countries, gearboxes, sites. Defaults to all of them. models is not available here — it is brand-scoped and stays at /api/models.
Example brands,fuels,gearboxes·Where the value comes from The dimensions your sidebar actually renders.
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
Example requests
GET https://api.thecarapi.com/api/facets?fields=brands,fuels,gearboxes&country=DEGET https://api.thecarapi.com/api/facets?fields=brands,years,sites&damaged=trueExample response
{
"success": true,
"brands": [
{
"id": 12,
"name": "BMW",
"slug": "bmw",
"count": 3266
}
],
"fuels": [
"Diesel",
"Petrol"
],
"gearboxes": [
"Automatic",
"Manual"
]
}What you get back
brands / years / fuels / countries / gearboxes / sitesarrayEach field is its own endpoint’s payload merged verbatim — countries still ships country_details alongside it, and no field gains or loses counts by being requested here.
errorsobjectPresent only when a dimension could not be served: { field: reason }. Every other field is still returned, so one slow dimension cannot blank a filter sidebar.
List brands with round-trippable slugs and live inventory counts.
Requires the search scope.
Parameters
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
searchstring · query stringSubstring filter on brand name.
Example bm·Where the value comes from Free text entered by your user.
orderingenum · query stringname, -name, count, or -count.
Example -count·Where the value comes from Choose name, -name, count, or -count.
limitinteger · query stringMaximum number of values.
Example 20·Where the value comes from Result count chosen by your application.
Example requests
GET https://api.thecarapi.com/api/brands?search=bm&ordering=-count&limit=20GET https://api.thecarapi.com/api/brands?country=DE&damaged=trueExample response
{
"success": true,
"brands": [
{
"id": 12,
"name": "BMW",
"slug": "bmw",
"count": 1543
}
]
}List models for one brand with live inventory counts.
Requires the search scope.
Parameters
brandstring | integer · query stringrequiredBrand name, slug, or brand_id.
Example bmw·Where the value comes from /api/brands -> brands[].slug (or id/name)
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
searchstring · query stringSubstring filter on model name.
Example x·Where the value comes from Free text entered by your user.
orderingenum · query stringname, -name, count, or -count.
Example -count·Where the value comes from Choose name, -name, count, or -count.
Example requests
GET https://api.thecarapi.com/api/models?brand=bmw&ordering=-countGET https://api.thecarapi.com/api/models?brand=12&search=x&country=DEExample response
{
"success": true,
"models": [
{
"name": "320d",
"slug": "320d",
"count": 210
}
]
}List registration years available in current inventory.
Requires the search scope.
Parameters
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
Example requests
GET https://api.thecarapi.com/api/years?country=DEGET https://api.thecarapi.com/api/years?damaged=true&buy_now=trueExample response
{
"success": true,
"years": [
2024,
2023,
2022,
2021
]
}List canonical fuel groups available in current inventory.
Requires the search scope.
Parameters
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
Example requests
GET https://api.thecarapi.com/api/fuels?country=DEGET https://api.thecarapi.com/api/fuels?buy_now=trueExample response
{
"success": true,
"fuels": [
"Diesel",
"Electric",
"Hybrid",
"Mild Hybrid",
"Petrol",
"Plug-in Hybrid"
]
}List canonical gearbox groups available in current inventory.
Requires the search scope.
Parameters
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
Example requests
GET https://api.thecarapi.com/api/gearboxes?country=KRGET https://api.thecarapi.com/api/gearboxes?damaged=trueExample response
{
"success": true,
"gearboxes": [
"Automatic",
"Manual"
]
}List vehicle-location countries and display names.
Requires the search scope.
Parameters
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
Example requests
GET https://api.thecarapi.com/api/countries?buy_now=trueGET https://api.thecarapi.com/api/countries?damaged=trueExample response
{
"success": true,
"countries": [
"DE",
"JP",
"KR",
"NL"
],
"country_details": [
{
"code": "DE",
"name": "Germany"
},
{
"code": "JP",
"name": "Japan"
},
{
"code": "KR",
"name": "South Korea"
}
]
}List auction source slugs with live inventory counts.
Requires the search scope.
Parameters
damagedboolean · query stringRestrict counts to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict counts to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
Example requests
GET https://api.thecarapi.com/api/sites?buy_now=trueGET https://api.thecarapi.com/api/sites?damaged=trueExample response
{
"success": true,
"sites": [
{
"id": 1,
"name": "encar",
"count": 9021
},
{
"id": 2,
"name": "openlane",
"count": 4110
},
{
"id": 3,
"name": "ecarstrade",
"count": 3187
},
{
"id": 4,
"name": "japanauction",
"count": 1642
}
]
}Return the complete model catalog grouped by brand.
Requires the search scope.
Parameters
damagedboolean · query stringRestrict to damaged or broken vehicles.
Example true·Where the value comes from Your filter choice.
buy_nowboolean · query stringRestrict to Buy-Now inventory.
Example true·Where the value comes from Your filter choice.
countrystring · query stringISO country code or europe.
Example DE·Where the value comes from /api/countries -> country_details[].code
steeringenum · query stringRestrict to left- or right-hand-drive vehicles. Slower than an unfiltered facet call, because it is computed live rather than read from the precomputed facet table.
Example left·Where the value comes from left | lhd | right | rhd — any other value is a 400.
Example requests
GET https://api.thecarapi.com/load-models?country=DEGET https://api.thecarapi.com/load-models?buy_now=true&damaged=falseExample response
{
"BMW": [
{
"text": "320d"
},
{
"text": "X5"
}
],
"Volvo": [
{
"text": "XC60"
}
]
}