Most of the endpoints on the Houski API allow you to sort the data returned by the API by a field.
There is no additional cost for sorting the data returned by the Houski API.
Sorting is performed by adding query parameters to the request URL. For example, to sort the properties returned by the properties endpoint by the estimated list price field, you can do either of the following:
Sort | Type | Example |
---|---|---|
Sort lowest to highest | asc | estimate_list_price_sort=asc |
Sort highest to lowest | desc | estimate_list_price_sort=desc |
Select the programming language you want to display the code examples in.
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&estimate_list_price_sort=asc&province_abbreviation=ab&results_per_page=3&select=estimate_list_price"
const houski_properties_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('https://api.houski.ca/properties'); url.searchParams.set('api_key', 'YOUR_API_KEY'); url.searchParams.set('country_abbreviation', 'ca'); url.searchParams.set('estimate_list_price_sort', 'asc'); url.searchParams.set('province_abbreviation', 'ab'); url.searchParams.set('results_per_page', '3'); url.searchParams.set('select', 'estimate_list_price'); const response = await fetch(url); const data = await response.json(); return data; } (async () => { let data: PropertiesResponse = await houski_properties_data(); // Log the response console.log(data); })();
{ "cache_hit": true, "cost_cents": 0.9000000357627869, "data": [ { "address": "Lot 20 930 Creekside Drive W", "estimate_list_price": 185116, "property_id": "ce6a3ae8dd2f632d" }, { "address": "Lot 5 908 Creekside Drive W", "estimate_list_price": 185116, "property_id": "93f2ec26003110ad" }, { "address": "Lot 18 926 Creekside Drive W", "estimate_list_price": 185116, "property_id": "d33ca237ef5e0c6f" } ], "error": "", "pagination": { "current_page": 1, "has_next_page": true, "has_previous_page": false, "page_total": 514245 }, "price_quote": false, "result_total": 1542734, "time_ms": 150, "ui_info": { "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" } }