Practical examples for using the Houski API.
Select the programming language you want to display the code examples in.
curl -X GET "https://api.houski.ca/aggregate?agg0_aggregation=median&agg0_city=vancouver&agg0_country_abbreviation=ca&agg0_field=estimate_list_price&agg0_province_abbreviation=bc&agg1_aggregation=median&agg1_city=victoria&agg1_country_abbreviation=ca&agg1_field=estimate_list_price&agg1_province_abbreviation=bc&api_key=YOUR_API_KEY"
const houski_recipe_data = async (): Promise<AggregateResponse> => {
// You must copy the AggregateResponse type declarations from the
// Houski API documentation to strongly type the response
const url = new URL('https://api.houski.ca/aggregate');
url.searchParams.set('agg0_aggregation', 'median');
url.searchParams.set('agg0_city', 'vancouver');
url.searchParams.set('agg0_country_abbreviation', 'ca');
url.searchParams.set('agg0_field', 'estimate_list_price');
url.searchParams.set('agg0_province_abbreviation', 'bc');
url.searchParams.set('agg1_aggregation', 'median');
url.searchParams.set('agg1_city', 'victoria');
url.searchParams.set('agg1_country_abbreviation', 'ca');
url.searchParams.set('agg1_field', 'estimate_list_price');
url.searchParams.set('agg1_province_abbreviation', 'bc');
url.searchParams.set('api_key', 'YOUR_API_KEY');
const response = await fetch(url);
const data = await response.json();
return data;
}
(async () => {
let data: AggregateResponse = await houski_recipe_data();
// Log the response
console.log(data);
})();
{
"cache_hit": false,
"cost_cents": 2.0,
"data": [
{
"aggregation": "median",
"field": "estimate_list_price",
"value": "1419363"
},
{
"aggregation": "median",
"field": "estimate_list_price",
"value": "822159"
}
],
"error": "",
"price_quote": false,
"time_ms": 55
}