Retsly Core SDK Version 2. Useful for clientside and node integration with Retsly.
$ npm install retsly/js-sdk
var Retsly = require('js-sdk')
var retsly = Retsly.create(ACCESS_TOKEN, [VENDOR]);
var request = retsly.listings()
.query({bedrooms: 3})
.getAll();
Returns a new instance of Retsly
. Requires an API token and optionally set the vendor (the MLS data source).
Returns a new Request
for the Listings resource.
Returns a new Request
for the Agents resource.
Returns a new Request
for the Offices resource.
Returns a new Request
for the Openhouses resource.
Appends the query to the querystring.
request.query({bedrooms: 3})
.query({bathrooms: {gt: 4});
Alias for request.query({limit: n})
;
Alias for request.query({offset: n})
;
Helper function for building queries, works with different signatures.
request.where(['bedrooms', 'lt', 4])
.where('livingArea', 'gt', 3000)
.where('bathrooms', 3)
.where('garageSpaces eq 2');
Gets a single document with id, optionally takes a callback
Gets an array of documents that match the query criteria, optionally takes a callback
Gets a single document that match the optional query criteria, and optionally takes a callback. It sets the limit to one and only return the first result and not an array.
Alias for request.findAll(query, callback)
Alias for request.findAll({}, callback)
callbacks follow standard node syntax of:
cb(err, res);