!

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.3300000429153442,
  "data": [
    {
      "address": "52 Cedargrove Way SW",
      "listings": [
        {
          "expand_estimate_list_price": 574900,
          "expand_listing_date": "2022-07-26",
          "expand_listing_event": "Listed",
          "property_id": "1000c277cd905d3b"
        },
        {
          "expand_estimate_list_price": 555000,
          "expand_listing_date": "2022-08-04",
          "expand_listing_event": "Price decrease",
          "property_id": "1000c277cd905d3b"
        },
        {
          "expand_estimate_list_price": 539000,
          "expand_listing_date": "2022-08-30",
          "expand_listing_event": "Price decrease",
          "property_id": "1000c277cd905d3b"
        },
        {
          "expand_estimate_list_price": 539000,
          "expand_listing_date": "2022-10-08",
          "expand_listing_event": "Unlisted",
          "property_id": "1000c277cd905d3b"
        }
      ],
      "property_id": "1000c277cd905d3b"
    },
    {
      "address": "48 Catalina Circle NE",
      "listings": [
        {
          "expand_estimate_list_price": 419900,
          "expand_listing_date": "2024-08-07",
          "expand_listing_event": "Listed",
          "property_id": "10019b3ca95ab014"
        },
        {
          "expand_estimate_list_price": 415000,
          "expand_listing_date": "2024-09-20",
          "expand_listing_event": "Price decrease",
          "property_id": "10019b3ca95ab014"
        }
      ],
      "property_id": "10019b3ca95ab014"
    },
    {
      "address": "6535 54 Street NW",
      "listings": [
        {
          "expand_estimate_list_price": 640000,
          "expand_listing_date": "2023-09-17",
          "expand_listing_event": "Listed",
          "property_id": "10030424b41ab29b"
        },
        {
          "expand_estimate_list_price": 640000,
          "expand_listing_date": "2023-10-21",
          "expand_listing_event": "Unlisted",
          "property_id": "10030424b41ab29b"
        }
      ],
      "property_id": "10030424b41ab29b"
    },
    {
      "address": "145 Valley Woods Place NW",
      "listings": [
        {
          "expand_estimate_list_price": 949000,
          "expand_listing_date": "2024-03-03",
          "expand_listing_event": "Listed",
          "property_id": "10034432c778cb03"
        },
        {
          "expand_estimate_list_price": 949000,
          "expand_listing_date": "2024-04-09",
          "expand_listing_event": "Unlisted",
          "property_id": "10034432c778cb03"
        }
      ],
      "property_id": "10034432c778cb03"
    },
    {
      "address": "2210 11 Chaparral Ridge Drive SE",
      "listings": [
        {
          "expand_estimate_list_price": 339000,
          "expand_listing_date": "2024-10-08",
          "expand_listing_event": "Listed",
          "property_id": "1003b461d5f335cf"
        }
      ],
      "property_id": "1003b461d5f335cf"
    },
    {
      "address": "1221 15 Avenue SW",
      "listings": [
        {
          "expand_estimate_list_price": 340000,
          "expand_listing_date": "2023-03-28",
          "expand_listing_event": "Listed",
          "property_id": "100451bb01e4474a"
        },
        {
          "expand_estimate_list_price": 340000,
          "expand_listing_date": "2023-05-05",
          "expand_listing_event": "Unlisted",
          "property_id": "100451bb01e4474a"
        }
      ],
      "property_id": "100451bb01e4474a"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 10342
  },
  "price_quote": false,
  "result_total": 62051,
  "time_ms": 456,
  "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"
  }
}