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 latest analytics_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

Location row

Empty (no rollup yet) response

MVP limitations

  • demandHits is always 0. The spec calls for it to count user_preferences whose radius covers each borough’s centroid, but that requires a per-borough centroid table + a $geoWithin aggregation per borough — out of scope for the launch slice. Ranking is therefore by listingCount only. The rollup worker logs this limitation once at boot.
  • Borough = postcode outward area, not the official council name. E1 covers parts of Tower Hamlets but is not “Tower Hamlets”. Treat the borough field as a key, not a label.
  • Staleness up to 24h. Reflects yesterday’s rollup, not live. For “current moment” totals use analytics overview.

Error responses

See also

curl

Postman

See docs/postman/swappr.postman_collection.json → Admin Analytics → Locations.