dev-master
9999999-devAccess to the centralized database API.
dbad
The Requires
The Development Requires
by Troy Jaggard
api package mls
Wallogit.com
2017 © Pedro Peláez
Access to the centralized database API.
API keys are not publicly available. Please contact us if you would like access., (*1)
First, initialize your class with your API keys. It's suggested you store these values in an environment file, (*2)
$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., (*3)
To get a list of listings. Please note, requests with a limit of more than 100 will not include listing images, (*4)
$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, (*5)
$homeup->listing($listing_id, []);
To get an individual listings images use the following along with the listing ID provided from the API, (*6)
$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, (*7)
$homeup->removed(24);
You can also do a query based on nearly any field in the database, (*8)
$homeup->query()->where('square_feet', '>', 2000)->where('price', '<', 1000000)->get();
Ordering and limits work with queries the following way, (*9)
$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, (*10)
php
$homeup->query()->where(function($q){
$q->where('square_feet', '>', 1000);
$q->orWhere('price', '<', 500000);
)->get();, (*11)
There are some lookups available to help you pre-populate your database. These will return a master list according to their respective name, (*12)
php
$cities = $homeup->cities();
$communities = $homeup->communities();
$realtors = $homeup->realtors();
$firms = $homeup->firms();, (*13)
Access to the centralized database API.
dbad
api package mls