homeup/homeup-api-php

Access to the centralized database API.

dev-master 2017-12-01 01:10 UTC

This package is not auto-updated.

Last update: 2024-05-12 02:10:19 UTC


README

API keys are not publicly available. Please contact us if you would like access.

Features

  • Easily query listings from multiple boards in Canada
  • Clean, logical listing formats
  • Normalized data across multiple boards
  • Intuitive relationships
  • Google Place data for all listings
  • Uses Amazon S3 for storage, other users using Amazon can utilize the "quick copy" feature for images

How To Use

First, initialize your class with your API keys. It's suggested you store these values in an environment file

$homeup = new HomeUp\Api\HomeUp('your_key', 'your_token');

Then you can simply use any of the following commands to get data from the centralized feed.

To get a list of listings. Please note, requests with a limit of more than 100 will not include listing images

$homeup->listings(['board', 'insert_board_id', 'limit' => 20]);

To get an individual listing use the following along with the listing ID provided from the API

$homeup->listing($listing_id, []);

To get an individual listings images use the following along with the listing ID provided from the API

$homeup->images($listing_id, []);

Enter the hours in the "removed" method in order to retrieve listings that have been taken off the MLS in that timeframe

$homeup->removed(24);

Queries

You can also do a query based on nearly any field in the database

$homeup->query()->where('square_feet', '>', 2000)->where('price', '<', 1000000)->get();

Ordering and limits work with queries the following way

$homeup->query()->where('square_feet', '>', 2000)
                ->where('price', '<', 1000000)
                ->orderBy('price', 'DESC')
                ->limit(10
                ->get();

You can also chain where statements. By default it is an AND, but you can perform an OR statement like so

$homeup->query()->where(function($q){
    $q->where('square_feet', '>', 1000);
    $q->orWhere('price', '<', 500000);
 )->get();

Lookups

There are some lookups available to help you pre-populate your database. These will return a master list according to their respective name

$cities = $homeup->cities();
$communities = $homeup->communities();
$realtors = $homeup->realtors();
$firms = $homeup->firms();