!

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 investment calculations
You can retrieve detailed information on many properties in Canada. This example shows retrieving specific information on a property - just the number of bedrooms and bathrooms. Every property has hundreds of fields of information available.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=calgary&country_abbreviation=ca&estimate_rent_monthly_gt=1&province_abbreviation=ab&results_per_page=3&select=cash_on_cash_return,return_on_investment,cap_rate"
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('estimate_rent_monthly_gt', '1');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');
    url.searchParams.set('select', 'cash_on_cash_return,return_on_investment,cap_rate');

    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.5,
  "data": [
    {
      "address": "31 Hawkside Park NW",
      "cap_rate": 0.040373340249061584,
      "cash_on_cash_return": -0.04788467660546303,
      "property_id": "10000f97f5cb7b9f",
      "return_on_investment": 0.3693802058696747
    },
    {
      "address": "6 1744 7 Street SW",
      "cap_rate": 0.006389960180968046,
      "cash_on_cash_return": -0.18381817638874057,
      "property_id": "10004f7afe0c1946",
      "return_on_investment": -0.17570988833904266
    },
    {
      "address": "384 Copperpond Landng SE",
      "cap_rate": 0.020525163039565086,
      "cash_on_cash_return": -0.12727738916873932,
      "property_id": "10007f9761f49940",
      "return_on_investment": 0.051017384976148605
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 213839
  },
  "price_quote": false,
  "result_total": 641515,
  "time_ms": 107,
  "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"
  }
}