API recipes

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

Examples

Find properties by area political lean

Programming language

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

Find properties by the political lean of their area
Pull Calgary properties in strongly right-leaning areas (8 or above). estimate_political_lean runs from 0 for strongly left-leaning to 10 for strongly right-leaning, with 5 as the centre. Use estimate_political_lean_lte=2 for strongly left-leaning areas in a city that has them. Useful for political campaign mail, advocacy outreach, and voter mobilization.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=calgary&country_abbreviation=ca&estimate_political_lean_gte=8&page=1&province_abbreviation=ab&results_per_page=3&select=address,estimate_political_lean,demographic_income_median_pre_tax,property_type"
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', 'calgary');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('estimate_political_lean_gte', '8');
    url.searchParams.set('page', '1');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '3');
    url.searchParams.set('select', 'address,estimate_political_lean,demographic_income_median_pre_tax,property_type');

    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.69000006,
  "data": [
    {
      "address": "36 Crimson Ridge Heights NW",
      "demographic_income_median_pre_tax": 217021,
      "estimate_political_lean": 8,
      "property_id": "104fb85a9c002e5d",
      "property_type": "Commercial"
    },
    {
      "address": "304 30 Rochester View NW",
      "demographic_income_median_pre_tax": 217021,
      "estimate_political_lean": 8,
      "property_id": "1198b011e799062c",
      "property_type": "Townhouse"
    },
    {
      "address": "435 Crimson Ridge Place NW",
      "demographic_income_median_pre_tax": 217021,
      "estimate_political_lean": 8,
      "property_id": "1209fe3057284c96",
      "property_type": "House"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 95642
  },
  "price_quote": false,
  "result_total": 286924,
  "time_ms": 35,
  "ui_info": {
    "city": "Calgary",
    "city_id": "6ec95b53075d062c",
    "city_link": "ca/ab/calgary",
    "city_slug": "calgary",
    "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"
  }
}