The predict endpoint is used for predicting various property metrics over time such as list prices, sale prices and rent prices.
This endpoint conforms to Houski API's standard filtering and sorting functionality.
To see all the fields that can be filtered or sorted by, see the fields page.
Name | Required | Type | Description |
---|---|---|---|
api_key | Yes | UUID v4 | Authorization API key |
property_id | Yes | String | The target property's ID |
start_date | Yes | String | Start date for prediction in YYYY-MM-DD format |
columns | Yes | String | Any predictable field |
period | No (default: week) | String | The time period for the predictions - day, week, month, year |
next | No (default: 0) | Integer | How many future periods after the start_date to predict |
last | No (default: 0) | Integer | How many previous periods before the start_date to predict |
Type declarations are available at the bottom of this page.
Name | Type | Description |
---|---|---|
cache_hit | Boolean | Indicates if the data was retrieved from the cache |
cost_cents | Number | Cost of the API call in cents |
data | Object | Contains the prediction data |
error | String | Details about the error. Empty if no error |
pagination | Object | Pagination information |
price_quote | Boolean | Request is for a price quote |
result_total | Number | Total number of results |
time_ms | Number | Time taken for the request to complete in milliseconds |
Select the programming language you want to display the code examples in.
By default, predict endpoint responses are returned in a nested format.
curl -X GET "https://api.houski.ca/predict?api_key=YOUR_API_KEY&columns=sale_price,list_price&last=3&next=3&period=week&property_id=bd9c6fb24c31c772&results_per_page=3&start_date=2023-02-01"
const houski_predict_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('columns', 'sale_price,list_price'); url.searchParams.set('last', '3'); url.searchParams.set('next', '3'); url.searchParams.set('period', 'week'); url.searchParams.set('property_id', 'bd9c6fb24c31c772'); url.searchParams.set('results_per_page', '3'); 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_predict_data(); // Log the response console.log(data); })();
{ "cache_hit": true, "cost_cents": 0.14000000059604645, "data": [ { "date": "2023-02-22", "list_price": 250398.1875, "property_id": "bd9c6fb24c31c772", "sale_price": 253744.0 }, { "date": "2023-02-15", "list_price": 249633.046875, "property_id": "bd9c6fb24c31c772", "sale_price": 245333.5625 }, { "date": "2023-02-08", "list_price": 249651.4375, "property_id": "bd9c6fb24c31c772", "sale_price": 245733.5625 }, { "date": "2023-02-01", "list_price": 249103.59375, "property_id": "bd9c6fb24c31c772", "sale_price": 245682.140625 }, { "date": "2023-01-25", "list_price": 249319.8125, "property_id": "bd9c6fb24c31c772", "sale_price": 245682.140625 }, { "date": "2023-01-18", "list_price": 248426.84375, "property_id": "bd9c6fb24c31c772", "sale_price": 245682.140625 }, { "date": "2023-01-11", "list_price": 245666.65625, "property_id": "bd9c6fb24c31c772", "sale_price": 230969.28125 } ], "error": "", "pagination": { "current_page": 0, "has_next_page": false, "has_previous_page": false, "page_total": 0 }, "price_quote": true, "result_total": 7, "time_ms": 251 }
interface PredictResponse { cache_hit: boolean; cost_cents: number; data: PredictData[]; error: string; pagination: Pagination; price_quote: boolean; result_total: number; time_ms: number; } interface PredictData { date: string; property_id: string; list_price?: number | null; sale_price?: number | null; } interface Pagination { current_page: number; has_next_page: boolean; has_previous_page: boolean; page_total: number; }