| 

When our Senior Developer was looking for a place to live, Finland's property websites weren't quite cutting it. So, he used his skills to build his own property finder...

Recently I moved from Leicestershire, England to Helsinki, Finland. There have been a number of things to tackle to make this happen, this post is about one of the important ones - finding a place to live.

There is a handy site for searching for homes to rent and buy called Oikotie; it has options for number of rooms, price range, areas to search, floor space, etc.

The homepage of the Finnish property search site Oikotie.

A quick search gives around 3500 results though, which is more than I would like to spend time going through. However, I am a software developer, so I set about building something that would narrow down the options.

Using data science to solve the problem

There have been a number of fantastic posts I’ve read over the years where software developers use data science to find places to live. For example:

There are even specific projects for finding apartments in Helsinki like this and this, but nothing that did exactly what I was after.

The main criteria for a place to live were:

  • Nearish to my partner’s address
  • Not too small
  • Not too expensive
  • At least one bedroom

For the purposes of the screenshots below I’ll substitute my partner’s address (which does not need to be on the internet) for the address of Konttiravintola Morton, which is in no way connected to RKH but I really like the food there. If you find yourself able to go there I would recommend it. The actual numbers of apartments will also differ; my original searching was in July/August while the writing/screenshots happened in January.

Extracting the data

Unlike England, homes in Finland are advertised by the number of rooms, not bedrooms. So, a studio flat would be a one room apartment in Finland. Two (or more) rooms means there is a separate bedroom. This is one of the many small differences that can trip up someone looking for a place to live.

There is an excellent library called finscraper that already has a way to read the listings on oikotie.fi and extract the data. At least it does for purchasing homes. So, I dug through the code for finscraper, and wrote some code to adjust it to work for rentals, and outputted the results to a HTML page.

Liam's list of potential homes before further refinement. A map at the top of the screen has pins showing the location of each home, with features listed below.

Narrowing the scope

Great; now we have a list of potential homes in Helsinki. A list of 400 in this case. So, let’s do some filtering. It gets cold in Helsinki, and the most distance I’d want to tackle in the middle of snow and/or slush would be 5km, so we’ll get rid of the homes outside that radius.

sdgsdfgs
46 listings now - much more manageable.

The previous filtering removed homes outside of 5km from our chosen target address, which is 5km as the crow flies. Being neither a crow or able to fly it’s time to get a better idea of the distances between the potential homes and the target point. Thankfully the HSL (Helsinki transport authority) has an API for that.

Apartments map 2

Now our tables contain the walking distance, public transport distance, and travel times of each, and we can come up with a way to use this extra information to give an overall score. Take each number you want to include in the score, multiply it by a “weight” that controls how much it contributes to the score (and whether it increases or decreases it), then add up the totals. Here is what I used:

Liam's code 1

Liam's code 2

In my case, I wanted to prioritise places that had a sauna or were in zone A or B for travel tickets. Places with a shorter walking duration were favoured over ones with a longer duration by multiplying by a negative number, and for total living space (life_sq_d) bigger was better so a positive number was multiplied. The actual weights were chosen by trial and error until the results were ordered roughly as I would do so by hand, based on the factors I valued - your priorities would probably differ and so would the actual numbers.

Liam's refined system for finding an aparment

A successful search

I added in a few refinements, such as linking the map pin to the row in the table, adding in a pop-up with the listing information when clicking on a map pin, sorting by any of the columns in the table, and the ability to hide a row from the results so I could check them off as I decided whether to try and apply, or skip that row. Then it was just a case of running the script each day, checking the results, and applying for the interesting ones.

I’m happy to say after applying for a number of apartments my application was accepted at one I’m very happy with. The moving process has been expensive, stressful, tiring, and totally worthwhile. For anyone interested, the actual code is available here.

This is a perfect example of working smarter, not harder. Our development team use intuitive and innovative ideas to find the ideal solutions to complex problems - with this approach, we build products that are a joy to use.

Bespoke products that meet your exact needs

Contact us today to learn about our development services.

Get in touch
liam-brown.png

Liam Brown

Senior Developer