API recipes

Requests you can copy and run. Each one returns live data from the 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 runs 0 to 10, and lower means higher hazard. It reflects burned land and forest fuel around the home. A score of 2 or below marks homes where forest meets housing, for wildfire outreach and regional 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": false,
  "cost_cents": 3.15,
  "data": [
    {
      "address": "3012 Leon Road",
      "city": "Chehalis 5",
      "construction_material": "Wood",
      "construction_year": 1994,
      "estimate_list_price": 871828,
      "land_area_sq_m": 695.1935,
      "property_id": "46140e22e7d920f7",
      "roof_material": "Asphalt",
      "score_fire": 2
    },
    {
      "address": "Lot 21 1940 Ponderosa",
      "city": "Nequatque 1",
      "construction_material": "Wood",
      "construction_year": 1994,
      "estimate_list_price": 630615,
      "land_area_sq_m": 695.1935,
      "property_id": "23c8a7033ae29384",
      "roof_material": "Asphalt",
      "score_fire": 2
    },
    {
      "address": "6 9866 Pemberton Portage Road",
      "city": "Nequatque 1",
      "construction_material": "Wood",
      "construction_year": 1994,
      "estimate_list_price": 707290,
      "land_area_sq_m": 695.1935,
      "property_id": "947ad76ea0ab789",
      "roof_material": "Asphalt",
      "score_fire": 2
    },
    {
      "address": "10008 Koocha Road",
      "city": "Nequatque 1",
      "construction_material": "Wood",
      "construction_year": 1994,
      "estimate_list_price": 728993,
      "land_area_sq_m": 695.1935,
      "property_id": "b1cca606335f5c0c",
      "roof_material": "Asphalt",
      "score_fire": 2
    },
    {
      "address": "Dl 1681 Porcher Island",
      "city": "North Coast C",
      "construction_material": "Wood",
      "construction_year": 1994,
      "estimate_list_price": 617524,
      "land_area_sq_m": 14892.432,
      "property_id": "12bde41f653bc7ba",
      "roof_material": "Asphalt",
      "score_fire": 2
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 65805
  },
  "price_quote": false,
  "result_total": 329022,
  "time_ms": 72,
  "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"
  }
}