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

Want to get rental data for real estate 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 fellow real estate investors. Rentometer recently came out with an API that you can utilize in order to get rent information for property at your fingertips. In this video, I'm going to show you how to extract that data with Python. My name is Ariel Herrera with the analytics area channel, we bridge the gap between real estate and technology. I love love, love data, and being able to set up systems for automation to make your job as an investor a lot easier. It's the kind of content that you enjoy. Please subscribe as well follow us on social media. Alright, let's get started.

00:46

Right now on rent amateurs website, and on their homepage are able to enter in an address and then get back information on what the rent should be. They look at comparables, other properties in the area that have recently been rented out. So you who quickly assess what rents should be for and then you can go a step further to see is this a property you should invest in based on what the cash flow looks like. Or maybe it's already a property you own. And you want to see if you can actually increase rents to increase your cash flow. Alright, so if I go over to realtor, we could see if I'm looking at Tampa, Florida, there's a property here, I'm going to copy the address, place it right in here. And this address was a three bed two bath. So I'd be able to select three Bed, Bath one and a half or more analyze an AI be able to quickly get information on what the average so the mean, rent is in the area, the median, and I can get a gauge as to whether I should run out this property if I should purchase the property or if I should increase my rents and what that value should be. So how do we actually get this programmatically? Well, first off, Mike Lapsley, the president of France ometer, actually posted a really useful video on how to utilize their API. This video is going to be a little bit more in detail, because I want to show you how to do it with Python or you, you're a little bit more on the technical side. In order to use this API, you do need to be able to have a rent ometer pro account. And it's pretty fairly price gives you access to credits. And just so that we're on the same page, once you're able to actually utilize this API, you no longer have to enter in an address manually one by one, because that's going to be very time consuming and not allow you to really make a system, you want to be able to either assess rents for a list of properties, or as properties are coming in. So by doing that with an API, you programmatically interface with rent ometer technology, and are able to get that information, simply say into an excel sheet. So once you're able to get your autometer pro account, you're going to be able to see more information on the actual API itself. So in the developer API section, it has information here on what you need to input. So you need to be able to input an API key address or latitude longitude the property, you can also get more granular by specifying what the bedrooms and baths are as well as the type of property if it's a house, apartment, so on, as well as how far back you want to look. So for example, in this really hot market that we're in, that rents have really dramatically increased in certain areas, you might not want to look back a full year. So here you can be more flexible, maybe it's like that's only been 90 days, for example. Also be mindful of seasonality, you may see higher rents during the summertime than the winter time, because less people are moving in the winter, so there's less demand. And as we could see here, on the right side, we get a lot of rich information, we're able to see the mean, median, min, and Max come through as a response. Once we actually query against the API. We also get information on the percentile 2575 percentile, standard deviation, radius miles, or how far rent ometer looked for other properties, how many samples were used, and so on. So we want to be able to get this data with Python. So I first started this search of how to do this. I didn't see that there's an option for Python here. But I did find this really, really neat site, where if you copy this curl code, and you bring it over to curl converter, you can paste it in and quickly be able to see what the code is in Python. So we could see here on Python, we to have a library and for request to be able to request a data. We have our URL here with is going to be API version one summary. So we can get that mean, median, min and max rent. And then we have parameters, which are specified up here. So now let's go through that with some code. Right now I'm on Google collab. It's a notebook setting. So say, if you know nothing about Python, and you don't have Python locally installed, that's perfectly fine. All you would have to do is actually just have a Google account, which is free copy of this notebook, also free, and then have your own API key that you could plug in.

05:34

So going down, I'm going to walk you through this notebook, which the link is in the show notes below. For imports, I have appear some libraries that we need to be able to have the available functions for. So one of them this is very specific to Google collab is Google collab drive and files, this is going to allow us to get our API key from a file and also output this data in the end to an Excel file that we could download. Now, next thing I'm doing here, I'm going to run this actually using shift answer. And the next step is I have a function that I'm going to touch in the next video, that's going to really help when you're looking at multiple properties. And the locals and constants section, we want to mount the drive. And this is specific for if you want to pull your API key from another file, which is a little bit more safe. Since your API key you want it to be private. If you want to skip this step, you could simply comment this out, go down to where the rental meter API key is, and just place your API key there in string format. So right now I'm going to run these two cells, it's going to ask me, Should I connect, can I connect my Google Drive account, I'm going to allow it. And now this notebook is going to be able to read all of my files in Google Drive. So I could see where I have my API key, which is in a CSV file. So I run that my API key is now loaded into this variable called rent ometer. API key, pretty simple. Now for the fun stuff. So what I did over here was I copied over this code, and I placed it within the cell. So I have the base URL, which is going to be rent ometer, the summary because remember, what we want to do is when we're following the API docs, we basically want to hit this URL, enter in our dress, and get back the subsequent information. Now, I also have just using their example address for right now that they had within developer docs. So that's 15, Broad Street, Boston, Massachusetts, I have that within strings. That property has two bedrooms. And the way rental meters API works is that whenever it's above one, that bathroom, you don't actually specify 234, etc, you just put 1.5 plus. Then for building type, it's going to be house. And if we go back to the API docs, we could actually see what the options are, which says apartment or house, and also specifies for look back days, what the default is and what the maximum you can go back. So looks like the maximum you could go back is a four year timeframe. Great. So now if I run this, I am going to get a response back. So I'm basically asking the API, I'm sending it information. And I'm now receiving information back. And this is in a text format, but it's not as friendly to read. So in this line of code, I'm transforming this into Jason, which is basically key value pairs. So we have here address the address that I sent in, and we skipped down a little bit more. We see here that we have information now on the max mean and median. So this is awesome so far. But how can we get this even more simple to read? Well, well, if we go down and run this, what I just said is I used pandas, pandas is a library, and Python, which basically puts things in tabular formats like Excel. So rows and columns. And what I've done here is normalized this Jason variable that we have. And now we could see all of our columns here. So address latitude longitude, and the information that's interesting, which is the mean, median, min and max for rent. Now, if we want to be able to get this back, so we could view it and excel file all the have to do is run this code, which is specific to Google collab and allows us to download the file. And now we can work with it in Excel. So say if you were looking to add additional formulas calculations, like cash flow or so on, you'll be able to do that now. on

10:21

Excel. However, it is more useful if you could just do it in Python, only a few lines of code. So that was a simple tutorial on how you're able to use an tonometers API to get rental information using Python. In the next video, I'm going to show you in more depth, how you can actually look at multiple properties and be able to extract that information in seconds. If you haven't follow me already. Please do thanks.

Previous
Previous

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

Next
Next

College Dropout to Real Estate Developer in 3 Years