GithubHelp home page GithubHelp logo

ralucas / node-zillow Goto Github PK

View Code? Open in Web Editor NEW
70.0 9.0 27.0 156 KB

Node wrapper for Zillow API

Home Page: https://ralucas.github.io/node-zillow

License: MIT License

JavaScript 100.00%
zillow zillow-api nodejs

node-zillow's Introduction

node-zillow Build Status Coverage Status

Node wrapper for the Zillow API

Getting Started

Install the module with: npm install node-zillow

var Zillow = require('node-zillow');

//Instantiate
var zillow = new Zillow('your zws-id', options);

var your-zws-id = process.env.ZWSID is the recommended way

Accepted options

https - default is false

None of this will make sense without reading the Zillow API Docs

Also be sure to follow the Zillow API terms of use and branding requirements

Documentation

Methods

get

  • Method for the entire zillow api
  • takes the name of the api call (i.e. GetSearchResults) -- refer to the Zillow API Docs, the lib/api-list.js, or see below
  • Returns a promise with the result
  • The eventual returned result is an object with the following properties: message, request, and sometimes response
  • Please Note: response property is NOT always included in the zillow api response

Following API Methods supported:

  • GetDeepSearchResults
  • GetUpdatedPropertyDetails
  • GetDeepComps
  • GetRateSummary
  • GetMonthlyPayments
  • GetDemographics
  • GetRegionChildren
  • GetRegionChart
  • GetSearchResults
  • GetZestimate
  • GetChart
  • GetComps

Examples

Example of all API calls through the get() method can be found in examples

var Zillow  = require('node-zillow')

var zwsid = process.env.ZWSID
var zillow = new Zillow(zwsid)

var parameters = {
  zpid: 1111111
};

zillow.get('GetZestimate', parameters)
  .then(function(results) {
    return results;
    // results here is an object { message: {}, request: {}, response: {}} 
  })

The following API calls are deprecated and will be removed in the 1.0.0 release. Using get() is the recommended approach and should be able to do everthing that the legacy functions do. If you see problems with get(), PR's and issues are welcome.

Zillow.callApi()
Zillow.getDeepSearchResults()
Zillow.getUpdatedPropertyDetails()
Zillow.getDemographics()

Contributing

This module uses promises via the Q library. Please continue to use promises. And in lieu of any further formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using npm scripts in the package.json.

Contributors

Release History

  • v2.0.0 - Updated all dependencies. Remove support for Node.js v0.10.x.
  • v1.1.0 - Updated all dependencies, removed grunt, moved to istanbul, added coveralls, more ci environments
  • v1.0.1 - Added protocol option
  • v1.0.0 - Created single method (get), updated response handling, removed all deprecated methods, updated tests
  • v0.0.5 - updates
  • v0.0.4 - Added error-checking and parameter checking
  • v0.0.3 - Includes the following methods: callApi, getUpdatedPropertyDetails, getDeepSearchResults, getDemographics

License

Copyright (c) 2014-2018 Richard Lucas. Licensed under the MIT license.

node-zillow's People

Contributors

jefffriesen avatar ralucas avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-zillow's Issues

Question on formatting of responses

I've been using your library for a few days now, thanks for doing the work.

One question I have is why you made every element in the response an array when you convert from XML to JSON? If this was on purpose, just want to understand the reasoning.

Would you be open to a change that makes the parsing more aligned with the xml? I'm using (specifically) the DeepSearchResults API.

Thanks!

Update NPM

Seems like NPM still has the 0.5 version. Can you send 1.0.0 over there?

Thanks!

lodash methods not found

I am running the example code on Mac OS. However, I am getting the following error:

Node-Zillow error:  TypeError: _.chain(...).map(...).map(...).map(...).fromPairs is not a function
    at handleResponse (/hamidb/applications/node-zillow/lib/helpers.js:99:8)
    at _fulfilled (/hamidb/applications/node-zillow/node_modules/q/q.js:854:54)
    at self.promiseDispatch.done (/hamidb/applications/node-zillow/node_modules/q/q.js:883:30)
    at Promise.promise.promiseDispatch (/hamidb/applications/node-zillow/node_modules/q/q.js:816:13)
    at /hamidb/applications/node-zillow/node_modules/q/q.js:570:49
    at runSingle (/hamidb/applications/node-zillow/node_modules/q/q.js:137:13)
    at flush (/hamidb/applications/node-zillow/node_modules/q/q.js:125:13)
    at _combinedTickCallback (internal/process/next_tick.js:73:7)
    at process._tickCallback (internal/process/next_tick.js:104:9)

