!

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


Areas with above-average income
Gets properties in areas with median after-tax income above $60,000.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_income_median_after_tax_gt=60000&demographic_income_median_after_tax_lte=100000&select=demographic_income_median_after_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_gt', '60000');
    url.searchParams.set('demographic_income_median_after_tax_lte', '100000');
    url.searchParams.set('select', 'demographic_income_median_after_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": 4.800000190734863,
  "data": [
    {
      "address": "1 107 12 Fourth Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_median_after_tax": 73486,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000012a72a63be7"
    },
    {
      "address": "1 99 Hopewell Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_median_after_tax": 60547,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10000f4d120a2e1d"
    },
    {
      "address": "206 Wychwood Park",
      "bathroom_full": 2,
      "bathroom_half": 2,
      "bedroom": 4,
      "demographic_income_median_after_tax": 69541,
      "den": 0,
      "interior_sq_m": 183.66778564453125,
      "property_id": "10001c0a409cb394"
    },
    {
      "address": "110 Park Street E",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_median_after_tax": 66582,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10002a4a3a1ec4a1"
    },
    {
      "address": "1108 2261 Lake Shore Boulevard W",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 2,
      "demographic_income_median_after_tax": 61968,
      "den": 0,
      "interior_sq_m": 83.51913452148438,
      "property_id": "10002ea98a9d7121"
    },
    {
      "address": "9 Kings Landing Priv",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_median_after_tax": 78418,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000368313d410c3"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 225505
  },
  "price_quote": false,
  "result_total": 1353025,
  "time_ms": 539,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}