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 listing history for properties

In this example, we are retrieving properties that have listing data in Calgary. Only properties with listing data will be returned when using the filter_expand_match parameter.

Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=calgary&country_abbreviation=ca&expand=listings&filter_expand_match=all&province_abbreviation=ab"
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', 'listings');
    url.searchParams.set('filter_expand_match', 'all');
    url.searchParams.set('province_abbreviation', 'ab');

    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.290000081062317,
  "data": [
    {
      "address": "319 20 Mahogany Mews SE",
      "listings": [
        {
          "expand_estimate_list_price": 399900,
          "expand_listing_date": "2023-10-06",
          "expand_listing_event": "listed",
          "property_id": "1504449f236ff8eb"
        }
      ],
      "property_id": "1504449f236ff8eb"
    },
    {
      "address": "1406 Nutana Place NW",
      "listings": [
        {
          "expand_estimate_list_price": 490000,
          "expand_listing_date": "2023-07-23",
          "expand_listing_event": "listed",
          "property_id": "d01e63434f335daf"
        }
      ],
      "property_id": "d01e63434f335daf"
    },
    {
      "address": "56 Woodglen Court SW",
      "listings": [
        {
          "expand_estimate_list_price": 369900,
          "expand_listing_date": "2022-09-14",
          "expand_listing_event": "listed",
          "property_id": "b426802726e5ef2c"
        }
      ],
      "property_id": "b426802726e5ef2c"
    },
    {
      "address": "208 2308 Center Street NE",
      "listings": [
        {
          "expand_estimate_list_price": 269000,
          "expand_listing_date": "2023-04-01",
          "expand_listing_event": "listed",
          "property_id": "2fb82cf35194fea1"
        },
        {
          "expand_estimate_list_price": 259000,
          "expand_listing_date": "2023-04-12",
          "expand_listing_event": "price_decrease",
          "property_id": "2fb82cf35194fea1"
        },
        {
          "expand_estimate_list_price": 249000,
          "expand_listing_date": "2023-05-11",
          "expand_listing_event": "price_decrease",
          "property_id": "2fb82cf35194fea1"
        },
        {
          "expand_estimate_list_price": 239900,
          "expand_listing_date": "2023-06-11",
          "expand_listing_event": "price_decrease",
          "property_id": "2fb82cf35194fea1"
        }
      ],
      "property_id": "2fb82cf35194fea1"
    },
    {
      "address": "119 MacEwan Glen Close NW",
      "listings": [
        {
          "expand_estimate_list_price": 425000,
          "expand_listing_date": "2022-06-30",
          "expand_listing_event": "listed",
          "property_id": "ebcba9c26cc43dfd"
        }
      ],
      "property_id": "ebcba9c26cc43dfd"
    },
    {
      "address": "324 Covecreek Circle NE",
      "listings": [
        {
          "expand_estimate_list_price": 339900,
          "expand_listing_date": "2023-05-10",
          "expand_listing_event": "listed",
          "property_id": "6b2948a289184764"
        }
      ],
      "property_id": "6b2948a289184764"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 7667
  },
  "price_quote": false,
  "result_total": 46001,
  "time_ms": 246,
  "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"
  }
}