Sorting

The properties, geocoding, and map endpoints let you sort results by one field.

Sorting does not add to your bill.

Sort by adding query parameters. To sort the properties endpoint by estimated list price, use either:

SortTypeExample
Sort lowest to highestascestimate_list_price_sort=asc
Sort highest to lowestdescestimate_list_price_sort=desc
Programming language

Select the programming language you want to display the code examples in.

Sorting by estimated list price
Request
Shell session
curl -X GET "http://127.0.0.1:8080/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&estimate_list_price_sort=asc&page=1&province_abbreviation=ab&results_per_page=3&select=estimate_list_price"
TypeScript code
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('http://127.0.0.1:8080/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('page', '1');
    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);
})();
Response
JSON
{
  "cache_hit": false,
  "cost_cents": 0.35999998450279236,
  "data": [
    {
      "address": "19 De Havilland Boulevard SW",
      "estimate_list_price": 40546,
      "property_id": "eb1d39109dc9d2b0"
    },
    {
      "address": "32 422 55 Street",
      "estimate_list_price": 45921,
      "property_id": "d43ab1cdf3a54a31"
    },
    {
      "address": "119 Anson Avenue SW",
      "estimate_list_price": 46935,
      "property_id": "e20c9156270fb0fe"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 818417
  },
  "price_quote": false,
  "result_total": 2455250,
  "time_ms": 272,
  "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"
  }
}