One widget. Three markets.
Drop a single 11KB JS file into any web page. The user's home address is cached in a cookie, so every page they visit on every site using commute.js shows their commute instantly.
Drop into property listing pages on Redfin, Zillow, Compass, or any IDX site. Shows the buyer's commute from home to this property across every mode.
<div class="cc-commute"
data-lat="40.3812"
data-lon="-74.186"
data-label="30 Bellan Dr, Monmouth Junction NJ"
data-variant="property"></div>
<script src="https://commutingcost.com/commute.js" async></script>data-variant— property | venue | jobdata-theme— light | darkdata-modes— comma list of modes (default: drive, park_and_ride, kiss_and_ride, uber_and_ride, transit)window.CC_API_KEY— pre-set API key for higher quotawindow.CC_HOME— host site can pre-fill home if already known
Charming colonial in West Windsor, walking distance to Princeton Junction NJT station.
How the cookie magic works
Widget asks user for home address. Pelias geocodes it. Lat/lon saved to cc_home cookie for 1 year.
Widget reads cc_home cookie, calls /v1/trip/plan with home → page-venue, renders results in 1.5s.
User visits Redfin, Ticketmaster, LinkedIn — all using commute.js from commutingcost.com. The cookie stays on the commutingcost.com domain, so every embed uses the same home automatically.