!

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


Affluent areas with public transportation
Gets affluent areas with good public transit usage in Montreal.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=montreal&country_abbreviation=ca&demographic_income_150000_and_over_percent_gt=0.15&demographic_transportation_public_transit_percent_gte=0.15&province_abbreviation=qc&select=demographic_income_150000_and_over_percent,demographic_transportation_public_transit_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('city', 'montreal');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('demographic_income_150000_and_over_percent_gt', '0.15');
    url.searchParams.set('demographic_transportation_public_transit_percent_gte', '0.15');
    url.searchParams.set('province_abbreviation', 'qc');
    url.searchParams.set('select', 'demographic_income_150000_and_over_percent,demographic_transportation_public_transit_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": "839 Avenue Hartland",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_150000_and_over_percent": 0.2108108103275299,
      "demographic_transportation_public_transit_percent": 0.25,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10029097a8272b99"
    },
    {
      "address": "4030 Avenue Royal",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_150000_and_over_percent": 0.1805766373872757,
      "demographic_transportation_public_transit_percent": 0.32258063554763794,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10060a736656940d"
    },
    {
      "address": "3830 De Melrose Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_150000_and_over_percent": 0.16117216646671295,
      "demographic_transportation_public_transit_percent": 0.25,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10073bd900f29d0"
    },
    {
      "address": "708 1 McGill Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_150000_and_over_percent": 0.1763584315776825,
      "demographic_transportation_public_transit_percent": 0.2857142984867096,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10080b9cb94aafce"
    },
    {
      "address": "110 670 De Gaspe Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_150000_and_over_percent": 0.1613903045654297,
      "demographic_transportation_public_transit_percent": 0.17840375006198883,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "100d27cdd5164b17"
    },
    {
      "address": "32 Des Soeursgrises Rue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "demographic_income_150000_and_over_percent": 0.1763584315776825,
      "demographic_transportation_public_transit_percent": 0.2857142984867096,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "10147a695a901787"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 2614
  },
  "price_quote": false,
  "result_total": 15680,
  "time_ms": 260,
  "ui_info": {
    "city": "Montréal",
    "city_id": "17714d7a0b7d0e18",
    "city_link": "ca/qc/montreal",
    "city_slug": "montreal",
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Quebec",
    "province_abbreviation": "QC",
    "province_abbreviation_id": "a94c1625e3965742",
    "province_abbreviation_link": "ca/qc",
    "province_slug": "quebec"
  }
}