Skip to content

ResidentialRegistry

leesideas edited this page Feb 6, 2025 · 43 revisions

Description

THIS DOCUMENTATION IS UNDER DEVELOPMENT, BUT WE THINK MOST THINGS ARE CORRECT NOW! PLEASE LET US KNOW IF YOU HAVE ANY QUESTIONS!

Search parameters

Field name Type Example Description
street_name varchar(60) Storgatan street name in address
street_number list [1,3,None] street number in address
street_suffix char(5) A suffix in address
street_additional_info varchar(40) StreetAddress street_address (= most common), metric_address, village_address, farm_address. Note: This information is not necessary
postal_code varchar(7) 12322 postal code
postal_city varchar(40) Stockholm postal area
unit_number smallint(4) 1001 unique number on every apartment at the same address

unparsed_address? Needed from the beginning or maybe add later?

Result

Field name Type Example Description Used for
universal_property_id varchar(255) 909a6a48-a405-90ec-e040-ed8f66444c3f unique id (uuid) for all residences All
unparsed_address varchar(60) Storgatan 1A, 12322, Stockholm, lgh 1001 address of the residence (street, nr, letter, postal code, postal area, apartment number (if apartment) ) All
street_name varchar(60) Storgatan street name in address All
street_number list [1,3,None] street number in address All
street_suffix char(5) A suffix in address All
street_additional_info varchar(40)) StreetAddress street_address (= most common), metric_address, village_address, farm_address. If missing, presume it is a street_address All
postal_code varchar(7) 12322 postal code All
postal_city varchar(40) Stockholm postal area All
unit_number smallint(4) 1001 unique number on every apartment at the same address Apartment
property_sub_type string 'SingleFamilyResidence' Building structure type of home. Accepted values are 'Apartment', 'SingleFamilyResidence', 'Townhouse', 'Duplex', 'Terraced', 'Cabin', 'Farm', 'Other...', 'Unknown...' All
occupant_type string 'Owner' Ownership type of home. Accepted values are 'Owner', 'TenantOwnership' All
building_number mediumint(5) 1 A numeric ID to identify buildings on the same property All
living_area decimal 75 Living area of home in square meters All
rooms_total decimal 4 Number of rooms in home Apartment...
year_built int 1950 Building construction year All
latitude decimal 59.405589 Latitude of current residence All
longitude decimal 18.323536 Longitude of current residence All
entry_level int 2 the floor of the residence i.e. where the entry is Apartment
stories_total int 4 the highest floor on the address Apartment

Note on address

Every street_name is unique within each postal_area. If there is a postal_area in the API call, postal_code is not used. The postal codes in Sweden change frequently, which leads to errors. Postal areas are more stable over time.

Note on property_sub_type

We follow the RESO standard to the largest possible extent. There are some things to know about:

  • The Swedish house types "kedjehus" ('chain house') and "radhus" ('row house') are not separated in the RESO standard. We use 'Terraced' for "kedjehus" and 'Townhouse' for "radhus". The difference is that for a "kedjehus" there is a building, usually a garage, between the houses that is connecting them. This might be changed in the future, we are in contact with RESO about it. We might want to use the term "linked house".
  • In Swedish official registries, no distinction is made between duplexes and single-family houses. Single-family houses classified as tenant-owned properties are likely to be duplexes.
  • Houses classified as cabins are based on outdated information. Many of these houses have been renovated and now function as ordinary single-family homes. Conversely, some houses classified as single-family homes are now used as cabins

Notes on occupant_type

  • Many homes are classed as "unknown". Most of them are rentals.
  • New homes are sometimes "unknown". It might take a while before they get the right classification.
  • Single family houses that are labeled "unknown" are usually owned by a legal entity
  • For valuation purposes, a single family house with unknown occupant type can still be valued as if it was owned by a private individual
  • If a value is 'Unknown': Ask the user
  • Farms cannot get a valuation as a farm. The AVM can only perform a valuation for a normal house. To do a valuation, home_type needs to be recoded to 'SingleFamilyHouse'. If so, we recommend a note to the user that the valuation does not include the value of the land or the farm buildings

How to handle different combinations of home_type and ownership_type in AVM

