A Salesforce Zillow Mashup

Zillow is an innovative service that provides residential property valuations for houses across the United States.  This valuation, called a Zestimate is provided for all houses not just those that may be for sale at a particular time.  This valuation is based on county tax records, sales of comparable properties in the neighborhood and a Zillow proprietary algorithm.  Though it is an estimate, it has proved to be fairly accurate and is increasingly being used by buyers and sellers of real estate, not to mention millions of others who are just curious about their home values or that of their neighbors.  In addition to the property valuation data, Zillow also provides data on the demographics of a neighborhood, property valuation trends, comparable property data and other real estate tools.

They have a  Web Service API  as well that lets you access most of this information programatically.

The Idea

So I was thinking.  This data can be real useful to a marketer to either qualify a lead or complement it. A company that makes customized house numbers for example  can build a target list of prospective customers based on house value.  An insurance agent visiting a client to sell a policy, can perhaps modulate his pitch based on the recent property value movements or the demographics of the neighborhood.  More generally this could be used as an input to a lead scoring system.
Though you can go to the Zillow web site, a better, seamless solution would be to mashup this data with Salesforce data.

What do you think?

Getting Started

I signed up for a free Zillow account by registering on the Zillow API network.  I recieved a token called a Zillow Web Services Identification (ZWSID) .  This token must be passed with every API call and is used to authenticate as well as monitor usage.  Since these API’s are REST based, we use the HTTP classes provided in Apex to access Zillow.  But before we can make an outbound call, we first need to add Zillow to the list of authorized remote sites in your Salesforce organization.  Go to Setup -> Security Controls -> Remote Site Settings.  Click on the New Remote Site button and add www.zillow.com.

Invoking Zillow

OK, now we are ready to start writing some code.  We first write a method that just makes a HTTP request to a URL and returns the response.

public HttpResponse invokeZillow( String method, String url ){                      HttpRequest  req = new HttpRequest();            HttpResponse response = null;         req.setEndpoint(url);          req.setMethod(method) ;         Http http = new Http();         response = http.send(req);                    return response ;

}

Zillow provides several different APIs – we will start with the GetSearchResults  API.  We can invoke the SearchResult API like this for the property at 2114 Bigelow Ave, Seattle, WA

invokeZillow( 'GET' , 'http://www.zillow.com/webservice/GetSearchResults.htm?zws-id=<ZWSID>&address=2114+Bigelow+Ave&citystatezip=Seattle%2C+WA' ) 

Notice how the ZWSID needs to be passed with the request.  We would then have to parse the result to get the Zestimate value.

Next Steps

Well that was pretty straightforward.  The next thing I will be doing is to structure the code so that we can easily extend it to the other APIs that Zillow provides, write the exception handling code, write a few utility and wrapper classes to easily parse the response and maintain the configuration data.  I will then write a simple VisualForce page to test this functionality, where we will take the address data from a Lead record and get the Zestimate for that lead.  The complete code will be posted on the wiki.

Who am I?

By the way, I am Nick Simha. I work with the partner enablement group at Salesforce. Our group works closely with our consulting partners to help implement our products. I joined Salesforce fairly recently,  prior to that I worked with object databases and enterprise middleware (CORBA, JEE, BPM etc.) at various companies.  Force.com is by far the coolest and easiest platform I have worked with. I look forward to future conversation. 

tagged Bookmark the permalink. Trackbacks are closed, but you can post a comment.