!

Filtering

Most of the endpoints on the Houski API allow you to filter the data returned by the API, by virtually any field. You can also filter properties geographically by specifying a bounding box, or polygon (scroll down on this page for examples).

Filtering is performed by adding query parameters to the request URL. For example, to filter the properties returned by the properties endpoint by the number of full bathrooms, you could do any of the following:

FilterNameExample
Greater thangtbathroom_full_gt=3
Greater than or equal togtebathroom_full_gte=3
Less thanltbathroom_full_lt=3
Less than or equal toltebathroom_full_lte=3
Equal toeqbathroom_full_eq=3
Not equal toneqbathroom_full_neq=3
In the given listinproperty_type_in=House,Apartment
Matches a regular expressionregexbathroom_full_regex=1|3
Does not match a regular expressionnregexbathroom_full_nregex=1|3
Programming language

Select the programming language you want to display the code examples in.

Filtering by number of bedrooms
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&bedroom_eq=3&country_abbreviation=ca&province_abbreviation=ab&results_per_page=3&select=bedroom,den,estimate_list_price,latitude,longitude"
TypeScript code
const houski_properties_data = async (): Promise<PropertiesResponse> => {

    // You must copy the PropertiesResponse type declarations from the 
    // Houski API documentation to strongly type the response

    const url = new URL('https://api.houski.ca/properties');
    url.searchParams.set('api_key', 'YOUR_API_KEY');
    url.searchParams.set('bedroom_eq', '3');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');
    url.searchParams.set('select', 'bedroom,den,estimate_list_price,latitude,longitude');

    const response = await fetch(url);
    const data = await response.json();

    return data;
}

(async () => {
let data: PropertiesResponse = await houski_properties_data();

// Log the response
console.log(data);
})();
Response
JSON
{
  "cache_hit": false,
  "cost_cents": 2.1000001430511475,
  "data": [
    {
      "address": "5313 Township Road 522",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 362495,
      "latitude": 53.4829216003418,
      "longitude": -114.67491149902344,
      "property_id": "10000ac3e3c04e78"
    },
    {
      "address": "12819 121 Avenue NW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 392249,
      "latitude": 53.574344635009766,
      "longitude": -113.54380798339844,
      "property_id": "1000286b73c1dbe3"
    },
    {
      "address": "219P 10160 115 Street NW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 574862,
      "latitude": 53.54233169555664,
      "longitude": -113.51998901367188,
      "property_id": "1000390ce99c2288"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 531855
  },
  "price_quote": false,
  "result_total": 1595563,
  "time_ms": 173,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Alberta",
    "province_abbreviation": "AB",
    "province_abbreviation_id": "aae1f05a0f89d2c7",
    "province_abbreviation_link": "ca/ab",
    "province_slug": "alberta"
  }
}
Filtering by a bounding box
A bounding box is a rectangular geographic region defined by two points: the northeast and southwest corners. The northeast corner is defined by the latitude and longitude of the top right corner of the box, and the southwest corner is defined by the latitude and longitude of the bottom left corner of the box. These bounding box parameters can be used to filter requests. When used, requests will only include the properties that are located within the bounding box.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&bbox_ne_lat=51.1005&bbox_ne_lng=-113.508&bbox_sw_lat=50.6668&bbox_sw_lng=-114.4593&country_abbreviation=ca&province_abbreviation=ab&results_per_page=3&select=bedroom,den,estimate_list_price,latitude,longitude"
TypeScript code
const houski_properties_data = async (): Promise<PropertiesResponse> => {

    // You must copy the PropertiesResponse type declarations from the 
    // Houski API documentation to strongly type the response

    const url = new URL('https://api.houski.ca/properties');
    url.searchParams.set('api_key', 'YOUR_API_KEY');
    url.searchParams.set('bbox_ne_lat', '51.1005');
    url.searchParams.set('bbox_ne_lng', '-113.508');
    url.searchParams.set('bbox_sw_lat', '50.6668');
    url.searchParams.set('bbox_sw_lng', '-114.4593');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');
    url.searchParams.set('select', 'bedroom,den,estimate_list_price,latitude,longitude');

    const response = await fetch(url);
    const data = await response.json();

    return data;
}

(async () => {
let data: PropertiesResponse = await houski_properties_data();

// Log the response
console.log(data);
})();
Response
JSON
{
  "cache_hit": false,
  "cost_cents": 2.1000001430511475,
  "data": [
    {
      "address": "6 1744 7 Street SW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 911026,
      "latitude": 51.03611755371094,
      "longitude": -114.0792007446289,
      "property_id": "10004f7afe0c1946"
    },
    {
      "address": "384 Copperpond Landng SE",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 523329,
      "latitude": 50.925743103027344,
      "longitude": -113.92975616455078,
      "property_id": "10007f9761f49940"
    },
    {
      "address": "52 Cedargrove Way SW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 631752,
      "latitude": 50.951454162597656,
      "longitude": -114.12571716308594,
      "property_id": "1000c277cd905d3b"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 172486
  },
  "price_quote": false,
  "result_total": 517457,
  "time_ms": 161,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Alberta",
    "province_abbreviation": "AB",
    "province_abbreviation_id": "aae1f05a0f89d2c7",
    "province_abbreviation_link": "ca/ab",
    "province_slug": "alberta"
  }
}
Filtering by a polygon
A polygon is a geometric shape defined by a set of ordered points connected by straight lines. The polygon is defined by a set of latitude and longitude coordinates that create an arbitrary shape. When using the polygon parameter in a request, only properties within the polygon will be returned. The polygon parameter requires a string of latitude-longitude pairs that are separated by underscores, with each pair separated by a comma.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&polygon=51.0447_-114.0719,51.0544_-114.0719,51.0544_-114.0856,51.0452_-114.0856&province_abbreviation=ab&results_per_page=3&select=bedroom,den,estimate_list_price,latitude,longitude"
TypeScript code
const houski_properties_data = async (): Promise<PropertiesResponse> => {

    // You must copy the PropertiesResponse type declarations from the 
    // Houski API documentation to strongly type the response

    const url = new URL('https://api.houski.ca/properties');
    url.searchParams.set('api_key', 'YOUR_API_KEY');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('polygon', '51.0447_-114.0719,51.0544_-114.0719,51.0544_-114.0856,51.0452_-114.0856');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');
    url.searchParams.set('select', 'bedroom,den,estimate_list_price,latitude,longitude');

    const response = await fetch(url);
    const data = await response.json();

    return data;
}

