!

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 property
You can retrieve detailed information on many properties in Canada. This example shows retrieving specific information on a property - just the number of bedrooms and bathrooms. Every property has hundreds of fields of information available.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?address=151-mckerrell-place-se&api_key=YOUR_API_KEY&city=calgary&country_abbreviation=ca&province_abbreviation=ab&results_per_page=3&select=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('address', '151-mckerrell-place-se');
    url.searchParams.set('api_key', 'YOUR_API_KEY');
    url.searchParams.set('city', 'calgary');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');
    url.searchParams.set('select', '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": 0.6000000238418579,
  "data": [
    {
      "address": "151 McKerrell Place SE",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 2,
      "den": 0,
      "property_id": "1f6299f6f1616645"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": false,
    "has_previous_page": false,
    "page_total": 1
  },
  "price_quote": false,
  "result_total": 1,
  "time_ms": 131,
  "ui_info": {
    "address": "151 McKerrell Place SE",
    "address_link": "ca/ab/calgary/mckenzie-lake/151-mckerrell-place-se",
    "address_slug": "151-mckerrell-place-se",
    "city": "Calgary",
    "city_id": "6ec95b53075d062c",
    "city_link": "ca/ab/calgary",
    "city_slug": "calgary",
    "community": "McKenzie Lake",
    "community_id": "6893f1425b51f7bb",
    "community_link": "ca/ab/calgary/mckenzie-lake",
    "community_slug": "mckenzie-lake",
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada",
    "property_id": "1f6299f6f1616645",
    "province": "Alberta",
    "province_abbreviation": "AB",
    "province_abbreviation_id": "aae1f05a0f89d2c7",
    "province_abbreviation_link": "ca/ab",
    "province_slug": "alberta"
  }
}