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&cap_rate_sort=desc&city=calgary&country_abbreviation=ca&for_sale_eq=true&page=1&property_type_eq=House&province_abbreviation=ab&results_per_page=3&select=for_sale,cash_on_cash_return,return_on_investment,cap_rate"
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('cap_rate_sort', 'desc');
url.searchParams.set('city', 'calgary');
url.searchParams.set('country_abbreviation', 'ca');
url.searchParams.set('for_sale_eq', 'true');
url.searchParams.set('page', '1');
url.searchParams.set('property_type_eq', 'House');
url.searchParams.set('province_abbreviation', 'ab');
url.searchParams.set('results_per_page', '3');
url.searchParams.set('select', 'for_sale,cash_on_cash_return,return_on_investment,cap_rate');
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": 1.2599999904632568,
"data": [
{
"address": "3 1702 35 Street SE",
"cap_rate": 0.10559982806444168,
"cash_on_cash_return": 0.2130212634801865,
"for_sale": true,
"property_id": "c82eeb5f2456d143",
"return_on_investment": 1.4156068563461304
},
{
"address": "1110 130 Panatella Street NW",
"cap_rate": 0.10080432146787643,
"cash_on_cash_return": 0.1938391923904419,
"for_sale": true,
"property_id": "af6aed78471559",
"return_on_investment": 1.3386870622634888
},
{
"address": "2304 1317 27 Street SE",
"cap_rate": 0.09852644056081772,
"cash_on_cash_return": 0.1847277134656906,
"for_sale": true,
"property_id": "2c3df22c6058b660",
"return_on_investment": 1.3021503686904907
}
],
"error": "",
"pagination": {
"current_page": 1,
"has_next_page": true,
"has_previous_page": false,
"page_total": 1013
},
"price_quote": false,
"result_total": 3039,
"time_ms": 2976,
"ui_info": {
"city": "Calgary",
"city_id": "6ec95b53075d062c",
"city_link": "ca/ab/calgary",
"city_slug": "calgary",
"country": "Canada",
"country_abbreviation": "CA",
"country_abbreviation_id": "9ace2b6431b7f1be",
"country_abbreviation_link": "ca",
"country_slug": "canada",
"province": "Alberta",
"province_abbreviation": "AB",
"province_abbreviation_id": "aae1f05a0f89d2c7",
"province_abbreviation_link": "ca/ab",
"province_slug": "alberta"
}
}