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 with recent listing price decreases

In this example, we are getting any property in Toronto that has decreased it's listing price within the last 2 months.

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

    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.28000009059906,
  "data": [
    {
      "address": "30 Fifeshire Road",
      "listings": [
        {
          "expand_estimate_list_price": 17800000,
          "expand_listing_date": "2024-04-20",
          "expand_listing_event": "price_decrease",
          "property_id": "21112beb45298961"
        }
      ],
      "property_id": "21112beb45298961"
    },
    {
      "address": "103 Malvern Avenue",
      "listings": [
        {
          "expand_estimate_list_price": 2695000,
          "expand_listing_date": "2024-03-23",
          "expand_listing_event": "price_decrease",
          "property_id": "60d7ab90855c36d4"
        }
      ],
      "property_id": "60d7ab90855c36d4"
    },
    {
      "address": "59 Angora Street",
      "listings": [
        {
          "expand_estimate_list_price": 1199900,
          "expand_listing_date": "2024-03-30",
          "expand_listing_event": "price_decrease",
          "property_id": "aeba6c9616623ce9"
        }
      ],
      "property_id": "aeba6c9616623ce9"
    },
    {
      "address": "1007 Ossington Avenue",
      "listings": [
        {
          "expand_estimate_list_price": 1589000,
          "expand_listing_date": "2024-03-31",
          "expand_listing_event": "price_decrease",
          "property_id": "be877a026938665e"
        },
        {
          "expand_estimate_list_price": 1549000,
          "expand_listing_date": "2024-04-07",
          "expand_listing_event": "price_decrease",
          "property_id": "be877a026938665e"
        }
      ],
      "property_id": "be877a026938665e"
    },
    {
      "address": "15 Valiant Road",
      "listings": [
        {
          "expand_estimate_list_price": 2750000,
          "expand_listing_date": "2024-03-23",
          "expand_listing_event": "price_decrease",
          "property_id": "29312f590b0a562e"
        },
        {
          "expand_estimate_list_price": 2650000,
          "expand_listing_date": "2024-04-01",
          "expand_listing_event": "price_decrease",
          "property_id": "29312f590b0a562e"
        }
      ],
      "property_id": "29312f590b0a562e"
    },
    {
      "address": "1918 Gerrard Street E",
      "listings": [
        {
          "expand_estimate_list_price": 1450000,
          "expand_listing_date": "2024-04-10",
          "expand_listing_event": "price_decrease",
          "property_id": "ff91935be9449b3"
        }
      ],
      "property_id": "ff91935be9449b3"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 344
  },
  "price_quote": false,
  "result_total": 2063,
  "time_ms": 388,
  "ui_info": {
    "city": "Toronto",
    "city_id": "6cdbdee2492718ed",
    "city_link": "ca/on/toronto",
    "city_slug": "toronto",
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Ontario",
    "province_abbreviation": "ON",
    "province_abbreviation_id": "146699ee774499d3",
    "province_abbreviation_link": "ca/on",
    "province_slug": "ontario"
  }
}