!

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


Older/heritage properties
Gets properties built in 1960 or earlier.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&construction_year_gte=1950&construction_year_lte=1960&country_abbreviation=ca&select=construction_year,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('construction_year_gte', '1950');
    url.searchParams.set('construction_year_lte', '1960');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('select', 'construction_year,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": 4.800000190734863,
  "data": [
    {
      "address": "12819 121 Avenue NW",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "construction_year": 1953,
      "den": 0,
      "interior_sq_m": 96.71125793457033,
      "property_id": "1000286b73c1dbe3"
    },
    {
      "address": "12304 Rue Depatie",
      "bathroom_full": 1,
      "bathroom_half": 0,
      "bedroom": 3,
      "construction_year": 1953,
      "den": 0,
      "interior_sq_m": 195.04830932617188,
      "property_id": "10007aa1e457b939"
    },
    {
      "address": "72 Brown Street",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 2,
      "construction_year": 1953,
      "den": 1,
      "interior_sq_m": 106.46599578857422,
      "property_id": "1000b2b19e8cea9c"
    },
    {
      "address": "125 43E Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 4,
      "construction_year": 1959,
      "den": 0,
      "interior_sq_m": 112.2268295288086,
      "property_id": "1000cc867a36966a"
    },
    {
      "address": "1830 Regan Avenue",
      "bathroom_full": 2,
      "bathroom_half": 0,
      "bedroom": 3,
      "construction_year": 1960,
      "den": 0,
      "interior_sq_m": 97.26944732666016,
      "property_id": "100113761536407f"
    },
    {
      "address": "1474 Rue De Lorraine",
      "bathroom_full": 0,
      "bathroom_half": 0,
      "bedroom": 3,
      "construction_year": 1954,
      "den": 0,
      "interior_sq_m": 92.80936431884766,
      "property_id": "10011402348395b"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 67855
  },
  "price_quote": false,
  "result_total": 407130,
  "time_ms": 40,
  "ui_info": {
    "country": "Canada",
    "country_abbreviation": "CA",
    "country_abbreviation_id": "9ace2b6431b7f1be",
    "country_abbreviation_link": "ca",
    "country_slug": "canada"
  }
}