RealEstateR

Set of R tools for analyzing real estate data from Zillow and other sources.


output: github_document

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

RealEstateR

Travis build statusCoverage status

RealEstateR is a package that analyzes real estate data from the Zillow API.

Installation

You can install the latest development version of RealEstateR using devtools:

devtools::install_github("estebanangelm/RealEstateR")

API Token

To use the Zillow API in this package, you will need to get a Zillow Web Services ID (ZWSID) which can be done by registering here.

Once you have your ZWSID, you can set it:

library(RealEstateR)
zwsid <- Sys.getenv("ZWSID")
set_zwsid(zwsid)
library(ggmap)
set_zwsid("your-zwsid-here")

This allows you to make API calls within the package without having to pass in your ZWSID every time.

Note: If you are contributing to the package and need to run tests locally, add your ZWSID to .Renviron. You can do this by running the following command in your RStudio console:

Sys.setenv(ZWSID='your-key-here')

Usage Examples

For a more comprehensive overview of all functions, check out the vignette.

To get search results response, use get_search_results():

response <- get_search_results("2144 Bigelow Ave", "Seattle", "WA")

Note that the address must be include a street number. Passing in "Bigelow Ave" without the street number will result in an error. get_search_results() gives you the raw Zillow API response. You can use this response in other functions to extract information from it.

For example, you can get information about the property’s zpid:

get_zpid(response)

You can also extract the location data (e.g., geocoordinates) from the response:

get_loc(response)

To get information about similar recent sales, use get_comp_df():

zpid <- get_zpid(response)
get_comp_df(zpid = zpid, count = 5)

This returns a dataframe with information about bedrooms, bathrooms, lot size of properties that are similar to your property.

You can also get price estimates of other properties in the neighbourhood and plot them on a map:

neighbours <- get_neighbour_zestimates('2144 Bigelow Ave', 'Seattle', 'WA')
plot_neighbour_zestimates(neighbours)

To get screenname of a real estate agent in a specific city:

reviews_get_screennames(name = 'Rakesh Ram Real Estate Group', city = 'Cincinnati', state = 'OH')

To get information of up-to 5 real estate agents based on their screennames:

screennames <- c("Rakesh Ram Real Estate Group", "mwalley0", "pamelarporter", "klamping4", "Cincysrealtor")

reviews(screennames)

Limitations

In Zillow’s Terms of Use, reverse-engineering like scrapping is not allowed. Thus, it is not possible to get screennames of all real-estate agents in a location through web scrapping method. At the same time, Zillow API allows 1000 requests per day, which also limits the number of agents’ reviews information you can get. Reflecting from this limitation, our reviews function only allows you to search for reviews information of 5 agents at most.

Contribution

Please note that this project is released with a Contributor Code of Conduct.
By participating in this project you agree to abide by its terms.

The house icon in the logo is free for commercial use and is taken from Alex Timashenka.