How to Get Rent Data from Rentometer API using Python | Part 2

Need to get rental data for a LIST of properties? Check out Rentometer's API to get rent estimates from local comparables. In this video, I'll show you how to use the API with Python

Resources

Transcription

00:00

Hey everyone, today is part two of a two part series on how to extract rental information from Rentometer using Python. Now, it's one of the best ways in order to extract data and assess property information by automating the process with Python. So you eliminate errors, and you're able to assess investments as a whole with more data. My name is Ariel Herrera with the analytics area channel, we bridge the gap between real estate and technology. If you enjoy these simple tutorials and fun facts, in order to actually increase your knowledge in looking at investment properties and the data available, then please subscribe to this channel. So you get the latest content and like us on social media. Alright, let's get started.

00:55

Great, so in the last video, we were able to actually take this information that we are able to do on rent tonometers page and put it into a Python notebook and get it programmatically. So the whole part of Friendswood meter is that you're able to get quality information on rent data, such as the median min max. And from there, you can do your own assessments on understanding if it's something you should invest in, or if you should increase your own current property rents. So here we have an example where we're able to see some of that rental information and the properties that were assessed by rentometer. Now if we go back to the Python code, what we did in the last section is we showed a one off if you wanted to look at a single property and be able to use the API using Python, how exactly you would do that. But usually, you're not looking at one property at a time, right, you're usually looking at a list. So in this example, I have additional code on how you would do that with multiple addresses. So let's imagine that we have a data frame and a run the cell, it's pretty small, we only have two different addresses. And we have bedrooms, as well as bathrooms. Now, we want to do is a horror loop. So we want to basically say, for each property in the row for my table, go out to rentometer, pass in the address additional information about the property and get back rent information. So in order to do that, I created a function called Get rentometer summary, we're hitting the summary API. So if we go back to the top, we have several parameters. And this follows what's in the developer specs. So developer specs you can put in information, like bedrooms, bathrooms, building type, and look back days is optional. However, there are some nuances. So for baths, you cannot put say two or three, once you go over one, it's just 1.5 plus. So I handle that in the function as well, when you're looking at look back days. So how far do you want to look at rental comparables, do you want to look just in the last three months or maybe four years? Well, there is a limit that retirement looks back, which makes sense, because it's probably going to be not relevant information if you're looking very far back. So in this case, I also am able to handle when you put maybe too few months or too many how to adjust that automatically. So let's review that in the Python code, which is available in the link below.

03:37

You can copy this over as long as you have a Google account for free. So what we're doing here is we're first thing check if we pass an address or something that will allow us to find the property if we didn't just stop this whole entire process and return back that we need to have those parameters. Next, we have our variables. So we want to hit the API version, one summary to get that rent data. Then we also want to handle when we have, say too many bedrooms. So if we have five bedrooms, that's not going to be handled by runtime that is API. So whenever that occurs, just leave it at four as the max, same kind of logic with bathrooms, and with lookback days based on what can be handled by the API. Next, we have all those parameters and say if the user doesn't enter or the information, we don't have number of bedrooms, it's going to automatically pass as none. So we don't have to worry about always having that. But we must always have an API key and address or a latitude longitude to make up for the address. So this part over here goes to that base URL, which is the API a sends the parameters like the address the API key, and then we return the response that we get back from autometer. So now skipping back down to the code, I create quickly a list. This is where we're going to have all of our responses back from autometer. Next, and this row, what we're basically doing here is we have our data frames our table called DF underscore addresses. And for each row, we want to pull information from it. So this is this is the information we want to pull, we want to pull the address, the beds and the baths. And once we pull that, we are going to send that into that function so that the function can then handle that information. And it could ultimately give us our output.

05:47

So if I run this here,it just got information for those two addresses, and it appended the response or capture their responses in a list so that we can go back to it. Now if we look at the first element in the list, we look at the text, we could see Yes, we were able to get back the information that we wanted. But how do we get this still in a tabular format, we have everything on what we want to see address the information on the property and then the rent information. So that's basically what I'm doing here is I have a couple for loops. And I'm saying for every single response that we captured, so in this case, it was two for two properties. Put that into a JSON format, and grab different information. So I realized here, I actually grabbed the same. So let's change this to median, Max, and min. So if we look at the JSON format, which we had up here, we could see, that's the names of the keys. So that's why I'm querying those specific key names to get those values back. Now, next up, is I'm going to run this. And what I'm doing here is I copied the original table. And for each of these new columns, I'm setting what those values are going to be.

07:13

So I just said above, run this. And now we have a table that actually has the rent data, the mean, median, max and min. Now it's really, really cool. That's new to Google collab is you can click this button, and it almost acts like you have an Excel file just straight inside the notebook. So you can actually do filters. And if we added more information on here, for example, we could quickly filter on properties that had only a certain minimum band for me. Or maybe if we calculate a cash flow, what that cash flow is not for the last step, always easier to have this data in your hands or for me in an Excel file. So if we run this Google collab then transforms us so that we can open this information inside Excel. And if you had a larger data frames that have just these two, maybe you have a list of 100 properties, you could basically do the same process, and you'll be able to get the rent data even faster. Alright, that's how you're able to get rental information from Rent ometer using Python for a whole list of properties. Hope this has been helpful. If so, please leave comments below or any ideas of other API's you'd like me to look into. Alright, thank you so much, and please subscribe.

Previous
Previous

Rentometer API with Zapier | Tutorial

Next
Next

How to Get Rent Data from Rentometer API using Python | Part 1