4.3 Zillow Web – What is a proxy? BOL no more?

This week, we will create a maproom that grabs data from Zillow’s search API.  Skim over the documentation to get a good understanding of how it works:

Proxy Script

One big difference from the Metro API is that there is no option to get the data back in JSON format.  Moreover, there is no support for JSONP.  This means that you cannot make cross-domain requests for the data… which means that you need to access the data via a server-side proxy.  If this all sounds too technical to you, you can read more about why proxy’s are necessary here:

What you need to understand is that some API’s do not allow you to access their data without a server side script (or “proxy”).  Metro was generous in that they did allow you to grab data without a proxy (otherwise known as “JSONP” access).  Why?  Let’s just say it is for security reasons, and for the provider’s to have more control over who uses their data, and how it is being used.

Proxy + BOL = NOOOOO!

So, we now understand that we have to create a proxy script to access Zillow data.  A proxy script cannot be written in javascript, and must be written in a scripting language like PHP.  The other requirement is that the proxy be hosted in the same server that your other files are hosted on.  This ensures that there is no “cross domain” requests for data, as both files reside on the same server.

The problem is…  Bruin Online has prohibited the use of proxy scripts within their domain!  A plea to their technical team to allow this to work for our class was not granted… For this reason, we cannot use Bruin Online for our class projects that will be accessing data from API’s that require a proxy.

To resolve this problem, I have decided to provide individual web space to each student in the class, as my hosting company does allow you to write proxy scripts. While this is a minor inconvenience, in the long run, this should give each student more flexibility (and web space – BOL only allows 100MB).

Please be ready to receive information regarding access to your new FTP accounts on my server.

All user names can be found in this spreadsheet

XML Format

The other issue we have is that the data will be returned in XML format.  Again, some API’s provide data in JSON format, some in XML, some in both, and some with only one format.  Since zillow returns data in XML format, we will need to learn how to parse the data, which is different from JSON, which used the .getJSON jQuery function.

Leave a Reply