Pre-built code blocks

MLS listings for a real estate site

MLS listings over the RESO Web API: search, detail, replication and a home-value estimate, no vendor SDK

For when the answer to “It shows real estate listings from an MLS” is yes.

Puts live MLS listings on a real estate site straight from the RESO Web API (Trestle, Bridge, MLS Grid, Spark) with the IDX display rules enforced in code, so no page can show an opted-out address or a listing the seller kept off the…

Skip the rebuild

You do not write this one. It arrives in your project as ordinary source you can read, change and keep, with its audit record and its caveats beside it.

  1. Download the Playground. It is free and runs on your own machine.
  2. Start a new app and tick “It shows real estate listings from an MLS”.
  3. This block is written in, along with anything else you ticked.

Download the Playground See the other blocks

The mistake it removes

The naive version pastes visitor input into $filter (OData injection), follows a server-supplied nextLink to another host with the bearer token attached, requests private agent fields that then leak into a page, or bursts past the MLS's rate limit and gets the feed suspended.

What is already handled

Each of these was checked by running the code, not by reading it.

What you still have to do

A copied file cannot own your secrets, your host or your legal obligations. This is the part the block deliberately does not claim.

What lands in your project

node

  • node/reso.js
  • node/listings.js
  • node/valuation.js
  • node/json-store.js
  • node/reso-query.mjs
  • node/MLS-SETUP.md

Install into one server directory; the files import each other as ./reso.js and ./json-store.js. listings.js: search(market, criteria), getListing(market, key), stats(market, {city}), replicate(market), parseCriteria(query). valuation.js: estimate({market, zip, sqft}). reso-query.mjs is a CLI for --fields, --count and raw queries. MLS-SETUP.md is the credential and compliance checklist.

What you supply

Licensed MIT. It is a starting point, not a finished product.

Get it

Download the Playground See the other blocks

Nothing here is locked. The files are yours, in your folder, under a permissive license.

Questions

Is MLS listings for a real estate site audited?
No. No full audit has been run against this block yet, which is not the same as a pass. What is verified about it is listed on this page, and what is not is listed beside it.
What do I still have to do myself?
Render the MLS's own disclaimer text, its logo if the rules require one, the listing office name with its phone or email on every card, and the fetchedAt time as 'last updated'. The block carries each of these values on every result; it cannot put them on your page.
How do I get this code?
Download the Playground, start a new app, and tick “It shows real estate listings from an MLS”. The block is written into your project as ordinary source you can read and edit.

All pre-built code blocks · Learn to build from zero · The coding guide