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 recent listings in specific city communities

In this example, we are retrieving houses that have been listed within the last 60 days in the communities of Riverbend and McKenzie Towne in Calgary. Community names must be capitalized and spelled correctly to work. Our location endpoint can deliver location data for communities in a city, if you need to ensure they all formatted correctly.

Setting 'filter_expand_match=all' ensures we only return properties that have listing 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&community_in=Riverbend,McKenzie Towne&country_abbreviation=ca&expand=listings&expand_listing_date_gt=2024-03-17&filter_expand_match=all&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('community_in', 'Riverbend,McKenzie Towne');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('expand', 'listings');
    url.searchParams.set('expand_listing_date_gt', '2024-03-17');
    url.searchParams.set('filter_expand_match', 'all');
    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": "67 Prestwick Acres Lane SE",
      "community": "McKenzie Towne",
      "interior_sq_m": 110.74037170410156,
      "latitude": 50.92319869995117,
      "listings": [
        {
          "expand_estimate_list_price": 390000,
          "expand_listing_date": "2024-04-08",
          "expand_listing_event": "listed",
          "property_id": "280ddf3b50a77f6e"
        }
      ],
      "longitude": -113.95973205566406,
      "property_id": "280ddf3b50a77f6e"
    },
    {
      "address": "15187 Prestwick Boulevard SE",
      "community": "McKenzie Towne",
      "interior_sq_m": 149.88040161132812,
      "latitude": 50.91970443725586,
      "listings": [
        {
          "expand_estimate_list_price": 650000,
          "expand_listing_date": "2024-04-04",
          "expand_listing_event": "listed",
          "property_id": "130e7398d504191b"
        }
      ],
      "longitude": -113.96636962890624,
      "property_id": "130e7398d504191b"
    },
    {
      "address": "253 Elgin Meadows Park SE",
      "community": "McKenzie Towne",
      "interior_sq_m": 119.17130279541016,
      "latitude": 50.90995407104492,
      "listings": [
        {
          "expand_estimate_list_price": 499900,
          "expand_listing_date": "2024-04-16",
          "expand_listing_event": "listed",
          "property_id": "b5e5e4401098fcb9"
        }
      ],
      "longitude": -113.9501953125,
      "property_id": "b5e5e4401098fcb9"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 18
  },
  "price_quote": false,
  "result_total": 53,
  "time_ms": 363,
  "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"
  }
}