API recipes

Requests you can copy and run. Each one returns live data from the API.

Examples

Get age demographics for properties

Programming language

Select the programming language you want to display the code examples in.

Get the age demographics of the people around a property
Pull age demographics for the population around an Edmonton property. See the Fields page for all demographic fields.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=edmonton&country_abbreviation=ca&page=1&property_type_eq=House&province_abbreviation=ab&results_per_page=1&select=address,demographic_age_0_to_4_years_percent,demographic_age_5_to_9_years_percent,demographic_age_10_to_14_years_percent,demographic_age_15_to_19_years_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('page', '1');
    url.searchParams.set('property_type_eq', 'House');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '1');
    url.searchParams.set('select', 'address,demographic_age_0_to_4_years_percent,demographic_age_5_to_9_years_percent,demographic_age_10_to_14_years_percent,demographic_age_15_to_19_years_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": true,
  "cost_cents": 0.42,
  "data": [
    {
      "address": "10908 146 Street NW",
      "demographic_age_0_to_4_years_percent": 0.06428572,
      "demographic_age_10_to_14_years_percent": 0.057142857,
      "demographic_age_15_to_19_years_percent": 0.06428572,
      "demographic_age_5_to_9_years_percent": 0.08571429,
      "property_id": "10cb20adb5a1b3ec"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 210692
  },
  "price_quote": false,
  "result_total": 210692,
  "time_ms": 3147,
  "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"
  }
}