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 permits inside a bounding box

In this example, we are retrieving properties that have permit data inside a geographic bounding box. Only properties with permit data will be returned when using the filter_expand_match parameter.

Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&bbox_ne_lat=51.1005&bbox_ne_lng=-113.508&bbox_sw_lat=50.6668&bbox_sw_lng=-114.4593&country_abbreviation=ca&expand=permits&filter_expand_match=all&province_abbreviation=ab&results_per_page=3"
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('bbox_ne_lat', '51.1005');
    url.searchParams.set('bbox_ne_lng', '-113.508');
    url.searchParams.set('bbox_sw_lat', '50.6668');
    url.searchParams.set('bbox_sw_lng', '-114.4593');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('expand', 'permits');
    url.searchParams.set('filter_expand_match', 'all');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');

    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.6500000357627869,
  "data": [
    {
      "address": "1406 Nutana Place NW",
      "permits": [
        {
          "expand_permit_application_date": "2023-09-15",
          "expand_permit_content": "Status: Completed|Issued date: 2023-09-29T00:00:00.000|Completed date: 2024-05-07T00:00:00.000|Estimated project cost: 38576.0|Permit class: Garage|Permit type: Residential Improvement Project|Permit type mapped: Building|Work class: New|Work class group: New|Work class mapped: New|applicant: JRB CONSTRUCTION SERVICES|contractor: JRB CONSTRUCTION SERVICES|estimated project cost: 38576.0|Total square feet affected: N/A|Housing units affected: 0",
          "expand_permit_id": "BP2023-15819",
          "expand_permit_type": "building",
          "property_id": "d01e63434f335daf"
        },
        {
          "expand_permit_application_date": "2023-09-15",
          "expand_permit_content": "Status: Completed|Issued date: 2023-09-29T00:00:00.000|Completed date: 2024-05-07T00:00:00.000|Estimated project cost: 38576.0|Permit class: Garage|Permit type: Residential Improvement Project|Permit type mapped: Building|Work class: New|Work class group: New|Work class mapped: New|applicant: JRB CONSTRUCTION SERVICES|contractor: JRB CONSTRUCTION SERVICES|estimated project cost: 38576.0|Total square feet affected: N/A|Housing units affected: 0",
          "expand_permit_id": "BP2023-15819",
          "expand_permit_type": "building",
          "property_id": "d01e63434f335daf"
        }
      ],
      "property_id": "d01e63434f335daf"
    },
    {
      "address": "331 Chaparral Valley Drive SE",
      "permits": [
        {
          "expand_permit_application_date": "2012-02-17",
          "expand_permit_content": "Status: Completed|Issued date: 2012-04-02T00:00:00.000|Completed date: 2012-11-11T00:00:00.000|Estimated project cost: 1351930.0|Permit class: Townhouse|Permit type: Commercial / Multi Family Project|Permit type mapped: Building|Work class: New|Work class group: New|Work class mapped: New|applicant: NORR ARCHITECTS ENGINEERS PLANNERS|contractor: JAYMAN BUILT|estimated project cost: 1351930.0|Total square feet affected: N/A|Housing units affected: 6",
          "expand_permit_id": "BP2012-01716",
          "expand_permit_type": "building",
          "property_id": "f8a4a4c0c8cb3e5e"
        },
        {
          "expand_permit_application_date": "2012-02-17",
          "expand_permit_content": "Status: Completed|Issued date: 2012-04-02T00:00:00.000|Completed date: 2012-11-11T00:00:00.000|Estimated project cost: 1351930.0|Permit class: Townhouse|Permit type: Commercial / Multi Family Project|Permit type mapped: Building|Work class: New|Work class group: New|Work class mapped: New|applicant: NORR ARCHITECTS ENGINEERS PLANNERS|contractor: JAYMAN BUILT|estimated project cost: 1351930.0|Total square feet affected: N/A|Housing units affected: 6",
          "expand_permit_id": "BP2012-01716",
          "expand_permit_type": "building",
          "property_id": "f8a4a4c0c8cb3e5e"
        }
      ],
      "property_id": "f8a4a4c0c8cb3e5e"
    },
    {
      "address": "1904 2 Avenue NW",
      "permits": [
        {
          "expand_permit_application_date": "2022-02-15",
          "expand_permit_content": "Status: Completed|Issued date: 2022-03-09T00:00:00.000|Completed date: 2023-08-18T00:00:00.000|Estimated project cost: 826605.64|Permit class: Apartment|Permit type: Commercial / Multi Family Project|Permit type mapped: Building|Work class: New|Work class group: New|Work class mapped: New|applicant: VERDEEP UBHI|contractor: VERDEEP UBHI|estimated project cost: 826605.64|Total square feet affected: N/A|Housing units affected: 3",
          "expand_permit_id": "BP2022-02344",
          "expand_permit_type": "building",
          "property_id": "a29c1453d9e2fce9"
        }
      ],
      "property_id": "a29c1453d9e2fce9"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 59169
  },
  "price_quote": false,
  "result_total": 177506,
  "time_ms": 273,
  "ui_info": {
    "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"
  }
}