!

API recipes

Practical examples for using the Houski API.

Examples

Find basement homes in high flood risk zones

Programming language

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

Find basement homes in high flood risk zones
Combine basement_type with flood risk score (0-10, where 0-1 is highest-risk) to surface at-risk properties. Useful for waterproofing contractors, sump pump installers, and flood insurance underwriting.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&basement_type_neq=None&city=winnipeg&country_abbreviation=ca&page=1&property_type_in=House,Townhouse&province_abbreviation=mb&results_per_page=5&score_flood_lte=1&select=address,basement_type,foundation_type,score_flood,floor_below_ground,construction_year,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('basement_type_neq', 'None');
    url.searchParams.set('city', 'winnipeg');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('page', '1');
    url.searchParams.set('property_type_in', 'House,Townhouse');
    url.searchParams.set('province_abbreviation', 'mb');
    url.searchParams.set('results_per_page', '5');
    url.searchParams.set('score_flood_lte', '1');
    url.searchParams.set('select', 'address,basement_type,foundation_type,score_flood,floor_below_ground,construction_year,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.0999999046325684,
  "data": [
    {
      "address": "2 Carriage House Road",
      "basement_type": "Full",
      "construction_year": 1985,
      "estimate_list_price": 417701,
      "floor_below_ground": 1,
      "foundation_type": "Pile",
      "property_id": "100107810a99e2c2",
      "score_flood": 1
    },
    {
      "address": "101 123 Sutherland Avenue",
      "basement_type": "Full",
      "construction_year": 1977,
      "estimate_list_price": 114236,
      "floor_below_ground": 1,
      "foundation_type": "Pile",
      "property_id": "10010f5c401bb1f1",
      "score_flood": 0
    },
    {
      "address": "116 Bluewater Crescent",
      "basement_type": "Full",
      "construction_year": 1971,
      "estimate_list_price": 350558,
      "floor_below_ground": 1,
      "foundation_type": "Pile",
      "property_id": "100181c9a70f87ac",
      "score_flood": 1
    },
    {
      "address": "49 Tackaberry Way",
      "basement_type": "Full",
      "construction_year": 2017,
      "estimate_list_price": 613648,
      "floor_below_ground": 1,
      "foundation_type": "Pile",
      "property_id": "1001b6f90c6a43bc",
      "score_flood": 1
    },
    {
      "address": "1206 Rothesay Street",
      "basement_type": "Full",
      "construction_year": 1977,
      "estimate_list_price": 382357,
      "floor_below_ground": 1,
      "foundation_type": "Pile",
      "property_id": "1001c3814dcd9961",
      "score_flood": 1
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 28721
  },
  "price_quote": false,
  "result_total": 143604,
  "time_ms": 87,
  "ui_info": {
    "city": "Winnipeg",
    "city_id": "d1aab9c3a544b7b6",
    "city_link": "ca/mb/winnipeg",
    "city_slug": "winnipeg",
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Manitoba",
    "province_abbreviation": "MB",
    "province_abbreviation_id": "cbb58e256d8f6973",
    "province_abbreviation_link": "ca/mb",
    "province_slug": "manitoba"
  }
}