Renting in London with Guile
Published by Arun Isaac on
In other languages: தமிழ்
Tags: London, lisp, scheme, software
I recently moved to London for work. I will be working in London for at least a few years and wanted to find a good house. House hunting in London was not easy. There weren't that many houses within my budget. Besides, the rental market was so fast and competitive that suitable houses were taken by the time I could identify and enquire about them. I was using OpenRent to search for houses, and found that the built-in filters in the web interface were not sophisticated enough to allow expression of the criteria I was looking for. So, I decided to scrape OpenRent data and process them on my own machine with a Guile script.
Insufficiency of OpenRent filters
Filtering houses that do not include bills in the rent
I was looking for houses that did not include utilities (electricity, water, gas) and council tax in the rent. OpenRent allows you to filter houses that have bills included, but it does not allow you to filter houses that do not have bills included.
Straight line distance (as the crow flies) between points
In OpenRent, you select a point and list all houses at a certain radius from that house. Unfortunately, this radius is a straight line distance as the crow flies. Since we are denizens of the ground and cannot fly straight from point to point, this is not very useful to us. Even if a house is farther from work as the crow flies, it may be close to a tube line and thus may offer a good commute.
Old advertisements are duds
Older advertisements tend to have already been taken or be under negotiation. Enquiring about them is mostly a waste of time and energy. Unfortunately, OpenRent does not let you filter or sort by the age of the advertisement.
Maximum tenants
Many smaller houses only allow a maximum of one tenant. Since I needed a house for me and my partner, I needed a house that allows at least two tenants. OpenRent does not let you filter for such houses.
Avoid bedsits
Many smaller houses are bedsits. Bedsits don't have kitchens at all or have shared kitchens. I wanted to avoid them, but OpenRent does not let you filter them away.
A Guile script to fix these issues
To address these issues, I decided to scrape OpenRent data and process them on my own machine. OpenRent offers no easy API. So, scraping was necessary. guile-json and guile-lib's (htmlprag) HTML parser were very useful for this. To find the distance from a house to work by bicycle, I queried the OpenStreetMap data-wielding Open Source Routing Machine (OSRM) API. To find the tube lines incident on stations near a house, I queried the Transport for London (TfL) API. And, to avoid bothering these API endpoints too much and getting banned from them, I cached their responses.
My Guile script lives in the https://git.systemreboot.net/rent-in-london/ git repository. I hope it is of some use to others, or serves as an inspiration. If you run the script it will produce output as shown below. The output succinctly lists all the properties of a house that I care about. It was of great use in finding suitable houses as soon as they were listed on OpenRent.
1 Bed Flat, Lyonsdown Rd, EN5 (posted 58 hours ago) https://www.openrent.co.uk/1566437 £1350 pcm Cycling distance: 16.4 km Tube: High Barnet (northern), Totteridge & Whetstone (northern) 1 Bed Flat, Page Green Terrace, N15 (posted 56 hours ago) https://www.openrent.co.uk/1571987 £1400 pcm Cycling distance: 9.1 km Tube: Seven Sisters (victoria) 1 Bed Flat, Neasden Lane, NW10 (posted 56 hours ago) https://www.openrent.co.uk/1571965 £1280 pcm Cycling distance: 13.2 km Tube: Neasden (jubilee), Dollis Hill (jubilee), Wembley Park (jubilee metropolitan) 1 Bed Maisonette, Albert Road, E18 (posted 6 hours ago) https://www.openrent.co.uk/1573365 £1200 pcm Cycling distance: 17.0 km Tube: South Woodford (central), Snaresbrook (central), Redbridge (central), Wanstead (central)
Copyright
The Big Ben title image is released under the CC BY-SA 3.0 license, and is assembled from
- Clock Tower - Palace of Westminster, London - May 2007, a photo by David Iliff and released under the CC BY-SA 3.0 license
- GNU Guile logo by Luis Felipe López Acevedo released under the CC BY-SA 4.0 license