!

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


Low-income areas
Gets properties in areas with low median after-tax income.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_income_median_after_tax_lt=40000&demographic_income_median_pre_tax_lt=50000&select=demographic_income_median_after_tax,demographic_income_median_pre_tax,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_income_median_after_tax_lt', '40000');
    url.searchParams.set('demographic_income_median_pre_tax_lt', '50000');
    url.searchParams.set('select', 'demographic_income_median_after_tax,demographic_income_median_pre_tax,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_income_median_after_tax": 36990,
      "demographic_income_median_pre_tax": 39949,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "100000674098d664"
    },
    {
      "address": "4140 Adam Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_median_after_tax": 30578,
      "demographic_income_median_pre_tax": 32304,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000019f9b0cf9c8"
    },
    {
      "address": "103 1780 Tougas Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_median_after_tax": 36496,
      "demographic_income_median_pre_tax": 38962,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000651ea96e24c"
    },
    {
      "address": "150 Canada Ch",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_median_after_tax": 36990,
      "demographic_income_median_pre_tax": 40935,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000093e6d27e587"
    },
    {
      "address": "595 352 Route",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 2,
      "demographic_income_median_after_tax": 38716,
      "demographic_income_median_pre_tax": 42908,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000b85beec2abb"
    },
    {
      "address": "16 Balloon Crescent",
      "bathroom_full": 5,
      "bathroom_half": 1,
      "bedroom": 4,
      "demographic_income_median_after_tax": 37483,
      "demographic_income_median_pre_tax": 40442,
      "den": 3,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000c1259c75058"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 734464
  },
  "price_quote": false,
  "result_total": 4406780,
  "time_ms": 102,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}