!

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


Young single professional hotspots
Gets areas with high concentration of young single professionals.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_age_25_to_29_years_percent_gte=0.15&demographic_marital_status_single_percent_gte=0.14&select=demographic_age_25_to_29_years_percent,demographic_marital_status_single_percent,demographic_employment_industries_professional_scientific_and_technical_services_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_25_to_29_years_percent_gte', '0.15');
    url.searchParams.set('demographic_marital_status_single_percent_gte', '0.14');
    url.searchParams.set('select', 'demographic_age_25_to_29_years_percent,demographic_marital_status_single_percent,demographic_employment_industries_professional_scientific_and_technical_services_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.000000953674316,
  "data": [
    {
      "address": "41 2202 Rosemont Boulevard",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_25_to_29_years_percent": 0.16438356041908264,
      "demographic_employment_industries_professional_scientific_and_technical_services_percent": 0.17543859779834747,
      "demographic_marital_status_single_percent": 0.5891472697257996,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000874d2ccb6ea"
    },
    {
      "address": "2202 62 Forest Manor Road",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 1,
      "demographic_age_25_to_29_years_percent": 0.19224806129932404,
      "demographic_employment_industries_professional_scientific_and_technical_services_percent": 0.2071611285209656,
      "demographic_marital_status_single_percent": 0.454382836818695,
      "den": 1,
      "interior_sq_m": 74.22891235351562,
      "property_id": "10000a939ca95e87"
    },
    {
      "address": "1159 Bridgeport Road E",
      "bathroom_full": 1,
      "bathroom_half": 0,
      "bedroom": 2,
      "demographic_age_25_to_29_years_percent": 0.16249999403953552,
      "demographic_employment_industries_professional_scientific_and_technical_services_percent": 0.1304347813129425,
      "demographic_marital_status_single_percent": 0.5972222089767456,
      "den": 0,
      "interior_sq_m": 102.09959411621094,
      "property_id": "1000121070d57f61"
    },
    {
      "address": "504 35 Walmer Road",
      "bathroom_full": 4,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_age_25_to_29_years_percent": 0.1855670064687729,
      "demographic_employment_industries_professional_scientific_and_technical_services_percent": 0.30645161867141724,
      "demographic_marital_status_single_percent": 0.5,
      "den": 1,
      "interior_sq_m": 185.7116241455078,
      "property_id": "100016a8f4f4f1a9"
    },
    {
      "address": "3492 Rue University",
      "bathroom_full": 1,
      "bathroom_half": 0,
      "bedroom": 1,
      "demographic_age_25_to_29_years_percent": 0.15763546526432037,
      "demographic_employment_industries_professional_scientific_and_technical_services_percent": 0.28735631704330444,
      "demographic_marital_status_single_percent": 0.7157360315322876,
      "den": 0,
      "interior_sq_m": 139.72500610351562,
      "property_id": "10002e9d3bb9419"
    },
    {
      "address": "1108 2261 Lake Shore Boulevard W",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 2,
      "demographic_age_25_to_29_years_percent": 0.15698032081127167,
      "demographic_employment_industries_professional_scientific_and_technical_services_percent": 0.03129074349999428,
      "demographic_marital_status_single_percent": 0.48632168769836426,
      "den": 0,
      "interior_sq_m": 83.51913452148438,
      "property_id": "10002ea98a9d7121"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 169232
  },
  "price_quote": false,
  "result_total": 1015389,
  "time_ms": 56,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}