!

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


Retirement communities
Gets properties in areas with a high percentage of residents aged 70-74 years.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_age_70_to_74_years_percent_gt=0.1&select=demographic_age_70_to_74_years_percent,interior_sq_m,bedroom,den,bathroom_full,bathroom_half"
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('country_abbreviation', 'ca');
    url.searchParams.set('demographic_age_70_to_74_years_percent_gt', '0.1');
    url.searchParams.set('select', 'demographic_age_70_to_74_years_percent,interior_sq_m,bedroom,den,bathroom_full,bathroom_half');

    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": 4.800000190734863,
  "data": [
    {
      "address": "103 1780 Tougas Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_70_to_74_years_percent": 0.12666666507720947,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000651ea96e24c"
    },
    {
      "address": "603 2300 Broad Street",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_70_to_74_years_percent": 0.10563380271196364,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000f4dc9b58848"
    },
    {
      "address": "654 Avenue 2Ieme",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_70_to_74_years_percent": 0.11594203114509584,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10001566d02aa8b5"
    },
    {
      "address": "9 Kings Landing Priv",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_70_to_74_years_percent": 0.10476190596818924,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000368313d410c3"
    },
    {
      "address": "9 320 Cherrier Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_70_to_74_years_percent": 0.14937759935855863,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10004b7a2dc17a0b"
    },
    {
      "address": "2419 Lomond Place",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_70_to_74_years_percent": 0.15470851957798004,
      "den": 0,
      "interior_sq_m": 144.9275360107422,
      "property_id": "10004d296b85e8d6"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 153534
  },
  "price_quote": false,
  "result_total": 921200,
  "time_ms": 48,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}