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. However, 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.

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

How to handle different combinations of home_type and ownership_type in AVM

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 SignleFamilyResidense to 'Terraced'
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 theese, need to investigate. Until then: Ask 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 theese, 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
Unknown TenantOwnership 10k-100k Ask user for both home_type and ownership_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