!

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


Public administration concentration
Gets properties in areas with a high percentage of residents working in public administration.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_employment_industries_public_administration_percent_gt=0.1&select=demographic_employment_industries_public_administration_percent,demographic_employment_industries_educational_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_employment_industries_public_administration_percent_gt', '0.1');
    url.searchParams.set('select', 'demographic_employment_industries_public_administration_percent,demographic_employment_industries_educational_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": 5.40000057220459,
  "data": [
    {
      "address": "1167 Notredame Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_employment_industries_educational_services_percent": 0.0,
      "demographic_employment_industries_public_administration_percent": 0.10204081982374193,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "100000674098d664"
    },
    {
      "address": "1 107 12 Fourth Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_employment_industries_educational_services_percent": 0.1805555522441864,
      "demographic_employment_industries_public_administration_percent": 0.2638888955116272,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000012a72a63be7"
    },
    {
      "address": "1132 De Lelite Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_employment_industries_educational_services_percent": 0.052173912525177,
      "demographic_employment_industries_public_administration_percent": 0.24347825348377228,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000033f08439f97"
    },
    {
      "address": "1675 4 Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_employment_industries_educational_services_percent": 0.1388888955116272,
      "demographic_employment_industries_public_administration_percent": 0.1666666716337204,
      "den": 0,
      "interior_sq_m": 86.39979553222656,
      "property_id": "1000061296e4b4e5"
    },
    {
      "address": "150 Canada Ch",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_employment_industries_educational_services_percent": 0.1822916716337204,
      "demographic_employment_industries_public_administration_percent": 0.1302083283662796,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000093e6d27e587"
    },
    {
      "address": "24 Black Duck Street",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_employment_industries_educational_services_percent": 0.09302325546741486,
      "demographic_employment_industries_public_administration_percent": 0.11627907305955888,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000a145755d43d"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 526637
  },
  "price_quote": false,
  "result_total": 3159822,
  "time_ms": 403,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}