!

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


Pre-retirement age concentration
Gets properties in areas with a high percentage of pre-retirement age residents (55-64 years).
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_age_55_to_59_years_percent_gt=0.1&demographic_income_median_pre_tax_gt=60000&select=demographic_age_55_to_59_years_percent,demographic_income_median_pre_tax,demographic_income_median_after_tax,demographic_household_type_family_without_children_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_55_to_59_years_percent_gt', '0.1');
    url.searchParams.set('demographic_income_median_pre_tax_gt', '60000');
    url.searchParams.set('select', 'demographic_age_55_to_59_years_percent,demographic_income_median_pre_tax,demographic_income_median_after_tax,demographic_household_type_family_without_children_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": 6.600000858306885,
  "data": [
    {
      "address": "18 Griffen Place",
      "bathroom_full": 2,
      "bathroom_half": 1,
      "bedroom": 3,
      "demographic_age_55_to_59_years_percent": 0.1111111119389534,
      "demographic_household_type_family_without_children_percent": 0.25,
      "demographic_income_median_after_tax": 54252,
      "demographic_income_median_pre_tax": 62143,
      "den": 0,
      "interior_sq_m": 139.260498046875,
      "property_id": "10002659edbb02b9"
    },
    {
      "address": "9 Kings Landing Priv",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_55_to_59_years_percent": 0.10476190596818924,
      "demographic_household_type_family_without_children_percent": 0.4545454680919647,
      "demographic_income_median_after_tax": 78418,
      "demographic_income_median_pre_tax": 93708,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000368313d410c3"
    },
    {
      "address": "880 Avenue 40E",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_55_to_59_years_percent": 0.10071942210197447,
      "demographic_household_type_family_without_children_percent": 0.3191489279270172,
      "demographic_income_median_after_tax": 58197,
      "demographic_income_median_pre_tax": 69541,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "100050c3d2e1721f"
    },
    {
      "address": "1698 Ira Morgan Way",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_55_to_59_years_percent": 0.1149425283074379,
      "demographic_household_type_family_without_children_percent": 0.38181817531585693,
      "demographic_income_median_after_tax": 69048,
      "demographic_income_median_pre_tax": 80761,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "100052ea37da91c7"
    },
    {
      "address": "533 Stirling Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_55_to_59_years_percent": 0.12087912112474442,
      "demographic_household_type_family_without_children_percent": 0.44117647409439087,
      "demographic_income_median_after_tax": 56718,
      "demographic_income_median_pre_tax": 68061,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000cbf6534360c9"
    },
    {
      "address": "204 Granite Hill Road",
      "bathroom_full": 3,
      "bathroom_half": 1,
      "bedroom": 4,
      "demographic_age_55_to_59_years_percent": 0.10320284962654114,
      "demographic_household_type_family_without_children_percent": 0.29729729890823364,
      "demographic_income_median_after_tax": 56224,
      "demographic_income_median_pre_tax": 65102,
      "den": 0,
      "interior_sq_m": 281.3544921875,
      "property_id": "10012d0d5141d2ef"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 56058
  },
  "price_quote": false,
  "result_total": 336347,
  "time_ms": 556,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}