This endpoint returns averages of property data for a given location. You can use this endpoint to get an overview of the property market or property features in a specific area.
This endpoint handles single and batch requests. Batch requests, which enable multiple operations with varying fields, aggregations, and filters in one go, are more efficient than multiple single requests.
This endpoint conforms to Houski API's standard filtering functionality.
To see all the fields that can be aggregated or filtered by, see the fields page.
To find data on all available location values, such as country_abbreviation, province_abbreviation, city and community, you can use the /locations endpoint.
The cost of each aggregation is 1 cent.
Name | Required | Type | Description |
---|---|---|---|
api_key | Yes | UUID v4 | Authorization API key |
field | Yes | String | The field to be aggregated - see fields for all available fields |
aggregation | Yes | String | The aggregation can be one of the following values:
|
country_abbreviation | No | String | A country abbreviation |
province_abbreviation | No | String | A province abbreviation within the country |
city | No | String | A city within the province |
community | No | String | A community within the city |
bbox_ne_lat | No | Number | Northeast latitude for bounding box. |
bbox_ne_lng | No | Number | Northeast longitude for bounding box. |
bbox_sw_lat | No | Number | Southwest latitude for bounding box. |
bbox_sw_lng | No | Number | Southwest longitude for bounding box. |
polygon | No | Polygon filter string | Get results inside a polygon. |
Type declarations are available at the bottom of this page.
Name | Type | Description |
---|---|---|
cache_hit | Boolean | Indicates if the response was a cache hit |
cost_cents | Number | Cost of the request in cents |
data | Object | Contains the data for the aggregation |
error | String | Details about the error. Empty if no error |
price_quote | Boolean | Indicates whether the response is a price quote |
time_ms | Number | Time taken for the request to complete in milliseconds |
Select the programming language you want to display the code examples in.
This request returns the median list price of properties in the Riverbend community in Calgary, Alberta, Canada.
curl -X GET "https://api.houski.ca/aggregate?aggregation=median&api_key=YOUR_API_KEY&city=calgary&community=riverbend&country_abbreviation=ca&field=estimate_list_price&province_abbreviation=ab"
const houski_get_aggregate = 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('aggregation', 'median'); url.searchParams.set('api_key', 'YOUR_API_KEY'); url.searchParams.set('city', 'calgary'); url.searchParams.set('community', 'riverbend'); url.searchParams.set('country_abbreviation', 'ca'); url.searchParams.set('field', 'estimate_list_price'); url.searchParams.set('province_abbreviation', 'ab'); const response = await fetch(url); const data = await response.json(); return data; } (async () => { let data: AggregateResponse = await houski_get_aggregate(); // Log the response console.log(data); })();
{ "cache_hit": true, "cost_cents": 1.0, "data": [ { "aggregation": "median", "field": "estimate_list_price", "value": "652608" } ], "error": "", "price_quote": false, "time_ms": 13 }
This request performs multiple aggregate operations batched together.
curl -X GET "https://api.houski.ca/aggregate?agg0_aggregation=sum&agg0_city=edmonton&agg0_country_abbreviation=ca&agg0_field=bedroom&agg0_property_type_eq=Apartment&agg0_province_abbreviation=ab&agg1_aggregation=median&agg1_city=calgary&agg1_country_abbreviation=ca&agg1_field=estimate_list_price&agg1_property_type_eq=House&agg1_province_abbreviation=ab&agg2_aggregation=mode&agg2_field=kitchen_countertop_material&agg2_polygon=51.0447_-114.0719,51.0452_-114.0719,51.0452_-114.073,51.0447_-114.073&agg2_property_type_eq=House&agg3_aggregation=mean&agg3_bbox_ne_lat=51.1005&agg3_bbox_ne_lng=-113.508&agg3_bbox_sw_lat=50.6668&agg3_bbox_sw_lng=-114.4593&agg3_field=estimate_rent_monthly&api_key=YOUR_API_KEY"
const houski_get_aggregate = 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', 'sum'); url.searchParams.set('agg0_city', 'edmonton'); url.searchParams.set('agg0_country_abbreviation', 'ca'); url.searchParams.set('agg0_field', 'bedroom'); url.searchParams.set('agg0_property_type_eq', 'Apartment'); url.searchParams.set('agg0_province_abbreviation', 'ab'); url.searchParams.set('agg1_aggregation', 'median'); url.searchParams.set('agg1_city', 'calgary'); url.searchParams.set('agg1_country_abbreviation', 'ca'); url.searchParams.set('agg1_field', 'estimate_list_price'); url.searchParams.set('agg1_property_type_eq', 'House'); url.searchParams.set('agg1_province_abbreviation', 'ab'); url.searchParams.set('agg2_aggregation', 'mode'); url.searchParams.set('agg2_field', 'kitchen_countertop_material'); url.searchParams.set('agg2_polygon', '51.0447_-114.0719,51.0452_-114.0719,51.0452_-114.073,51.0447_-114.073'); url.searchParams.set('agg2_property_type_eq', 'House'); url.searchParams.set('agg3_aggregation', 'mean'); url.searchParams.set('agg3_bbox_ne_lat', '51.1005'); url.searchParams.set('agg3_bbox_ne_lng', '-113.508'); url.searchParams.set('agg3_bbox_sw_lat', '50.6668'); url.searchParams.set('agg3_bbox_sw_lng', '-114.4593'); url.searchParams.set('agg3_field', 'estimate_rent_monthly'); 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_get_aggregate(); // Log the response console.log(data); })();
{ "cache_hit": false, "cost_cents": 4.0, "data": [ { "aggregation": "sum", "field": "bedroom", "value": "62967" }, { "aggregation": "median", "field": "estimate_list_price", "value": "688777" }, { "aggregation": "mode", "field": "kitchen_countertop_material", "value": "Quartz" }, { "aggregation": "mean", "field": "estimate_rent_monthly", "value": "2455.612" } ], "error": "", "price_quote": false, "time_ms": 126 }
interface AggregateResponse { cache_hit: boolean; cost_cents: number; data: AggregateData[]; error: string; price_quote: boolean; time_ms: number; } interface AggregateData { field: string; aggregation: string; value: string; }