Filtering recipes

Filtering recipes

Real-world queries mapped to the params that produce them.

Condos only / houses only (the realtor.ca “Ownership/Title” filter)

CREA boards rarely populate the high-level propertyType field consistently, and propertySubType often buckets condos under Single Family. Use commonInterest — it’s the field CREA’s DDF docs themselves recommend for condo-vs-freehold filtering, and it’s what realtor.ca’s Ownership / Title filter is wired to.

GET /listings?city=Windsor&maxPrice=500000&commonInterest=Condo%2FStrata&status=Active
GET /listings?city=Windsor&commonInterest=Freehold

Valid values: Condo/Strata (condos + stratas), Freehold (detached / semi / row with freehold title), Leasehold (leased land). Per CREA, Freehold is the preferred way to exclude condos — more accurate than negating Condo/Strata, because some rows leave the field null.

Map-view: listings inside what’s visible on screen

When the user pans / zooms a map, you have four corner coordinates. Send them as a WKT polygon:

GET /listings?map=POLYGON((-83.2 42.2,-82.8 42.2,-82.8 42.4,-83.2 42.4,-83.2 42.2))&resultsPerPage=100

Important: WKT is longitude latitude (X Y), the opposite of how most mapping libraries return coordinates. Don’t swap them in the wrong order or you’ll search the Atlantic Ocean.

Polygon must be closed — the first vertex must equal the last vertex.

Listings within 5 km of “where I am”

Browser geolocation gives lat / long; combine with radius in kilometres:

GET /listings?lat=42.317&long=-83.034&radius=5

PostGIS does the heavy lifting — distance is computed on a GEOGRAPHY(Point, 4326) column so the result respects Earth’s curvature, not flat-projection approximations.

All listings by one specific agent (per-agent landing page)

GET /listings?listAgentKey=AGNT-12345

Useful for a realtor’s personal site that wants to show “my current listings”.

Listings for a hand-picked team

GET /listings?listAgentKey=AGNT-12345,AGNT-22222,AGNT-33333

Comma-separated list (max 50). OR semantics — listings where the agent is any of the named keys.

All listings from a brokerage (office landing page)

GET /listings?listOfficeKey=OFC-678

Every listing across every agent in that brokerage.

”Show only my own listings, not the shared pool”

CREA’s National Shared Pool means your tenant feed includes listings from many agents you don’t represent. To filter down to just the realtor’s own:

GET /listings?listAgentKey=THEIR_OWN_MEMBER_KEY

This is the pattern Cesar’s site uses to scope the public-facing search to his personal portfolio while still using the shared pool feed under the hood.

Active 3-bed condos $400k–$700k in Windsor sorted by newest

GET /listings?city=Windsor&propertySubType=Condominium&minBedrooms=3&minPrice=400000&maxPrice=700000&status=Active&sortBy=createdDesc

Listings that changed in the last hour

Use the /listings endpoint with no time filter, sort by updatedOnDesc, and check modificationTimestamp client-side. We don’t yet support a server-side “modified-since” filter — coming as ?since= in a future release. Email us if you need it before then.

Combining filters with map polygon

All listing-search params compose:

GET /listings?map=POLYGON(…)&minBedrooms=3&status=Active&listAgentKey=AGNT-12345

This returns: Active 3+ bed listings, drawn by AGNT-12345, inside the polygon. Each filter narrows the result set further before pagination.