!

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 its 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-09-22&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-09-22');
    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": 0.0,
  "data": [],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": false,
    "has_previous_page": false,
    "page_total": 1
  },
  "price_quote": false,
  "result_total": 0,
  "time_ms": 123,
  "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"
  }
}