!

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


Predict the list and sale price of properties, at specific times
In this example, we are retrieving the predicted list and sale price of a property, for right now, the next 2 months, and the last 2 months.
Request
Shell session
curl -X GET "https://api.houski.ca/predict?api_key=YOUR_API_KEY&fields=estimate_sale_price,estimate_list_price&last=2&next=1&period=month&property_id=bd9c6fb24c31c772,f8bc15e3f737f1f5&start_date=2023-02-01"
TypeScript code
const houski_recipe_data = async (): Promise<PredictResponse> => {

    // You must copy the PredictResponse type declarations from the 
    // Houski API documentation to strongly type the response

    const url = new URL('https://api.houski.ca/predict');
    url.searchParams.set('api_key', 'YOUR_API_KEY');
    url.searchParams.set('fields', 'estimate_sale_price,estimate_list_price');
    url.searchParams.set('last', '2');
    url.searchParams.set('next', '1');
    url.searchParams.set('period', 'month');
    url.searchParams.set('property_id', 'bd9c6fb24c31c772,f8bc15e3f737f1f5');
    url.searchParams.set('start_date', '2023-02-01');

    const response = await fetch(url);
    const data = await response.json();

    return data;
}

(async () => {
let data: PredictResponse = await houski_recipe_data();

// Log the response
console.log(data);
})();
Response
JSON
{
  "cache_hit": true,
  "cost_cents": 0.1599999964237213,
  "data": [
    {
      "predictions": [
        {
          "date": "2022-12-03",
          "estimate_list_price": 254719.0,
          "estimate_sale_price": 236320.0
        },
        {
          "date": "2023-01-02",
          "estimate_list_price": 255387.0,
          "estimate_sale_price": 237958.0
        },
        {
          "date": "2023-02-01",
          "estimate_list_price": 255139.0,
          "estimate_sale_price": 236600.0
        },
        {
          "date": "2023-03-03",
          "estimate_list_price": 256482.0,
          "estimate_sale_price": 238864.0
        }
      ],
      "property_id": "bd9c6fb24c31c772"
    },
    {
      "predictions": [
        {
          "date": "2022-12-03",
          "estimate_list_price": 769719.0,
          "estimate_sale_price": 721620.0
        },
        {
          "date": "2023-01-02",
          "estimate_list_price": 769719.0,
          "estimate_sale_price": 724718.0
        },
        {
          "date": "2023-02-01",
          "estimate_list_price": 769719.0,
          "estimate_sale_price": 729873.0
        },
        {
          "date": "2023-03-03",
          "estimate_list_price": 769719.0,
          "estimate_sale_price": 738198.0
        }
      ],
      "property_id": "f8bc15e3f737f1f5"
    }
  ],
  "error": "",
  "price_quote": false,
  "result_total": 2,
  "time_ms": 2336
}