GET /listings/aggregates
Counts grouped by status, city, and bedrooms. Designed to power filter sidebars (“Active (247), Pending (12), Closed (4,321)”) without a separate COUNT(*) query per facet.
Accepts the same query parameters as /listings, so you can scope
aggregates to the current search.
Response — 200 OK
{
"aggregates": {
"status": [
{ "value": "Active", "count": 247 },
{ "value": "Pending", "count": 12 },
{ "value": "Closed", "count": 4321 }
],
"city": [
{ "value": "Windsor", "count": 1456 },
{ "value": "LaSalle", "count": 187 },
{ "value": "Tecumseh", "count": 92 }
],
"bedrooms": [
{ "value": 1, "count": 67 },
{ "value": 2, "count": 412 },
{ "value": 3, "count": 989 },
{ "value": 4, "count": 524 },
{ "value": 5, "count": 91 }
]
},
"attribution": { /* see Concepts → Attribution */ }
}city is capped at the top 50 by count — if you have feeds spanning hundreds
of cities, the long tail won’t show up here.
Example: facet sidebar that filters itself
GET /listings/aggregates?city=Windsor
→ returns Status & Bedroom buckets *just* for Windsor listings
GET /listings/aggregates?city=Windsor&status=Active
→ narrows further; Bedroom buckets reflect only Active Windsor listingsThis composes — each filter param narrows the search universe before counting.