Recommended providers
Google Routes API, Mapbox Directions API, HERE Routing, TomTom Routing or OpenRouteService can supply road distance, duration, traffic, toll and route summaries subject to each provider's terms.
This static package includes a browser estimator. For production road-routing, connect a licensed provider through a secure backend and keep API keys outside public JavaScript where possible.
Google Routes API, Mapbox Directions API, HERE Routing, TomTom Routing or OpenRouteService can supply road distance, duration, traffic, toll and route summaries subject to each provider's terms.
Restrict API keys by domain, store secrets in environment variables, add rate limiting, validate requests server-side and never expose unrestricted production keys in frontend code.