Skip to Content
API ReferenceSearch & LocationsEndpoints

Search & Locations

Three routers serve the search box and the map: /api/autosuggest (src/routes/autosuggest.ts), /api/locations (src/routes/locations.ts) and /api/buildings (src/routes/buildings.ts). They do not share an auth rule: the combined autosuggest and the two /locations routes use passthrough auth (a guest is allowed, an invalid token is a 401), while the other autosuggest routes and every buildings route resolve no JWT middleware at all, so a token is never read and never rejected. Terms are in the Glossary.

This page is the operation index. The branches, ranking and failure behaviour are on the deep pages; the full parameter contract is in Swagger (/swagger).

Autosuggest · Locations & Buildings · Geocoding providers · MLS-number prefix · W3 worked trace

Operations

“Cached / header” names the cache namespace and the response header the handler writes; “none” means neither. Every route sets enable.xff. Validation errors are 400; an upstream failure is relayed as described in HTTP semantics.

Method & pathAuthCached / headerSide effectsErrorsDeep dive
GET /api/autosuggestpassthroughnonenone; up to four outbound calls (Mapbox, Repliers listings twice, Repliers locations)400 (validation: neither searchSession nor mapboxSearchSession, q shorter than 3, resultsPerPage above the cap); relayed upstream status when the Mapbox, listings or locations call failsAutosuggest
GET /api/autosuggest/addressnonenonenone; one Mapbox or Google call400 (validation, q shorter than 1); Mapbox error status relayed; a Google status other than OK / ZERO_RESULTS is a 500Address
GET /api/autosuggest/locations (deprecated)none@cached("listings:autosuggest:locations") with CACHE_STATSWIDGET_TTL → Cache-Controlnonenone produced by the route (no request parameters are read); relayed upstream statusDeprecated locations
GET /api/locationspassthrough@cached("locations:get") → Cache-Controlnone400 (validation, radius without lat and long); relayed upstream statusLocations
GET /api/locations/autocompletepassthroughnonenone400 (validation: search missing or shorter than 3, resultsPerPage above 10); relayed upstream statusAutocomplete
GET /api/buildingsnone@cached("buildings:search") → Cache-Controlnone400 (validation, radius without lat and long); relayed upstream statusBuildings
POST /api/buildingsnone@cached("buildings:search") → Cache-Controlnoneas GET /api/buildings; the body accepts only mapBuildings
GET /api/buildings/{addressKey}none@cached("buildings:single"); the route sets no header and the body is the { result, expires } wrappernone400 (addressKey missing or over 255 characters); relayed upstream statusSingle building

Autosuggest — /autosuggest

Moved to Autosuggest: the combined search box, the address-only endpoint and the deprecated locations endpoint.

Locations — /locations

Moved to Locations & Buildings: sources, paging bounds and the cache.

Buildings — /buildings

Moved to Locations & Buildings: the list, the single building and the cache.

Verified against portal-backend 997ae3e, 2026-10-20.

Last updated on