!

API recipes

Practical examples for using the Houski API.

Examples

Find houses with aging roofs (15+ years)

Programming language

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

Find houses with aging roofs (15+ years)
roof_material_install_year is tracked where data is available. Roofs 15+ years old are prime targets for roofing contractor direct mail, storm damage outreach, and insurance inspection campaigns.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=calgary&country_abbreviation=ca&page=1&property_type_eq=House&province_abbreviation=ab&results_per_page=5&roof_material_install_year_lt=2010&select=address,roof_material,roof_material_install_year,construction_year,interior_sq_m,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', 'calgary');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('page', '1');
    url.searchParams.set('property_type_eq', 'House');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '5');
    url.searchParams.set('roof_material_install_year_lt', '2010');
    url.searchParams.set('select', 'address,roof_material,roof_material_install_year,construction_year,interior_sq_m,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.5999999046325684,
  "data": [
    {
      "address": "11 Chaparral Valley Garden SE",
      "construction_year": 2009,
      "estimate_list_price": 444242,
      "interior_sq_m": 174.7027130126953,
      "property_id": "100a49f6a821f222",
      "roof_material": "Asphalt",
      "roof_material_install_year": 2009
    },
    {
      "address": "422 Mount Sparrowhawk Place SE",
      "construction_year": 1992,
      "estimate_list_price": 1012045,
      "interior_sq_m": 193.42251586914065,
      "property_id": "100c0a0fa63769e1",
      "roof_material": "Asphalt",
      "roof_material_install_year": 2009
    },
    {
      "address": "434 Cranston Drive SE",
      "construction_year": 2009,
      "estimate_list_price": 663003,
      "interior_sq_m": 158.90933227539062,
      "property_id": "1011bbe15bf9928f",
      "roof_material": "Asphalt",
      "roof_material_install_year": 2009
    },
    {
      "address": "229 Evansdale Way NW",
      "construction_year": 2009,
      "estimate_list_price": 569478,
      "interior_sq_m": 147.76104736328125,
      "property_id": "1016419a8159eb02",
      "roof_material": "Asphalt",
      "roof_material_install_year": 2009
    },
    {
      "address": "60 Citadel Pass Crescent NW",
      "construction_year": 1992,
      "estimate_list_price": 606282,
      "interior_sq_m": 116.22073364257812,
      "property_id": "1016981fe984612a",
      "roof_material": "Asphalt",
      "roof_material_install_year": 2009
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 3260
  },
  "price_quote": false,
  "result_total": 16300,
  "time_ms": 62,
  "ui_info": {
    "city": "Calgary",
    "city_id": "6ec95b53075d062c",
    "city_link": "ca/ab/calgary",
    "city_slug": "calgary",
    "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"
  }
}