Admin analytics locations
Analytics
Admin analytics locations
Top boroughs by current live listing count, read from the latest analytics_daily rollup’s topBoroughs.
GET
Admin analytics locations
Overview
The admin dashboard’s “where are listings concentrated?” tile. Returns the top boroughs by current live listing count, taken from the latestanalytics_daily row’s topBoroughs array (capped at 10 entries by the rollup).
Boroughs are derived from each listing’s UK postcode outward-code area (e.g. E1 6AN → E1, SE15 4SW → SE15, W1A 1AA → W1) — see Analytics and rollups. This is not an official London-borough name; it is the postcode area used as a coarse geographic grouping.
Available to any admin role — SUPER, MODERATOR, and FINANCE all read this surface.
Authentication
Bearer <accessToken> with scope: 'admin' required (requireAdmin).
Path parameters
None.Query parameters
None.Request body
None.Response — 200 OK
| Field | Type | Notes | Example |
|---|---|---|---|
asOf | string | null | The date of the rollup row these rows came from, YYYY-MM-DD. null when no rollup has run yet (fresh database, pre-launch). | 2026-05-22 |
items | array | Up to 10 borough breakdowns. Sorted by listingCount descending. Empty [] when asOf is null. |
Location row
| Field | Type | Notes | Example |
|---|---|---|---|
borough | string | UK postcode outward-area code (e.g. E1, SE15, W1). | E1 |
listingCount | integer | Count of current_homes with status: 'LIVE' AND ownerTenancyApproved: true whose postcode falls in this area. | 48 |
demandHits | integer | Reserved — count of user_preferences whose desired-radius covers this borough’s centroid. Hard-zero for MVP (see limitations). | 0 |
Empty (no rollup yet) response
MVP limitations
Error responses
| Status | Code | Meaning |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing, malformed, expired, or non-admin-scope token. |
See also
- Analytics and rollups — the rollup pipeline + borough derivation rules.
- Admin analytics overview — live counters, 60s cache.
- Admin analytics cohorts — per-day rollup metrics.
curl
Postman
Seedocs/postman/swappr.postman_collection.json → Admin Analytics → Locations.