RETS client libraries
libRETS
libRETS is a RETS library that has bindings for many different languages, including C#, Java, Python, Ruby, and Perl. It was originally developed by NAR and now exists on Github New Window and Nuget New Window.
namespace trestle_librets
{
internal class Program
{
public static void Main(string[] args)
{
var session = new librets.RetsSession("https://api-trestle.corelogic.com/trestle/rets/login");
session.SetModeFlags(librets.RetsSession.MODE_NO_SSL_VERIFY);
var loginResult = session.Login("client_id", "client_secret");
var searchRequest = session.CreateSearchRequest("Property", "Property", "(StandardStatus=|Active)");
// libRETS defaults the limit to -1. You MUST set it to a value <=1000
searchRequest.SetLimit(1000);
searchRequest.SetSelect("ListingKey");
var results = session.Search(searchRequest);
}
}
}
PHRETS
PHRETS is one of the most popular native PHP RETS clients. It can be found on Github New Window or via Composer New Window.
<?php
require_once("vendor/autoload.php");
$config = new \PHRETS\Configuration;
$config->setLoginUrl('https://api-trestle.corelogic.com/trestle/rets/login')
->setUsername('client_id')
->setPassword('client_secret')
// PHRETS defaults to digest. You MUST set it to use basic.
->setHttpAuthenticationMethod(\PHRETS\Configuration::AUTH_BASIC);
$rets = new \PHRETS\Session($config);
$connect = $rets->Login();
// PHRETS defaults the limit to 99999999. You MUST set it to a value <=1000
$results = $rets->Search('Property', 'Property', '(StandardStatus=|Active)', ['Limit' => 1000, 'Select' => 'ListingKey']);
estately RETS
estately RETS provides a RETS client written in Ruby. It can be found on Github New Window or via Gem New Window.
require 'rets'
client = Rets::Client.new({
login_url: "https://api-trestle.corelogic.com/trestle/rets/login",
username: "client_id",
password: "client_secret",
version: "RETS/1.8"
})
client.login
property = client.find :all, {
search_type: 'Property',
class: 'Property',
query: '(StandardStatus=|Active)',
select: 'ListingKey',
# estately does not set a default. You SHOULD set it to a value <=1000
limit: 1000
}
Node.js RETS Client
Node.js RETS client is a RETS client written for node.js. It can be found on Github New Window or via npm New Window.
var rets = require('rets-client');
var clientSettings = {
loginUrl: 'https://api-trestle.corelogic.com/trestle/rets/login',
username: 'client_id',
password: 'client_secret',
version: 'RETS/1.8',
};
rets.getAutoLogoutClient(clientSettings, function(client) {
// Node.js RETS Client defaults limit to NONE. You MUST set it to a value <=1000
return client.search.query('Property', 'Property', '(StandardStatus=|Active)', {limit: 1000, select: 'ListingKey'})
.then(function(searchData) {
});
});