API recipes

Requests you can copy and run. Each one returns live data from the API.

Examples

Find heritage homes (pre-1920)

Programming language

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

Find heritage homes built before 1920
Construction year is tracked on millions of properties, isolating heritage-era stock. Heritage homes often need specialty insurance and restoration expertise, and many fall under provincial heritage acts.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=toronto&construction_year_lt=1920&country_abbreviation=ca&page=1&property_type_in=House,Townhouse&province_abbreviation=on&results_per_page=5&select=address,construction_year,interior_sq_m,land_area_sq_m,assessment_value,estimate_list_price"
TypeScript code
const houski_recipe_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('city', 'toronto');
    url.searchParams.set('construction_year_lt', '1920');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('page', '1');
    url.searchParams.set('property_type_in', 'House,Townhouse');
    url.searchParams.set('province_abbreviation', 'on');
    url.searchParams.set('results_per_page', '5');
    url.searchParams.set('select', 'address,construction_year,interior_sq_m,land_area_sq_m,assessment_value,estimate_list_price');

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

    return data;
}

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

// Log the response
console.log(data);
})();
Response
JSON
{
  "cache_hit": false,
  "cost_cents": 2.6,
  "data": [
    {
      "address": "115 Marlborough Avenue",
      "construction_year": 1890,
      "estimate_list_price": 2250676,
      "interior_sq_m": 139.2605,
      "land_area_sq_m": 191.38026,
      "property_id": "6646e17313d9ac40"
    },
    {
      "address": "401 Clinton Street",
      "construction_year": 1910,
      "estimate_list_price": 1466659,
      "interior_sq_m": 147.6217,
      "land_area_sq_m": 225.9402,
      "property_id": "9187215c3481d350"
    },
    {
      "address": "615 Logan Avenue",
      "construction_year": 1908,
      "estimate_list_price": 952122,
      "interior_sq_m": 87.14233,
      "land_area_sq_m": 115.94299,
      "property_id": "dae117bc0336f29d"
    },
    {
      "address": "150 Pritchard Avenue",
      "construction_year": 1918,
      "estimate_list_price": 720439,
      "interior_sq_m": 74.22891,
      "land_area_sq_m": 125.41911,
      "property_id": "f1490f0331dce760"
    },
    {
      "address": "295 Old Weston Road",
      "construction_year": 1914,
      "estimate_list_price": 678077,
      "interior_sq_m": 124.11743,
      "land_area_sq_m": 110.55462,
      "property_id": "78a10d0c4e4f3df9"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 7
  },
  "price_quote": false,
  "result_total": 33,
  "time_ms": 30,
  "ui_info": {
    "city": "Toronto",
    "city_id": "6cdbdee2492718ed",
    "city_link": "ca/on/toronto",
    "city_slug": "toronto",
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Ontario",
    "province_abbreviation": "ON",
    "province_abbreviation_id": "146699ee774499d3",
    "province_abbreviation_link": "ca/on",
    "province_slug": "ontario"
  }
}