Practical examples for using the Houski API.
Select the programming language you want to display the code examples in.
curl -X GET "http://127.0.0.1:8080/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&page=1&province_abbreviation=bc&results_per_page=5&score_fire_lte=2&score_flood_lte=1&select=address,city,score_flood,score_fire,score_earthquake,construction_year,foundation_type,estimate_list_price"
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('http://127.0.0.1:8080/properties');
url.searchParams.set('api_key', 'YOUR_API_KEY');
url.searchParams.set('country_abbreviation', 'ca');
url.searchParams.set('page', '1');
url.searchParams.set('province_abbreviation', 'bc');
url.searchParams.set('results_per_page', '5');
url.searchParams.set('score_fire_lte', '2');
url.searchParams.set('score_flood_lte', '1');
url.searchParams.set('select', 'address,city,score_flood,score_fire,score_earthquake,construction_year,foundation_type,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);
})();
{
"cache_hit": false,
"cost_cents": 3.1500000953674316,
"data": [
{
"address": "1245 Little Shuswap Lake Road W",
"city": "Quaaout 1",
"construction_year": 2008,
"estimate_list_price": 314858,
"foundation_type": "Poured concrete",
"property_id": "100273c20fc6378e",
"score_earthquake": 8,
"score_fire": 2,
"score_flood": 1
},
{
"address": "8035 Ryan Creek Road",
"city": "Squamish-Lillooet C",
"construction_year": 2008,
"estimate_list_price": 2236358,
"foundation_type": "Poured concrete",
"property_id": "10057aa14f861d70",
"score_earthquake": 4,
"score_fire": 2,
"score_flood": 1
},
{
"address": "4127 Squilax-Anglemont Road",
"city": "Columbia-Shuswap F",
"construction_year": 2008,
"estimate_list_price": 526753,
"foundation_type": "Poured concrete",
"property_id": "10062ebc7c4dc078",
"score_earthquake": 7,
"score_fire": 2,
"score_flood": 1
},
{
"address": "4731 73 Avenue NE",
"city": "Salmon Arm",
"construction_year": 2004,
"estimate_list_price": 590529,
"foundation_type": "Poured concrete",
"property_id": "1008710d31d91123",
"score_earthquake": 7,
"score_fire": 2,
"score_flood": 1
},
{
"address": "176 1 Avenue",
"city": "Cultus Lake North",
"construction_year": 2008,
"estimate_list_price": 1162566,
"foundation_type": "Poured concrete",
"property_id": "100a5821451da1a4",
"score_earthquake": 6,
"score_fire": 2,
"score_flood": 1
}
],
"error": "",
"pagination": {
"current_page": 1,
"has_next_page": true,
"has_previous_page": false,
"page_total": 4150
},
"price_quote": false,
"result_total": 20747,
"time_ms": 100,
"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"
}
}