Skip to content

VerticalTab/Pillow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pillow - Zillow PHP client

This library provides a PHP interface for the Zillow API.

See: zillow.com for more information.

Currently, only these API calls are supported:
http://www.zillow.com/howto/api/GetSearchResults.htm
http://www.zillow.com/howto/api/GetChart.htm
http://www.zillow.com/howto/api/GetComps.htm

If there is one you'd really like to see implemented, you can create an issue and/or fork, implement, and submit a pull request.

Requirements

PHP >= 5.3

Installation

The preferred method of installation is composer. In you project root (not web root), create a minimum composer.json file:

{
    "require": {
        "VerticalTab/Pillow": "x.x.x"
    }
}

Replace "x.x.x" above with the tag number you want to use. Note: see VeriticalTab/Pillow Packagist page for latest release information.

Next, get composer and use it to install (again, in your project root)

$ wget http://getcomposer.org/composer.phar
$ php composer.phar install

This will put the library into your vendors directory.

Updating

To update after installation, edit the "require" section in composer.json. Then update:

$ php composer.phar update

Examples

File: simple.php

<?php
require 'vendor/autoload.php';

use VerticalTab\Pillow\Service;

$key = 'your zillow api key';
$s = new Service($key);
$results = $s->getSearchResults('2114 Bigelow Ave', '98109');
$property = $results->current();

"Results:" . PHP_EOL;
echo "zpid      : " . $property->zpid . PHP_EOL;
echo "city      : " . $property->city . PHP_EOL;

Run simple example

$ php simple.php

File: chart.php

<?php
require 'vendor/autoload.php';

use VerticalTab\Pillow\Service;

$key = 'your zillow api key';
$s = new Service($key);
$results = $s->getSearchResults('2114 Bigelow Ave', '98109');
$property = $results->current();

echo "chart url : " . $property->chart->url . PHP_EOL;

Run chart example:

$ php chart.php

File: comps.php

<?php
require 'vendor/autoload.php';

use VerticalTab\Pillow\Service;

$key = 'your zillow api key';
$s = new Service($key);
$results = $s->getSearchResults('2114 Bigelow Ave', '98109');
$property = $results->current();

foreach($property->comps as $i => $comp) {
  echo "\tcomp      : " . $i . PHP_EOL;
  echo "\tzpid      : " . $comp->zpid . PHP_EOL;
  echo "\tzestimate : " . $comp->zestimate->amount . PHP_EOL;
  echo PHP_EOL;
}

Run comps example:

$ php comps.php