Requests you can copy and run. Each one returns live data from the API.
A request that selects a field with a source column carries exclude=inferred, which leaves out the values Houski worked out, unless it looks up one named property. Remove it to get those values too.
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=toronto&agg0_country_abbreviation=ca&agg0_field=estimate_sale_price_per_sq_m&agg0_province_abbreviation=on&agg1_aggregation=median&agg1_city=manchester&agg1_country_abbreviation=gb&agg1_field=estimate_sale_price_per_sq_m&agg1_province_abbreviation=eng&agg2_aggregation=median&agg2_city=paris&agg2_country_abbreviation=fr&agg2_field=estimate_sale_price_per_sq_m&agg2_province_abbreviation=idf&agg3_aggregation=median&agg3_city=madrid&agg3_country_abbreviation=es&agg3_field=estimate_sale_price_per_sq_m&agg3_province_abbreviation=mad&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', 'toronto');
url.searchParams.set('agg0_country_abbreviation', 'ca');
url.searchParams.set('agg0_field', 'estimate_sale_price_per_sq_m');
url.searchParams.set('agg0_province_abbreviation', 'on');
url.searchParams.set('agg1_aggregation', 'median');
url.searchParams.set('agg1_city', 'manchester');
url.searchParams.set('agg1_country_abbreviation', 'gb');
url.searchParams.set('agg1_field', 'estimate_sale_price_per_sq_m');
url.searchParams.set('agg1_province_abbreviation', 'eng');
url.searchParams.set('agg2_aggregation', 'median');
url.searchParams.set('agg2_city', 'paris');
url.searchParams.set('agg2_country_abbreviation', 'fr');
url.searchParams.set('agg2_field', 'estimate_sale_price_per_sq_m');
url.searchParams.set('agg2_province_abbreviation', 'idf');
url.searchParams.set('agg3_aggregation', 'median');
url.searchParams.set('agg3_city', 'madrid');
url.searchParams.set('agg3_country_abbreviation', 'es');
url.searchParams.set('agg3_field', 'estimate_sale_price_per_sq_m');
url.searchParams.set('agg3_province_abbreviation', 'mad');
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": true,
"cost_cents": 4.0,
"data": [
{
"aggregation": "median",
"field": "estimate_sale_price_per_sq_m",
"value": "8008.718"
},
{
"aggregation": "median",
"field": "estimate_sale_price_per_sq_m",
"value": "2946.247"
},
{
"aggregation": "median",
"field": "estimate_sale_price_per_sq_m",
"value": "12013.910"
},
{
"aggregation": "median",
"field": "estimate_sale_price_per_sq_m",
"value": "3747.546"
}
],
"error": "",
"price_quote": false,
"time_ms": 38
}