Embed Widget

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.

Real Estate / IDX Widget

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.

HTML to embed
<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>
Optional knobs
  • data-variant — property | venue | job
  • data-theme — light | dark
  • data-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 quota
  • window.CC_HOME — host site can pre-fill home if already known
Live preview
Sample listing page
30 Bellan Dr, Monmouth Junction NJ 08852
$649,000
4 BR · 3 BA · 2,800 sqft · 0.5 acre

Charming colonial in West Windsor, walking distance to Princeton Junction NJT station.

How the cookie magic works

1. First visit

Widget asks user for home address. Pelias geocodes it. Lat/lon saved to cc_home cookie for 1 year.

2. Every subsequent visit

Widget reads cc_home cookie, calls /v1/trip/plan with home → page-venue, renders results in 1.5s.

3. Cross-site

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.