How to get Aussie property price guides using Python & the Domain API
If you’re an Australian you probably spend a lot of your time reading about, hearing about, or talking about property. It’s a national pastime. So most Aussies are familiar with Domain, one of the big two real estate websites. One of my biggest frustrations with real estate listings is when no price guide is listed by the agent. What’s more annoying is that I know a price or price range has always been provided by the agent, because the search engine needs to be able to filter by a user’s minimum and maximum prices.
For example let’s take this listing for a house in Sydney’s inner west suburb of Earlwood:
No price guide is provided. But if I search for houses with a max of $1 million there are no results. So I know the price range for this house is at least $1 million:
If I keep increasing my max price I will eventually see this in my search results. At $1.8m I get a hit:
So now I can get an actual feel for what price range the agent/vendor is pitching this property at. Great. But what a painful, time-consuming process right? So I thought surely we can use Python to automate this!
This is when I decided to get a Domain developer account to take a look at their APIs. Firstly I tried doing a simple request to retrieve the listing info for a given property to see if the price guide would be in there. No luck. So instead I wrote a script over a weekend to basically automate the process of searching through different maximum prices to get a guide. Now I could go through the whole process here on Medium but this time I used Google’s Colaboratory, a free Jupyter notebook environment that requires no setup and runs entirely in the cloud. Take a look at my notebook where I’ve added a bunch of commentary and instructions in the markdown. Download the whole notebook or the .py and go nuts. Hope you find this useful, even if it’s just to help with your property searches.
The best projects are the ones that solve your real life annoyances. That’s why learning Python has been a lot of fun. It’s really flexible and easy to get started and start solving actual problems with. I often see the book Automate the Boring Stuff with Python recommended for these reasons. I haven’t read it myself but it may be worth a look.
Good luck with your Python exploits and your house hunting!