!

API recipes

Practical examples for using the Houski API.

Examples

Get a price quote for any API request

Programming language

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

Get a price quote for a request
Estimate cost before making a request. Adding price_quote=true shows what 100 houses with 3+ bedrooms in Calgary would cost.
Request
Shell session
curl -X GET "https://api.houski.ca/properties?api_key=YOUR_API_KEY&bedroom_gte=3&city=calgary&country_abbreviation=ca&page=3&price_quote=true&property_type_eq=House&province_abbreviation=ab&results_per_page=100"
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('bedroom_gte', '3');
    url.searchParams.set('city', 'calgary');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('page', '3');
    url.searchParams.set('price_quote', 'true');
    url.searchParams.set('property_type_eq', 'House');
    url.searchParams.set('province_abbreviation', 'ab');
    url.searchParams.set('results_per_page', '100');

    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": 2.0,
  "data": [
    {}
  ],
  "error": "",
  "pagination": {
    "current_page": 3,
    "has_next_page": true,
    "has_previous_page": true,
    "page_total": 3919
  },
  "price_quote": true,
  "result_total": 391815,
  "time_ms": 125,
  "ui_info": {}
}