!

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": "15418 80 Avenue NW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 566206,
      "latitude": 53.513916015625,
      "longitude": -113.58931732177734,
      "property_id": "f85eb74f6785505"
    },
    {
      "address": "409 11 Street",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 457608,
      "latitude": 49.88602066040039,
      "longitude": -113.0506591796875,
      "property_id": "282e0974d3a7d8fa"
    },
    {
      "address": "540009 Range Road 180",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 290021,
      "latitude": 53.630760192871094,
      "longitude": -112.50749969482422,
      "property_id": "e8799c8a9ae8207a"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 403686
  },
  "price_quote": false,
  "result_total": 1211057,
  "time_ms": 216,
  "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": "90 2720 Rundleson Road NE",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 347509,
      "latitude": 51.07859420776367,
      "longitude": -113.9782485961914,
      "property_id": "1337ef6c8a910b3"
    },
    {
      "address": "82 Cramond Circle SE",
      "bedroom": 3,
      "den": 1,
      "estimate_list_price": 585470,
      "latitude": 50.893524169921875,
      "longitude": -113.97716522216795,
      "property_id": "13e1a7f1a9285f91"
    },
    {
      "address": "4632 20 Avenue NW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 737439,
      "latitude": 51.073604583740234,
      "longitude": -114.15760040283205,
      "property_id": "a864cb979d86a032"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 132808
  },
  "price_quote": false,
  "result_total": 398424,
  "time_ms": 216,
  "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": "795 6 Street SW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 464172,
      "latitude": 51.04603576660156,
      "longitude": -114.07678985595705,
      "property_id": "2988a0f795e27d7b"
    },
    {
      "address": "408 738 3 Avenue SW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 269770,
      "latitude": 51.05098342895508,
      "longitude": -114.0776138305664,
      "property_id": "d640fe1906650560"
    },
    {
      "address": "304 1027 1 Avenue NW",
      "bedroom": 3,
      "den": 0,
      "estimate_list_price": 375783,
      "latitude": 51.05338287353515,
      "longitude": -114.08324432373048,
      "property_id": "47bba2db67c2fe15"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 618
  },
  "price_quote": false,
  "result_total": 1852,
  "time_ms": 440,
  "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"
  }
}