!

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


Get amenity area context for an appraisal or AVM
This request returns the names and use cases commercial buildings within a 1 kilometer radius of the point (a property in Vancouver) to look for any potential activity that would be relevant to an appraisal or AVM
Request
Shell session
curl -X GET "https://api.houski.ca/geocoding?api_key=YOUR_API_KEY&commercial_use_neq=Not applicable&country_abbreviation=ca&latitude=49.26249&longitude=-123.10659&radius=1&results_per_page=1&select=building_name,commercial_use,latitude,longitude&shape=circle"
TypeScript code
const houski_recipe_data = async (): Promise<GeocodingResponse> => {

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

    const url = new URL('https://api.houski.ca/geocoding');
    url.searchParams.set('api_key', 'YOUR_API_KEY');
    url.searchParams.set('commercial_use_neq', 'Not applicable');
    url.searchParams.set('country_abbreviation', 'ca');
    url.searchParams.set('latitude', '49.26249');
    url.searchParams.set('longitude', '-123.10659');
    url.searchParams.set('radius', '1');
    url.searchParams.set('results_per_page', '1');
    url.searchParams.set('select', 'building_name,commercial_use,latitude,longitude');
    url.searchParams.set('shape', 'circle');

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

    return data;
}

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

// Log the response
console.log(data);
})();
Response
JSON
{
  "cache_hit": false,
  "cost_cents": 0.6000000238418579,
  "data": [
    {
      "address": "11 West 10 Avenue",
      "building_name": "Tenth Church",
      "commercial_use": "Place of worship",
      "latitude": 49.262332916259766,
      "longitude": -123.10541534423828,
      "property_id": "dc9619f4e639e46c"
    }
  ],
  "error": "",
  "pagination": {
    "current_page": 1,
    "has_next_page": true,
    "has_previous_page": false,
    "page_total": 24
  },
  "price_quote": false,
  "result_total": 24,
  "time_ms": 86
}