Show HN: Trains.fyi – a live map of passenger trains in the US and Canada

A new project, Trains.fyi, visualizes the real-time locations of passenger trains across the US and Canada, highlighting both the technical possibilities of aggregating GTFS-RT and agency APIs and the gaps where data is hard to obtain. Commenters use the sparse map as a springboard to lament North America’s limited, slow, and often unreliable passenger rail—especially compared with Europe and Japan—while noting that the continent’s freight rail is dense and efficient but largely opaque to the public. The conversation ranges from implementation details and missing operators to broader debates over high‑speed rail economics, environmental benefits, and why other countries treat rail as core public infrastructure.

Project & Implementation

  • Trains.fyi shows live positions of passenger trains in the US/Canada using Leaflet with OSM/Carto/OpenRailwayMap tiles.
  • Data is primarily from GTFS-RT feeds; learning and normalizing that format across many agencies was described as the hardest part.
  • Location generally updates about once a minute and may be intentionally delayed or slightly inaccurate by some agencies.
  • Attribution for map and overlay providers was added after users pointed out licensing requirements.

Data Sources, Coverage & Gaps

  • Currently focused on intercity and commuter rail; local subways/metros and light rail are mostly excluded due to scope and complexity.
  • Uses a patchwork of public APIs (e.g., Amtrak, regional feeds, transit aggregators), but many systems are missing: NJ Transit, SEPTA, Denver RTD, Toronto/BC commuter lines, SMART, ACE, South Shore, West Coast Express, etc.
  • Some agencies’ APIs are hard to access, unreliable, obfuscated, or have waitlists, limiting completeness.
  • Several users note trains they see in real life aren’t on the map, suggesting partial coverage.

State of North American Passenger Rail

  • Viewers are struck by how few trains are visible and how large the gaps are, especially compared with population and geography.
  • Comments highlight slow speeds, poor punctuality, infrequent service (often 1–2 trains/day), awkward routings, and stations with poor access.
  • Freight trains usually have priority on shared tracks, contributing to delays and limiting expansion of passenger service.
  • Some argue intercity rail is only clearly viable in dense corridors (e.g., US Northeast; some Canadian segments).

International Comparisons

  • Numerous links to similar or richer live maps for the UK, much of Europe, Japan, India, Australia/NZ, and others show vastly denser service.
  • Shinkansen and European HSR are repeatedly cited as benchmarks: high frequency, city-center to city-center, minimal hassle, and high comfort.
  • Statistics posted show UK rail ridership several times higher than US ridership despite a much smaller population.

Freight Rail & Data

  • US/Canada freight rail is described as extensive, efficient, and dominant compared to passenger; some note passengers are a tiny fraction of train movements.
  • Several people want a freight equivalent of Trains.fyi, but note freight operators don’t expose live data.
  • Enthusiasts describe informal networks of SDR-based listeners and private servers, and that PTC/CAD systems do have detailed internal positions, but security/hazmat concerns and railroad policies prevent public access.
  • Debate over whether strong freight focus has crowded out potential for good passenger rail, versus simply reflecting geography and economics.

Climate, Economics & Policy

  • Some see expanded rail (especially HSR) as a major way to cut CO₂ compared to short/medium-haul flights; others note aviation is a small share of global emissions and HSR is expensive and politically difficult in the US.
  • California HSR and SF–LA service spark debate: one side calls it a boondoggle with poor cost recovery; others argue infrastructure shouldn’t be held to strict profitability, especially when roads and airports are heavily subsidized.
  • There is disagreement about how to value time, comfort, induced demand, and carbon pricing when comparing rail to flying.

Feature Requests & UX Feedback

  • Requested enhancements include:
    • Adding many missing agencies (commuter, regional, and subway systems).
    • Showing station stops and full routes for a selected train; possibly stats like “trains running now.”
    • Differentiating national vs regional operators via color, size, or shape; improving some color choices.
    • Minor UI tweaks (marker centering, clearer overlays, richer info windows, photos, occupancy data).
  • Some developers propose building derived route geometries from repeated GPS points and contributing additional tooling or analytics.