!

Recipes

This page contains examples of common use cases for the Houski API.

You can copy and paste the code examples into your own application.

Programming language

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

Choose a recipe


Get properties assessed between a range of values
In this example, we are retrieving houses that have been assessed between $500,000 and $600,000 in Calgary, for the year 2023. Setting 'filter_expand_match=all' ensures we only return properties that have assessment data. We are also selecting some fields for each property - the latitude, longitude, community, and the size of the interior in square meters. We are then limiting the results per each page to 3.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=calgary&country_abbreviation=ca&expand=assessments&expand_assessment_value_gte=500000&expand_assessment_value_lte=600000&expand_assessment_year_eq=2023&filter_expand_match=all&property_type_eq=House&province_abbreviation=ab&results_per_page=3&select=latitude,longitude,community,interior_sq_m"
TypeScript code
const houski_recipe_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('city', 'calgary');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('expand', 'assessments');
    url.searchParams.set('expand_assessment_value_gte', '500000');
    url.searchParams.set('expand_assessment_value_lte', '600000');
    url.searchParams.set('expand_assessment_year_eq', '2023');
    url.searchParams.set('filter_expand_match', 'all');
    url.searchParams.set('property_type_eq', 'House');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');
    url.searchParams.set('select', 'latitude,longitude,community,interior_sq_m');

    const response = await fetch(url);
    const data = await response.json();

    return data;
}

(async () => {
let data: PropertiesResponse = await houski_recipe_data();

// Log the response
console.log(data);
})();
Response
JSON
{
  "cache_hit": false,
  "cost_cents": 1.830000042915344,
  "data": [
    {
      "address": "7237 California Boulevard NE",
      "assessments": [
        {
          "expand_assessment_value": 509000,
          "expand_assessment_year": 2023,
          "property_id": "1001392d95458fc1"
        }
      ],
      "community": "Monterey Park",
      "interior_sq_m": 188.5934600830078,
      "latitude": 51.07605743408203,
      "longitude": -113.92583465576172,
      "property_id": "1001392d95458fc1"
    },
    {
      "address": "168 Coventry Hills Drive NE",
      "assessments": [
        {
          "expand_assessment_value": 545500,
          "expand_assessment_year": 2023,
          "property_id": "1002285fe3ee9c49"
        }
      ],
      "community": "Coventry Hills",
      "interior_sq_m": 177.1646270751953,
      "latitude": 51.16413879394531,
      "longitude": -114.06744384765624,
      "property_id": "1002285fe3ee9c49"
    },
    {
      "address": "61 Rivergreen Crescent SE",
      "assessments": [
        {
          "expand_assessment_value": 525500,
          "expand_assessment_year": 2023,
          "property_id": "1004738a9262a70d"
        }
      ],
      "community": "Riverbend",
      "interior_sq_m": 165.8955841064453,
      "latitude": 50.97532653808594,
      "longitude": -114.02058410644533,
      "property_id": "1004738a9262a70d"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 18289
  },
  "price_quote": false,
  "result_total": 54866,
  "time_ms": 205,
  "ui_info": {
    "city": "Calgary",
    "city_id": "6ec95b53075d062c",
    "city_link": "ca/ab/calgary",
    "city_slug": "calgary",
    "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"
  }
}