Closed iwasrobbed closed 4 years ago
Just as a follow-up, the same technique works for Centris and other apps. Centris' API is a lot more cryptic with the key naming and I'm not sure if it has any additional inventory
hey thanks for the tip @iwasrobbed! I've known about charles but I didn't realize the implications for testing web vs mobile endpoints. Also had no idea that realtor.ca had mobile apps.
This listing information is pretty useful, I believe @younglee327 was also interested in this.
It's definitely much, much easier to work backwards from mobile apps versus trying to find endpoints from web apps / Chrome inspector. Scraping HTML is pretty difficult as well so it's easier to just use the same JSON API that their apps are using (I'm building a mac app for personal use)
Have fun, gonna close out this issue. Thanks again for the initial work
More info on the required values:
ApplicationId
- must be 37. I assume this identifies that it's an app request
PropertyId
- the ID of the ad, as returned from the search API(or as found in the URL)
ReferenceId
- the MLS number
The other values are the same as if you make a request to the search API
Hi there,
Thanks for putting this together. It's easy enough to get the listings but I was having a more difficult time getting a listing's detail information
Charles Proxy is a decent tool to use for inspecting API calls for mobile apps (rather than HTML-based calls like web) https://www.charlesproxy.com/documentation/ios/ since it acts as a "man-in-the-middle" SSL root certificate so it can read all API requests, headers, etc. This makes it much easier to work backwards from what the iOS app is doing to better understand how to create an API wrapper for your own personal needs.
Note: this was for an anonymous session (no account signed up / logged in)
cURL equivalent (using Postman) with the minimal set of parameters needed to get a result:
That gives a response like:
Full dump of Charles response: