!

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 family friendly properties
Gets properties in areas ideal for young families with good schools and safety.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_household_type_family_with_children_percent_gte=0.2&score_education_gt=7&score_nature_gte=6&score_safety_gte=7&select=score_education,demographic_household_type_family_with_children_percent,score_safety,score_nature,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_household_type_family_with_children_percent_gte', '0.2');
    url.searchParams.set('score_education_gt', '7');
    url.searchParams.set('score_nature_gte', '6');
    url.searchParams.set('score_safety_gte', '7');
    url.searchParams.set('select', 'score_education,demographic_household_type_family_with_children_percent,score_safety,score_nature,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": "1 107 12 Fourth Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_household_type_family_with_children_percent": 0.22807016968727112,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000012a72a63be7",
      "score_education": 10,
      "score_nature": 10,
      "score_safety": 10
    },
    {
      "address": "1 99 Hopewell Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_household_type_family_with_children_percent": 0.35217392444610596,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000f4d120a2e1d",
      "score_education": 10,
      "score_nature": 10,
      "score_safety": 10
    },
    {
      "address": "206 Wychwood Park",
      "bathroom_full": 2,
      "bathroom_half": 2,
      "bedroom": 4,
      "demographic_household_type_family_with_children_percent": 0.40625,
      "den": 0,
      "interior_sq_m": 183.66778564453125,
      "property_id": "10001c0a409cb394",
      "score_education": 10,
      "score_nature": 10,
      "score_safety": 8
    },
    {
      "address": "434 25 Westhill Drive",
      "bathroom_full": 0,
      "bathroom_half": 0,
      "bedroom": 0,
      "demographic_household_type_family_with_children_percent": 0.2063492089509964,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10002c548c70372e",
      "score_education": 10,
      "score_nature": 10,
      "score_safety": 8
    },
    {
      "address": "347 Regent Avenue W",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_household_type_family_with_children_percent": 0.25641027092933655,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "100032a1f7c76ddb",
      "score_education": 10,
      "score_nature": 10,
      "score_safety": 10
    },
    {
      "address": "36 Josephine Street",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_household_type_family_with_children_percent": 0.2222222238779068,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000370a4cfb98d3",
      "score_education": 10,
      "score_nature": 10,
      "score_safety": 8
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 293501
  },
  "price_quote": false,
  "result_total": 1761003,
  "time_ms": 647,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}