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&city=waterloo&country_abbreviation=ca&demographic_age_20_to_24_years_percent_gt=0.12&page=1&property_type_eq=Apartment&province_abbreviation=on&results_per_page=5&select=address,demographic_age_20_to_24_years_percent,demographic_age_25_to_29_years_percent,estimate_rent_monthly,bedroom_total,interior_sq_m,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('city', 'waterloo');
url.searchParams.set('country_abbreviation', 'ca');
url.searchParams.set('demographic_age_20_to_24_years_percent_gt', '0.12');
url.searchParams.set('page', '1');
url.searchParams.set('property_type_eq', 'Apartment');
url.searchParams.set('province_abbreviation', 'on');
url.searchParams.set('results_per_page', '5');
url.searchParams.set('select', 'address,demographic_age_20_to_24_years_percent,demographic_age_25_to_29_years_percent,estimate_rent_monthly,bedroom_total,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);
})();
{
"cache_hit": false,
"cost_cents": 3.0999999046325684,
"data": [
{
"address": "309 265 Westcourt Place",
"bedroom_total": 1,
"demographic_age_20_to_24_years_percent": 0.1599999964237213,
"demographic_age_25_to_29_years_percent": 0.15636363625526428,
"estimate_list_price": 334350,
"estimate_rent_monthly": 1847,
"interior_sq_m": 83.51913452148438,
"property_id": "100836a77874260b"
},
{
"address": "701 65 Westmount Road N",
"bedroom_total": 4,
"demographic_age_20_to_24_years_percent": 0.1599999964237213,
"demographic_age_25_to_29_years_percent": 0.15636363625526428,
"estimate_list_price": 327238,
"estimate_rent_monthly": 2100,
"interior_sq_m": 106.83760833740234,
"property_id": "100b6b1c78c67f99"
},
{
"address": "305 375 King Street N",
"bedroom_total": 4,
"demographic_age_20_to_24_years_percent": 0.13821138441562653,
"demographic_age_25_to_29_years_percent": 0.13008129596710205,
"estimate_list_price": 389429,
"estimate_rent_monthly": 2597,
"interior_sq_m": 139.260498046875,
"property_id": "101fb2e830e7d6fd"
},
{
"address": "Ph B-25 Westmount Road N",
"bedroom_total": 4,
"demographic_age_20_to_24_years_percent": 0.1599999964237213,
"demographic_age_25_to_29_years_percent": 0.15636363625526428,
"estimate_list_price": 416840,
"estimate_rent_monthly": 2245,
"interior_sq_m": 106.83760833740234,
"property_id": "103c2cacd08886d9"
},
{
"address": "1106 258A Sunview Street",
"bedroom_total": 2,
"demographic_age_20_to_24_years_percent": 0.4669509530067444,
"demographic_age_25_to_29_years_percent": 0.23240938782691956,
"estimate_list_price": 330388,
"estimate_rent_monthly": 1858,
"interior_sq_m": 139.260498046875,
"property_id": "108d2155f7b27bae"
}
],
"error": "",
"pagination": {
"current_page": 1,
"has_next_page": true,
"has_previous_page": false,
"page_total": 522
},
"price_quote": false,
"result_total": 2607,
"time_ms": 100,
"ui_info": {
"city": "Waterloo",
"city_id": "7bed79bd139816fa",
"city_link": "ca/on/waterloo",
"city_slug": "waterloo",
"country": "Canada",
"country_abbreviation": "CA",
"country_abbreviation_id": "9ace2b6431b7f1be",
"country_abbreviation_link": "ca",
"country_slug": "canada",
"province": "Ontario",
"province_abbreviation": "ON",
"province_abbreviation_id": "146699ee774499d3",
"province_abbreviation_link": "ca/on",
"province_slug": "ontario"
}
}