Getting Zillow Information from ColdFusion


I recently needed to create some ColdFusion code to call into Zillow so I thought it would be worth sharing.
The first thing you will need is an ID from Zillow to give you access to the http services.  They use the term web services but they are really http services.  You can find out everything you need to know about getting started and the Zillow APIs here: <a href="" target="_new"> Getting Started with Zillow</a>
Once you have your ID you can enter it into the below code and test it on your site.
I posted a demo here: <a href="" target="_new">DEMO</a>
<h1>Zillow Zestimate</h1>
<cfparam name="form.address" default="671 Lincoln Ave"  >
<cfparam name="" default="Winnetka">
<cfparam name="form.state" default="IL">
<cfparam name="form.Zip" default="60093">
<form name="zform"  method="post" >
Address: <input type="text" name="address" value="#form.address#" size="35"/>
    City: <input type="text" name="city" value="" size="20"/>
    State: <input type="text" name="state" value="#form.state#" size="3"/>
    Zip: <input type="text" name="Zip" value="#form.Zip#" size="14"/>
    <input type="submit"  name="getzestimate" value="Get Zestimate" />
<cfif isdefined("form.getzestimate") >
<cfset hz = 'na'>
<cfset lz = 'na'>
<cfset csz = & '+' & form.state & '+' &>
    <cfset zurl = ' YOUR WSID HERE&address=#urlEncodedFormat(form.address)#&citystatezip=#urlEncodedFormat(csz)#'>
    <cfhttp method="get" url="#zurl#"  result="zsearch">
    <cfset xmlResult = trim(zsearch.FileContent)>
    <cfset request.zillow = XmlParse(REReplace( xmlResult, "^[^<]*", "", "all" ) ) />
    <cfif findnocase('error',request.zillow.searchresults.message.text ) lt 1>
        <cfset h = trim(request.zillow.searchresults.response.results.result.zestimate.valuationrange.high.xmltext)>
        <cfset l = trim(request.zillow.searchresults.response.results.result.zestimate.valuationrange.low.xmltext)>
        <cfif isnumeric(h)>
            <cfset hz = dollarformat(h)>
        <cfif isnumeric(l)>
            <cfset lz = dollarformat(l)>
         <h3>Zestimate Range:  From #lz# to #hz#</h3> <a href='#request.zillow.searchresults.response.results.result.links.homedetails.xmltext#' 
            target="_new"><h3>View Property at</h3></a>
      <hr />
All the other Property Details<br />
<cfdump var='#request.zillow#'>
    Zillow could not recognize address