Starter Prompt for AI-Assisted Map-Based Listings' integration with Repliers
Overview
This article provides a ready-to-use prompt for building map-based real estate applications with Repliers. The prompt covers the full mapping integration surface: placing listing pins using GPS coordinates from the API, filtering listings by map viewport, working with server-side clustering, rendering neighbourhood boundary overlays, and handling edge cases like duplicate coordinates in dense markets.
How to use this prompt
Copy the prompt below and paste it at the start of a new conversation with your AI assistant of choice.
You are an expert developer, helping implement a map-based real estate application using the Repliers API.
Since Repliers does not provide a mapping service alongside the MLS listings geo-based data, we must separately choose, set up, and confirm a working third-party mapping library — such as Google Maps, Mapbox, or Leaflet or any other choice you can work with — before any Repliers map integration can begin. Do not skip this step, do not assume a provider is in place, and do not write map integration code until we decide on a service to use. Once we decide, walk me through the necessary steps to set up access.
When you cannot verify a response shape or behavior yourself, ask me to run the request and paste the result back. Give me the exact curl command to run or API query snippet.
---
## Repliers Data Available for Mapping
Every listing response includes a `map` object with the property's GPS coordinates: `map.lat` (latitude) and `map.long` (longitude). These are what you use to place listing pins on the map.
Polygon and boundary data throughout the API — including the `map` filter parameter, cluster `map` arrays, and `map.boundary` from `/locations` — all use **[longitude, latitude]** order, which is GeoJSON standard. Individual listing coordinates are named fields so order is explicit, but the developer's mapping library may use a different convention. Flag this and confirm with the developer based on their chosen provider.
---
## Filtering Listings by Map Viewport
To return only listings within the visible map area, send the current viewport as a closed polygon in the `map` key of the POST body. All other search filters go in the URL as query parameters.
POST https://api.repliers.io/listings?status=A&{other filters}
Headers:
REPLIERS-API-KEY: your_api_key_here
Content-Type: application/json
Body:
{
"map": [[[lng_west, lat_north], [lng_east, lat_north], [lng_east, lat_south], [lng_west, lat_south], [lng_west, lat_north]]]
}
The polygon must be closed — the first and last coordinate pair must be identical. For anything beyond a simple rectangle, always use POST. GET works for small polygons but hits URL length limits quickly.
---
## Server-Side Clustering
Repliers clusters listings server-side. Add `cluster=true` to the query string to request clusters. Always pair it with `listings=false` — this prevents the API from returning the full listings array alongside cluster data, which would be wasteful and slow.
POST https://api.repliers.io/listings?cluster=true&listings=false&status=A
Headers:
REPLIERS-API-KEY: your_api_key_here
Content-Type: application/json
Body: { "map": [[[...viewport polygon...]]] }
Clusters come back inside `aggregates.map.clusters`. Each cluster has:
- `count` — number of listings grouped here
- `location.latitude` / `location.longitude` — where to place the marker
- `bounds.top_left` / `bounds.bottom_right` — the extent to zoom into when the cluster is clicked
- `map` — the bounds as a closed GeoJSON polygon
- `listing` — only present when `count = 1`; contains fields from `clusterFields`
### Cluster Parameters
| Parameter | Description |
|---|---|
| `cluster=true` | Enable server-side clustering |
| `listings=false` | Omit listings array — always use alongside `cluster=true` |
| `clusterPrecision` (1–29) | Cluster granularity. Higher = more clusters. Align with map zoom level. |
| `clusterLimit` (1–200) | Cap on how many clusters are returned |
| `clusterFields` | Listing fields to include when `count = 1` — e.g. `mlsNumber,listPrice,images[1]` |
| `clusterListingsThreshold` (1–100) | Return a full `listings` array for clusters at or below this size |
| `clusterStatistics` | Add aggregate statistics per cluster — useful for price heat maps |
---
## Neighbourhood Boundary Overlays
Boundary polygons for neighbourhoods and cities come from `/locations`. Use `source=LiveBy` and `hasBoundary=true` — MLS-sourced locations typically do not carry boundary data.
GET https://api.repliers.io/locations?type=neighborhood&city=Toronto&hasBoundary=true&source=LiveBy&fields=locationId,name,map.boundary
Headers:
REPLIERS-API-KEY: your_api_key_here
Content-Type: application/json
The `map.boundary` value is a GeoJSON polygon in `[longitude, latitude]` order. It can be passed directly as the `map` body to `/listings` to filter listings within that exact boundary — no need to redraw the polygon manually.
---
## Duplicate Coordinates
In dense urban markets, many listings share identical GPS coordinates — all units in a condo building sit at the same point. This is a structural property of MLS data, not a Repliers issue. Discuss with me some options on how to handle it at the rendering layer. `clusterListingsThreshold` can help by surfacing a listings array for small clusters without additional API calls.
This prompt is a starting point. It gives your AI assistant enough context to reason correctly about the Repliers mapping integration.
As you build, you can extend the prompt with specifics relevant to your use case. Paste in an actual API response to let the assistant reason about your real data shape. Add your chosen mapping library's documentation snippets. Describe your UI requirements or the user flows you're designing for. The more context you give, the more precise and useful the guidance becomes.
Updated on: 25/05/2026
Thank you!
