!

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


Get the employment occupations demographics of the people near a property
In this example, we are retrieving the employment occupations demographics of the population around a property in Edmonton, Alberta, Canada.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=edmonton&country_abbreviation=ca&province_abbreviation=ab&results_per_page=1&select=demographic_employment_occupations_legislative_and_senior_management_occupations_percent,demographic_employment_occupations_business_finance_and_administration_occupations_percent,demographic_employment_occupations_natural_and_applied_sciences_and_related_occupations_percent,demographic_employment_occupations_health_occupations_percent,demographic_employment_occupations_in_education_law_and_social_community_and_government_services_percent,demographic_employment_occupations_in_art_culture_recreation_and_sport_percent,demographic_employment_occupations_sales_and_service_occupations_percent,demographic_employment_occupations_trades_transport_and_equipment_operators_and_related_occupations_percent,demographic_employment_occupations_natural_resources_agriculture_and_related_production_occupations_percent,demographic_employment_occupations_in_manufacturing_and_utilities_percent"
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', 'edmonton');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '1');
    url.searchParams.set('select', 'demographic_employment_occupations_legislative_and_senior_management_occupations_percent,demographic_employment_occupations_business_finance_and_administration_occupations_percent,demographic_employment_occupations_natural_and_applied_sciences_and_related_occupations_percent,demographic_employment_occupations_health_occupations_percent,demographic_employment_occupations_in_education_law_and_social_community_and_government_services_percent,demographic_employment_occupations_in_art_culture_recreation_and_sport_percent,demographic_employment_occupations_sales_and_service_occupations_percent,demographic_employment_occupations_trades_transport_and_equipment_operators_and_related_occupations_percent,demographic_employment_occupations_natural_resources_agriculture_and_related_production_occupations_percent,demographic_employment_occupations_in_manufacturing_and_utilities_percent');

    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": 1.2000001668930054,
  "data": [
    {
      "address": "433 1818 Rutherford Road SW",
      "demographic_employment_occupations_business_finance_and_administration_occupations_percent": 0.17006458342075348,
      "demographic_employment_occupations_health_occupations_percent": 0.09382195770740508,
      "demographic_employment_occupations_in_art_culture_recreation_and_sport_percent": 0.02430965006351471,
      "demographic_employment_occupations_in_education_law_and_social_community_and_government_services_percent": 0.12178227305412292,
      "demographic_employment_occupations_in_manufacturing_and_utilities_percent": 0.03225685656070709,
      "demographic_employment_occupations_legislative_and_senior_management_occupations_percent": 0.008490124717354774,
      "demographic_employment_occupations_natural_and_applied_sciences_and_related_occupations_percent": 0.08551904559135437,
      "demographic_employment_occupations_natural_resources_agriculture_and_related_production_occupations_percent": 0.014630721881985664,
      "demographic_employment_occupations_sales_and_service_occupations_percent": 0.2570064663887024,
      "demographic_employment_occupations_trades_transport_and_equipment_operators_and_related_occupations_percent": 0.1921183168888092,
      "property_id": "10001f3bac65c527"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 503195
  },
  "price_quote": false,
  "result_total": 503195,
  "time_ms": 100,
  "ui_info": {
    "city": "Edmonton",
    "city_id": "ba0db02120e894c9",
    "city_link": "ca/ab/edmonton",
    "city_slug": "edmonton",
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "province": "Alberta",
    "province_abbreviation": "AB",
    "province_abbreviation_id": "aae1f05a0f89d2c7",
    "province_abbreviation_link": "ca/ab",
    "province_slug": "alberta"
  }
}