!

API recipes

Practical examples for using the Houski API.

Examples

Find homes in the wildland-urban interface

Programming language

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

Find homes in the wildland-urban interface
Fire score (0-10, lower is higher risk) is built from Canadian National Fire Database point data across 42,000+ grid cells. Score 2 or below sits in the wildland-urban interface where boreal forest meets housing - critical for FireSmart outreach and regional wildfire insurance pricing.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&page=1&property_type_in=House,Townhouse&province_abbreviation=bc&results_per_page=5&score_fire_lte=2&select=address,city,score_fire,construction_material,roof_material,construction_year,land_area_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('country_abbreviation', 'ca');
    url.searchParams.set('page', '1');
    url.searchParams.set('property_type_in', 'House,Townhouse');
    url.searchParams.set('province_abbreviation', 'bc');
    url.searchParams.set('results_per_page', '5');
    url.searchParams.set('score_fire_lte', '2');
    url.searchParams.set('select', 'address,city,score_fire,construction_material,roof_material,construction_year,land_area_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": true,
  "cost_cents": 3.1500000953674316,
  "data": [
    {
      "address": "A 1611 South Lakeside Drive",
      "city": "Williams Lake",
      "construction_material": "Concrete",
      "construction_year": 1956,
      "estimate_list_price": 363488,
      "land_area_sq_m": 805.7481079101562,
      "property_id": "10002337134a67c6",
      "roof_material": "Asphalt",
      "score_fire": 0
    },
    {
      "address": "276 Cochrane Road",
      "city": "Gibsons",
      "construction_material": "Concrete",
      "construction_year": 1973,
      "estimate_list_price": 766704,
      "land_area_sq_m": 929.0698852539062,
      "property_id": "10004ed6b27583da",
      "roof_material": "Metal",
      "score_fire": 1
    },
    {
      "address": "7850 Nixon Road",
      "city": "Chilliwack",
      "construction_material": "Wood",
      "construction_year": 1994,
      "estimate_list_price": 1534441,
      "land_area_sq_m": 743.2239990234375,
      "property_id": "100053f16c7b9136",
      "roof_material": "Concrete",
      "score_fire": 0
    },
    {
      "address": "71797 Meadow Road",
      "city": "Fraser Valley B",
      "construction_material": "Concrete",
      "construction_year": 2008,
      "estimate_list_price": 398959,
      "land_area_sq_m": 668.9019165039062,
      "property_id": "10005b197d2f0249",
      "roof_material": "Metal",
      "score_fire": 0
    },
    {
      "address": "2880 Panorama Drive 129",
      "city": "Coquitlam",
      "construction_material": "Concrete",
      "construction_year": 1992,
      "estimate_list_price": 1127538,
      "land_area_sq_m": 230670.71875,
      "property_id": "10005c293f0f8846",
      "roof_material": "Concrete",
      "score_fire": 1
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 120163
  },
  "price_quote": false,
  "result_total": 600814,
  "time_ms": 98,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "British Columbia",
    "province_abbreviation": "BC",
    "province_abbreviation_id": "84b27e64bc119a2",
    "province_abbreviation_link": "ca/bc",
    "province_slug": "british_columbia"
  }
}