xiyuansun / realEstAnalytics

real estate price analysis
10 stars 6 forks source link

Example Code Not Working? #3

Open ZellW opened 4 years ago

ZellW commented 4 years ago

In the Introduction, this code:

GetDeepSearchResults('2902 Wood St.', city='Ames',state='IA', zipcode=50014,
                     rentzestimate=TRUE,
                     api_key=getOption('ZillowR-zws_id'))

returns:

    address

1 2902 Wood St. Warning message: In GetDeepSearchResults("2902 Wood St.", city = "Ames", state = "IA", : invalid address, NAs returned

Has something changed or is this a problem somehow with my local machine? (I have set the ZillowR-zws_id by using set_zillow_web_service_id('MY_API_KEY')

jkr216 commented 4 years ago

Zillow has changed their API key access. Pretty sure these functions will not work anymore.

stharms commented 4 years ago

Interesting, they still work for me, both with the package as installed from github and reading from the API directly with rvest/xml2, which is how we built this initially. Have you double-checked that the API key is correct, or directly inputting it into GetDeepSearchResults() instead of using getOption('ZillowR-zws_id')? This is the same message you would get if the API call failed for some other reason.

I suspect that it has to do with either (a) invalid API Key or (b) your API key does not have permissions for this API. If they've changed how the keys work recently that may be the case

For example, this still works for me:

library(tidyverse)
library(realEstAnalytics)

GetDeepSearchResults('2902 Wood St.',
 city='Ames',
state='IA',
 zipcode='50014',
 api_key=getOption('ZillowR-zws_id'),
 raw=FALSE)
 address zipcode city  state   lat  long region_name region_id type  zestimate zest_lastupdated zest_monthlycha~ zest_percentile zestimate_low
  <chr>   <chr>   <chr> <chr> <dbl> <dbl> <chr>       <chr>     <chr>     <dbl> <date>                      <dbl>           <dbl>         <dbl>
1 2902 W~ 50014   Ames  IA     42.0 -93.7 College Cr~ 764177    neig~    153275 2020-02-12                    -47               0        142546
# ... with 12 more variables: zestimate_high <dbl>, zpid <chr>, bathrooms <dbl>, bedrooms <dbl>, finishedSqFt <dbl>, lastSoldDate <chr>,
#   lastSoldPrice <dbl>, lotSizeSqFt <dbl>, taxAssessment <dbl>, taxAssessmentYear <dbl>, totalRooms <dbl>, yearBuilt <dbl>

but this does not:

GetDeepSearchResults('2902 Wood St.', 
city='Ames',state='IA', zipcode='50014', 
api_key='abc', 
raw=FALSE)
invalid address, NAs returned        address
1 2902 Wood St.
jkr216 commented 4 years ago

Yes, I asked Zillow. They are changing to a new API with more restrictions. Old keys seem to have been allowed continued access for now.

On Feb 12, 2020, at 8:58 PM, stharms notifications@github.com wrote:

 Interesting, they still work for me, both with the package as installed from github and reading from the API directly with rvest/xml2, which is how we built this initially. Have you double-checked that the API key is correct, or directly inputting it into GetDeepSearchResults() instead of using getOption('ZillowR-zws_id')? This is the same message you would get if the API call failed for some other reason.

For example, this works:

library(tidyverse) library(realEstAnalytics)

GetDeepSearchResults('2902 Wood St.', city='Ames', state='IA', zipcode='50014', api_key=getOption('ZillowR-zws_id'), raw=FALSE) address zipcode city state lat long region_name region_id type zestimate zest_lastupdated zest_monthlycha~ zest_percentile zestimate_low

1 2902 W~ 50014 Ames IA 42.0 -93.7 College Cr~ 764177 neig~ 153275 2020-02-12 -47 0 142546 # ... with 12 more variables: zestimate_high , zpid , bathrooms , bedrooms , finishedSqFt , lastSoldDate , # lastSoldPrice , lotSizeSqFt , taxAssessment , taxAssessmentYear , totalRooms , yearBuilt but this does not: GetDeepSearchResults('2902 Wood St.', city='Ames',state='IA', zipcode='50014', api_key='abc', raw=FALSE) invalid address, NAs returned address 1 2902 Wood St. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
mdancho84 commented 4 years ago

Yes, this is a relatively recent problem - Within the past 2-3 weeks. Zillow seems to be changing their api. As far as I can tell with input from @jkr216 , it sees like Zillow is in the process of transitioning their Zestimates data to a company called Bridge Interactive. I don't know the full story yet, but this website appears to be where the data source is being relocated to. https://www.bridgeinteractive.com/developers/zillow-group-data/