Zillow API Wrapper for Node.js

2.0.0 · abandoned · verified Tue Apr 21

The `node-zillow` package provides a straightforward Node.js wrapper for the Zillow API, abstracting away the complexities of HTTP requests and XML parsing to return data via promises. Its current stable version is 2.0.0, released in 2018, indicating an infrequent release cadence focused on stability rather than rapid feature additions. The library consolidates all Zillow API interactions through a single `get` method, taking the API call name and parameters, offering a consistent interface. It relies on a Zillow Web Service ID (ZWSID) for authentication. Developers must refer to the official Zillow API documentation for available endpoints and parameters, as this library primarily acts as a thin client. Key features include promise-based asynchronous operations (using the `Q` library) and handling various Zillow API endpoints like `GetZestimate` or `GetDeepSearchResults`. The library does not handle Zillow's API terms of use or branding requirements, which developers are explicitly reminded to follow.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to instantiate the Zillow client and make a call to the `GetZestimate` API endpoint using a Zillow Web Service ID (ZWSID), including error handling.

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

// It's highly recommended to use environment variables for sensitive IDs.
// For demonstration, use a placeholder or actual ID if safe.
const zwsid = process.env.ZWSID ?? 'YOUR_ZWSID_HERE'; // Replace with a valid ZWSID for actual use

if (!zwsid || zwsid === 'YOUR_ZWSID_HERE') {
    console.error('Error: ZWSID not provided. Please set ZWSID environment variable or replace placeholder.');
    process.exit(1);
}

// Instantiate the Zillow client, explicitly enabling HTTPS for secure communication.
const zillow = new Zillow(zwsid, { https: true });

// Define parameters for the Zillow API call. Example for GetZestimate.
const parameters = {
    zpid: 1111111 // Example Zillow Property ID
};

console.log(`Attempting to get Zestimate for ZPID: ${parameters.zpid}`);

zillow.get('GetZestimate', parameters)
    .then(function(results) {
        // Zillow API responses can vary; 'response' property might not always be present.
        if (results && results.response) {
            console.log('Successfully retrieved Zestimate:');
            console.log(JSON.stringify(results.response, null, 2));
        } else if (results && results.message) {
            console.error('Zillow API Message:', JSON.stringify(results.message, null, 2));
        } else {
            console.error('Unexpected Zillow API response structure:', JSON.stringify(results, null, 2));
        }
    })
    .catch(function(error) {
        console.error('An error occurred during Zillow API call:', error.message);
        if (error.response && error.response.data) {
            console.error('Detailed error response:', error.response.data);
        }
    });

view raw JSON →