!

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


Find properties in small towns with highly educated populations
This request identifies properties in smaller communities with unusually high education levels, where at least 30% of residents have a bachelor's degree.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&country_abbreviation=ca&demographic_education_level_bachelors_degree_percent_gt=0.3&demographic_education_level_bachelors_degree_percent_sort=desc&estimate_city_population_lt=10000&select=city,estimate_city_population,demographic_education_level_bachelors_degree_percent,demographic_education_level_masters_degree_percent,demographic_education_level_earned_doctorate_percent,demographic_income_median_pre_tax"
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_education_level_bachelors_degree_percent_gt', '0.3');
    url.searchParams.set('demographic_education_level_bachelors_degree_percent_sort', 'desc');
    url.searchParams.set('estimate_city_population_lt', '10000');
    url.searchParams.set('select', 'city,estimate_city_population,demographic_education_level_bachelors_degree_percent,demographic_education_level_masters_degree_percent,demographic_education_level_earned_doctorate_percent,demographic_income_median_pre_tax');

    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": "28 Birdstone Avenue",
      "city": "Stittsville",
      "demographic_education_level_bachelors_degree_percent": 0.5625,
      "demographic_education_level_earned_doctorate_percent": 0.0416666679084301,
      "demographic_education_level_masters_degree_percent": 0.1041666641831398,
      "demographic_income_median_pre_tax": 82075,
      "estimate_city_population": 1707,
      "property_id": "2f3724018bc14f49"
    },
    {
      "address": "29 Basford Crescent",
      "city": "Stittsville",
      "demographic_education_level_bachelors_degree_percent": 0.5625,
      "demographic_education_level_earned_doctorate_percent": 0.0416666679084301,
      "demographic_education_level_masters_degree_percent": 0.1041666641831398,
      "demographic_income_median_pre_tax": 82075,
      "estimate_city_population": 1707,
      "property_id": "4f4b72ad33d2423d"
    },
    {
      "address": "24 Birdstone Avenue",
      "city": "Stittsville",
      "demographic_education_level_bachelors_degree_percent": 0.5625,
      "demographic_education_level_earned_doctorate_percent": 0.0416666679084301,
      "demographic_education_level_masters_degree_percent": 0.1041666641831398,
      "demographic_income_median_pre_tax": 82075,
      "estimate_city_population": 1707,
      "property_id": "76011b051a8986a0"
    },
    {
      "address": "6 Basford Crescent",
      "city": "Stittsville",
      "demographic_education_level_bachelors_degree_percent": 0.5625,
      "demographic_education_level_earned_doctorate_percent": 0.0416666679084301,
      "demographic_education_level_masters_degree_percent": 0.1041666641831398,
      "demographic_income_median_pre_tax": 82075,
      "estimate_city_population": 1707,
      "property_id": "842eab79c6673d62"
    },
    {
      "address": "2 Steventon Crescent",
      "city": "Stittsville",
      "demographic_education_level_bachelors_degree_percent": 0.5625,
      "demographic_education_level_earned_doctorate_percent": 0.0416666679084301,
      "demographic_education_level_masters_degree_percent": 0.1041666641831398,
      "demographic_income_median_pre_tax": 82075,
      "estimate_city_population": 1707,
      "property_id": "b14481a39f94986a"
    },
    {
      "address": "10 Steventon Crescent",
      "city": "Stittsville",
      "demographic_education_level_bachelors_degree_percent": 0.5625,
      "demographic_education_level_earned_doctorate_percent": 0.0416666679084301,
      "demographic_education_level_masters_degree_percent": 0.1041666641831398,
      "demographic_income_median_pre_tax": 82075,
      "estimate_city_population": 1707,
      "property_id": "c080514a83537ada"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 10641
  },
  "price_quote": false,
  "result_total": 63845,
  "time_ms": 81,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}