(async () => {
let data: PropertiesResponse = await houski_properties_data();

// Log the response
console.log(data);
})();
Response
JSON
{
  "cache_hit": false,
  "cost_cents": 2.1000001430511475,
  "data": [
    {
      "address": "2018 608 9 Street SW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 699087,
      "latitude": 51.04768371582031,
      "longitude": -114.0837173461914,
      "property_id": "100556b0922cfec"
    },
    {
      "address": "2101 888 4 Avenue SW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 1392490,
      "latitude": 51.05002975463867,
      "longitude": -114.08050537109376,
      "property_id": "100a3285ac5dd6b1"
    },
    {
      "address": "500 Eau Claire Avenue Southwest",
      "bedroom": 1,
      "den": 0,
      "estimate_list_price": 493060,
      "latitude": 51.05277633666992,
      "longitude": -114.07202911376952,
      "property_id": "102bfcb05b5c7fdc"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 1677
  },
  "price_quote": false,
  "result_total": 5030,
  "time_ms": 1093,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Alberta",
    "province_abbreviation": "AB",
    "province_abbreviation_id": "aae1f05a0f89d2c7",
    "province_abbreviation_link": "ca/ab",
    "province_slug": "alberta"
  }
}

Filtering Expansion Data

When using the expand parameter to include additional datasets (listings, permits, assessments), you can apply specific filters to control which expanded records are included using expand filters. These filters work independently of your main property filters and only affect the expanded data.

Expand Filter Syntax

Expand filters use the format: expand_[field]_[operator]=[value]

Listings Filters

FilterDescriptionExample
expand_listing_date_gteListings after specified dateexpand_listing_date_gte=2024-01-01
expand_listing_date_gtListings strictly after dateexpand_listing_date_gt=2024-06-01
expand_listing_event_eqSpecific listing eventsexpand_listing_event_eq=Price decrease
expand_listing_price_ltListing prices below amountexpand_listing_price_lt=500000

Permits Filters

Permit filters are particularly useful for finding properties with specific types of permits or renovations.

FilterDescriptionExample
expand_permit_application_date_gtePermits applied for after dateexpand_permit_application_date_gte=2023-01-01
expand_permit_content_regexSearch permit descriptions with regexexpand_permit_content_regex=(?i)\b(secondary|suite)\b

Common Permit Search Patterns

Search TypeRegex Pattern
Secondary suites(?i)\b(secondary|suite)\b
Renovations(?i)\b(renovation|remodel)\b
Kitchen/bathroom upgrades(?i)\b(kitchen|bathroom)\b
Outdoor improvements(?i)\b(deck|patio|fence)\b
Garage/parking(?i)\b(garage|carport|parking)\b

Assessments Filters

FilterDescriptionExample
expand_assessment_year_eqAssessments for specific yearexpand_assessment_year_eq=2024
expand_assessment_value_gteAssessment value minimumsexpand_assessment_value_gte=500000
expand_assessment_value_lteAssessment value maximumsexpand_assessment_value_lte=800000

Filter Expand Match

The filter_expand_match parameter controls which properties are returned based on expanded data availability:

ValueBehaviorUse Case
Default (no parameter)Return all properties, with or without expanded dataGeneral property search with optional expansion
anyReturn only properties with data for ANY requested expansionProperties with listing OR permit data
allReturn only properties with data for ALL requested expansionsProperties with listing AND permit data

Example Usage

Finding properties with recent price decreases:

expand=listings
&expand_listing_event_eq=Price decrease
&expand_listing_date_gt=2024-04-01
&filter_expand_match=all

Finding properties with secondary suite permits:

expand=permits
&expand_permit_content_regex=(?i)\b(secondary|suite)\b
&expand_permit_application_date_gte=2023-01-01
&filter_expand_match=all

Properties with high assessments in 2024:

expand=assessments
&expand_assessment_year_eq=2024
&expand_assessment_value_gte=750000
&filter_expand_match=all

Important Notes

  • Expand filters only affect the expanded datasets, not the main property data
  • Use filter_expand_match=all to ensure only properties with matching expanded data are returned
  • Regex patterns are case-insensitive when using the (?i) flag
  • Word boundaries (\b) ensure exact word matches in regex patterns
  • Multiple expand filters can be combined for more precise control