The table below covers all possible combinations and our recommendations on how to handle them. The use case we cover is when a user is doing a valuation of a home and there is a possibility for the user to change information. Some general rules will handle many of the recommendations in the table:

  • ownership_type = Tenancy : No valuations can be provided unless ownership_type is changed by the user
  • ownership_type = SiteLeashold : At the moment, our AVM does not handle site leashold. The valuation must be done as if the ownership_type is 'Owner'. We suggest automatically recoding. However, the valuation will be to high and it might be appropriate to add a comment to the user.
  • home_type = cabin: Be aware that the houses that are classified as cabins might be something else. Many cabins have been upgraded to normal houses. If for instance, the user lives in the house, it is no longer a cabin. In that case, we suggest that home_type is changed to 'SingleFamilyResidence'

In the table below, cases that are not covered by the recommendation above are marked with bold italics

home_type ownership_type frequency how to handle
SingleFamilyResidence Owner >1M As it is
SingleFamilyResidence Tenancy 10k-100k Tenancy = no valuation unless the user changes ownership_type
SingleFamilyResidence TenantOwnership 1k-10k Recode SingleFamilyResidence to 'Townhouse' Might be duplex houses. At the moment the AVM model will handle them as 'Townhouse'.
SingleFamilyResidence Unknown 0 No need to handle
SingleFamilyResidence SiteLeashold 10k-100k Recode 'SiteLeashold' to 'Owner'
Terraced Owner 100k-1M As it is
Terraced Tenancy 1k-10k Tenancy = no valuation unless the user changes ownership_type
Terraced TenantOwnership 1k-10k As it is
Terraced Unknown 100-1k Ask user for ownership_type
Terraced SiteLeashold 1k-10k Recode 'SiteLeashold' to 'Owner'
Townhouse Owner 100k-1M As it is
Townhouse Tenancy 1k-10k Tenancy = no valuation unless the user changes ownership_type
Townhouse TenantOwnership 10k-100k As it is
Townhouse Unknown 1k-10k Ask user for ownership_type
Townhouse SiteLeashold 10k-100k Recode 'SiteLeashold' to 'Owner'
Farm Owner 100k-1M Recode home_type to 'SingleFamilyResidence'
Farm Tenancy 1k-10k Tenancy = no valuation unless the user changes ownership_type
Farm TenantOwnership <100 Not sure about these, need to investigate. Until then: Ask the user for both home_type and ownership_type
Farm Unknown 0 No need to handle
Farm SiteLeashold <100 Recode home_type to SingleFamilyResidence and 'SiteLeashold' to 'Owner'
Cabin Owner 10k-100k If user live in the house: Recode home_type to "SingleFamilyResidence'
Cabin Tenancy 100-1k Tenancy = no valuation unless the user changes ownership_type
Cabin TenantOwnership <100 Not sure about these, need to investigate. Until then: Ask user for both home_type and ownership_type
Cabin Unknown 0 No need to handle
Cabin SiteLeashold <100 Recode ownership_type to "Owner". If the user lives in the house, recode home_type to cabin
Apartment Owner 100-1k Apartment with ownership_type cannot get valuations at the moment
Apartment Tenancy >1M Tenancy = no valuation unless the user changes ownership_type
Apartment TenantOwnership >1M As it is
Apartment Unknown 100k-1M Ask user for ownership_type
Apartment SiteLeashold 0 No need to handle
Unknown Owner 1k-10k Ask user for both home_type and ownership_type
Unknown Tenancy 10k-100k Tenancy = no valuation unless the user changes ownership_type. Ask user for home_type
Unknown TenantOwnership 10k-100k Ask user for home_type
Unknown Unknown 100k-1M Ask user for both home_type and ownership_type
Unknown SiteLeashold 0 No need to handle

Model Usage

SDK

import realai
import pandas as pd

realai_client = realai.Client()
# Login
realai_client.authenticate("USER","PASSWORD")

realai_client.residential_registry(params={"street_name":"Storgatan"})

Residential Registry cURL Request

curl --location 'https://api.modelmarket.io/v1/data/realai/residential-registry?street_name=Storgatan&street_number=1%2C28&street_suffix=A&street_additional_info=standard&postal_code=75331&postal_city=Uppsala&unit_number=1001&limit=1' \
--header 'Accept: application/json' \
--header 'Authorization: Bearer <ACCESS_TOKEN>'

Clone this wiki locally