#listing #client #api-client #api #house #realtor

realtor-rs

Unofficial client for Canadian Realtor site

6 releases (breaking)

0.6.0 Apr 30, 2021
0.5.0 Apr 25, 2021
0.4.0 Apr 21, 2021
0.3.0 Apr 21, 2021
0.1.0 Apr 20, 2021

#2 in #house

CC-BY-NC-4.0

28KB
700 lines

An unofficial client for use with the Canadian Realtor site. Based off Foren's realtorca project.

Note: This cannot be used commercially in any capacity.

Disclaimer

This is very much a work in progress. There are no stability promises nor any validation of functional correctness included.

What might be working

Filters:

  • price range
  • longitude range
  • latitude range
  • ownership type
  • transaction type

Metadata:

  • paging through results
  • records per page (max of 200)

How to use

This provides syntactic sugar for building HTML form data specific to this one API. The output is Vec<(&'static str, String)>. This should be flexible enough to be consumed by any HTTP client, e.g. for reqwest it might look like:

use realtor_rs::realtor::filter::builder::FilterBuilder;
use reqwest::header::USER_AGENT;

let client = reqwest::Client::new();
let request_builder = client
  .post("https://api.realtor.ca/Listing.svc/PropertySearch_Post")
  .form(&FilterBuilder::new().build())
  .header(USER_AGENT, "realtor-rs v0.5.0")
  .send();

Dependencies

~0.7–1.6MB
~35K SLoC