Node-Zillow error: Error: Error: Invalid character in entity name

I am receiving this error.

Node-Zillow error:  Error: Error: Invalid character in entity name
helpers.js:105
Line: 7
Column: 108
Char: =
    at /home/sarath/Congruent_Projects/Impact_Marketing/HomeVal/node_modules/node-zillow/lib/helpers.js:40:25

Please help regarding this. I don't know why its happening

webpack + react + node-zillow

Have you tried using the module along with webpack and react? i'm getting this obscur error when requiring the module:
index_bundle.js:36577 Uncaught Error: define cannot be used indirectmodule.exports @

no exact match found for input address

Hello i got no exact match found for input address all the times
my question is how to pass or format the geocode results data to pass input in parameters .
Below code use google maps api geocode to get address .
geocode results data i have street_number, route, city, state, zipcode, country

function geocodeLatLng(geocoder, map, infowindow,location) {
var latlng = {lat: location.lat , lng: location.lng };
geocoder.geocode({'location': latlng}, function(results, status) {
if (status === google.maps.GeocoderStatus.OK) {
if (results[1]) {
// omitted codes regarding fetching values from results , don't worry i got the correct data /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var parameters = {
//Question is here how to format the address component
address: encodeURIComponent(street_number+route+state+country),
citystatezip: city+state+zip
};
zillow.get('GetSearchResults', parameters)
.then(function(data) {
results = data.response.results.result[0].zestimate[0].amount[0]["_"];
console.log('zestimate amount');
console.log(results); // returns zestimate data when address in parameters is hard coded
return results;
})
}

require is not defined error

installed the package
npm install node-zillow

Tried this
var Zillow = require('node-zillow');

got this error
Uncaught ReferenceError: require is not defined

GetDeepSearchResults returning undefined

Hey, first off this wrapper is amazing so thank you for building such a useful tool.

I have been tinkering around with a few of the calls and so far have been successful except for using the GetDeepSearchResults.

var params = {
              address: // 123+Fake+St,
              city: // Fake+Town,
              state: //Fake+State,
              zip: // 12345
          }

or

var params = {
              address: // 123+Fake+St,
              citystatezip: // Fake+Town+Fake+State+12345
          }

zillow.callApi('GetDeepSearchResults', params)
            .then(function(data){
                console.log(data)
                //results = data.response[0].results[0].result[0];
                //return res.json(200, results);
            })

So far just trying to review the data to make sure that I have it and Im getting back undefined. Just curious to see if you had any insight into this and could offer any help.

Thanks

npm audit report warnings

Would it be possible to update some of the dependencies used in node-zillow so that they all pass the "npm audit"? The following have warnings from npm audit as of September 27, 2020:

Moderate: Prototype Pollution
Package: hoek
Patched in: > 4.2.0 < 5.0.0 || >= 5.0.3
Path: node-zillow > request > hawk > boom > hoek
Path: node-zillow > request > hawk > cryptiles > boom > hoek
Path: node-zillow > request > hawk > hoek
Path: node-zillow > request > hawk > sntp > hoek
More info: https://npmjs.com/advisories/566

Moderate: Out-of-bounds Read
Package: stringstream
Patched in: >=0.0.6
Path: node-zillow > request > stringstream
More info: https://npmjs.com/advisories/664

High: Insufficient Entropy
Package: cryptiles
Patched in: >=4.1.2
Path: node-zillow > request > hawk > cryptiles
More info: https://npmjs.com/advisories/720, https://npmjs.com/advisories/1464

Moderate: Prototype Pollution
Package: extend
Patched in: >=2.0.2 <3.0.0 || >=3.0.2
Path: node-zillow > request > extend
More info: https://npmjs.com/advisories/996

undocumented GetResults

I'd like to use the undocumented http://www.zillow.com/search/GetResults.htm which is available in this python lib. It can do fairly complicated searching for houses, based on the params you would enter on the website. I have the start of a parameter builder, and would be happy to PR for it, once it's a bit more cleaned up, if there is interest. As I look at the rest of this API, methods are basically just 1:1 maps of params, but the GetResults params are pretty ugly, so it might make more sense to add a mapping function for it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.