Apartment hunting for the lazy ones


Chapter 1. Porto, Portugal

It’s never easy to leave everything behind — your life, your friends, your family — and move to a new country to start a new life… but it’s precisely what I did last December (2016). After living in Portugal for almost 20 years, 3 of those in Porto, I quit my job at 7Graus and, despite loving that city, I took my then-girlfriend-now-wife and moved to Switzerland. It was not an easy decision, but although I miss my family, my friends and my country, I believe it was the right choice.

Chapter 2. Romont, Switzerland

Moving to a new country is never easy. It might be an exciting new adventure but it’s always full of obstacles! For me, moving was a tiny bit easier because I grew up in Switzerland and my parents still live there.

For a couple of months, while being unemployed, I still had a place to stay with a hot bed and food at my mother’s place in Romont. I got to live in a beautiful tiny city with 5000+ inhabitants, located in the French part of Switzerland.

A couple of months went by and fortunately, I found a new job at Apptitude in Lausanne where I started working in February 2017. With the new job came the necessity of leaving my home at 7am every morning to commute 1h30 from Romont to Lausanne. At the end of the day, I would arrive home a bit after 7pm. As most commuters know, eventually the fatigue creeps in and for me, this meant it was time to find a place of my own in order to live closer to work.

Chapter 3. Lausanne, Switzerland

Chapter 3a. Lausanne, hell for apartment hunters

Lausanne is the third biggest city of Switzerland and is situated on the shores of the Lake Léman. It’s lovely and if you are considering to visit Switzerland, you should definitely visit!

To my surprise (and shock!), Lausanne is one of those places where finding an apartment is a living hell. Like Paris or London, there’s a lot of people looking for good and affordable places and not so many “cheap” places to rent.

Basically, the process of finding an apartment goes like this:

  1. You look for online ads (mostly on classified ads websites and facebook groups) that spark your interest. There’s a lot of new ads every hour, so you need to check each source multiple times a day in hopes of not missing the one apartment you’re looking for. As you can imagine, this is very time-consuming.
  2. For each interesting ad you find, you need to carefully check if it meets your requirements, if you like it (judging by its characteristics and photographs) and if your significant other also likes it. If so, you extract all the relevant information (address, phone number, relevant documents needed, etc.) and store it somewhere to make sure you don’t loose anything along the way that may cost you that lovely apartment you searched so hard for.
  3. For each approved ad, you need to figure out when to visit. Sometimes, there’s already a scheduled group visit and the information is present in the ad. But most of the times, you need to call and schedule a visit for yourself.
  4. For each visit you make, you check the apartement, ask a couple of questions and if everything checks out, you hand over a dossier with all the required documents to apply.
  5. If all went well, all you need to do now is wait for the response. In some cases, this goes very fast, but could also be very slow, or you might never get one (and probably won’t).

The problem with the situation is that it follows the priority rule: first come, first served. As such, the process above should be done as fast as possible: you need to check/validate the ad as soon as it’s available, and then call and schedule a visit. The hope is that you’re the first to visit so that your dossier is the first to be considered. You will also have to pray that the order of the dossiers will be respected and that your dossier isn’t missing anything crucial or it will most probably be discarded.

Quick note regarding the ads: There is so much competition that an ad can receive tens or hundreds of responses on the hour following its creation. For this reason, some ads are posted and removed before the hour is up because, by then, the poster will have enough interested (and desperate!) people. As you can imagine, to catch those ads you really need to make the search your “full-time job” and that wasn’t an option. So, what happened? I automatized our house search! 🤖

Chapter 3b. Lausanne, but I’m a dev after all

Let’s get serious, I code for a living, I eat lines of code for breakfast (or not!) and automation makes my world go round ❤️. I don’t have the time, the patience nor the will to spend my days looking for an apartment, spending hours organizing ads to find that golden egg. The reality was that I still needed that apartment as fast as possible, so…

Instead of passing my days looking for ads, I built a crawler for each website/facebook group I found with relevant ads. In total, I built 4 crawlers (3 websites + 1 facebook groups). Sidenote: One of the sites crawled, was an aggregator kind of site, so, free work!

All the collected ads, were already pre-filtered using the search engines of each website and were then filtered again by my scripts (when possible, because extracting data from text automagically is not always trivial). Every ad that got to this point, was added to a google spreadsheet to be validated by a human (aka my sidekick). To make things fast, I also got a push notification for each new entry added to the spreadsheet. I used push bullet for this.

At this point, if I was interested in the apartment I would simply call to schedule a visit.

In the end, I had a list with 1000+ apartments and for each of those, I knew:

  1. When it was found;
  2. Its characteristics and contact information of the owner;
  3. If we wanted it or not (and why);
  4. The time and date of the visit;
  5. If we submitted an application or not.

Chapter Z. End of the road

I love building this kind of stuff! It allows me to work on something I like (automation) to avoid doing stuff I don’t (boring repetitive tasks).

When I first started writing this story, it was not a “happy ending” kind of story: my little “coded companion” was running at full speed (ay ay captain!), while I was making calls and doing regular visits… but concretely I had nothing. Fortunately, my luck eventually turned, and I found a lovely apartment to call home. We moved, my babushka and I am now live in Lausanne.

Local knowledge says it usually takes 3 months to find and rent an apartment… With the help of my “coded companion”, I did it in just 1️⃣.

After having built all this, I actually got the first apartment I visited… Oh, sweet irony!

This article is also available in french “Automatisation — La recherche d’appartements pour les paresseux”.