API recipes

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

Examples

Page through a whole city for a bulk pull

Programming language

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

Page through a whole city for a bulk pull
Pull every property of a city page by page, here Oslo. Ask for a price quote first: the response gives the cost of one page of 1,000 rows and the number of pages, so the cost of the whole pull is known before the loop starts. Then drop price_quote and request page=1, page=2 and so on until has_next_page is false.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&city=oslo&country_abbreviation=no&page=1&price_quote=true&province_abbreviation=osl&results_per_page=1000&select=address,property_type,construction_year,interior_sq_m,estimate_sale_price"
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', 'oslo');
    url.searchParams.set('country_abbreviation', 'no');
    url.searchParams.set('page', '1');
    url.searchParams.set('price_quote', 'true');
    url.searchParams.set('province_abbreviation', 'osl');
    url.searchParams.set('results_per_page', '1000');
    url.searchParams.set('select', 'address,property_type,construction_year,interior_sq_m,estimate_sale_price');

    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": 329.99997,
  "data": [],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 344
  },
  "price_quote": true,
  "result_total": 343792,
  "time_ms": 18,
  "ui_info": {}
}