Access transit data for the Montréal metropolitan area: STM bus and metro
schedules, real-time positions, BIXI bike sharing, Exo commuter trains,
and regional transit feeds.
/ Accéder aux données de transport de la région métropolitaine de Montréal :
horaires STM bus et métro, positions en temps réel, vélopartage BIXI,
trains de banlieue Exo et données de transport régional.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Access transit data for the Montréal metropolitan area: STM bus and metro
schedules, real-time positions, BIXI bike sharing, Exo commuter trains,
and regional transit feeds.
/ Accéder aux données de transport de la région métropolitaine de Montréal :
horaires STM bus et métro, positions en temps réel, vélopartage BIXI,
trains de banlieue Exo et données de transport régional.
import requests, math
# Get all station info and status
stations = requests.get('https://gbfs.velobixi.com/gbfs/en/station_information.json').json()
status = requests.get('https://gbfs.velobixi.com/gbfs/en/station_status.json').json()
# Build status lookup
status_map = {s['station_id']: s for s in status['data']['stations']}
# User's location (example: Place des Arts)
user_lat, user_lon = 45.5081, -73.5664# Find 5 nearest stations with bikesdefdistance(lat1, lon1, lat2, lon2):
return math.sqrt((lat1-lat2)**2 + (lon1-lon2)**2)
results = []
for stn in stations['data']['stations']:
st = status_map.get(stn['station_id'], {})
bikes = st.get('num_bikes_available', 0)
docks = st.get('num_docks_available', 0)
dist = distance(user_lat, user_lon, stn['lat'], stn['lon'])
results.append((dist, stn['name'], bikes, docks))
results.sort()
for dist, name, bikes, docks in results[:5]:
print(f"{name}: {bikes} bikes, {docks} docks available")
Coverage: 8,000+ bikes, 610+ stations across Montréal, Laval, Longueuil, Westmount, Ville de Mont-Royal, Montréal-Est.
Seasonal: BIXI typically operates April–November. Winter data shows stations with 0 availability.
Historical Trip Data (on CKAN)
Dataset:bixi-historique-des-deplacementsContent: Every trip taken — start/end station, start/end time, duration.
Format: CSV, updated annually.
Use for: Usage patterns, demand analysis, station sizing.
Coverage: 6 commuter train lines (Candiac, Mascouche, Mont-Saint-Hilaire, Saint-Jérôme, Vaudreuil-Hudson, Deux-Montagnes/REM) plus regional bus networks in suburbs.
Real-Time (Limited)
Available for: Commuter trains only (not buses)
Access: Submit request via form on Exo website
Formats: GTFS-Realtime + TCIP
4. STL — Société de transport de Laval
Portal:https://stlaval.ca/about-us/public-information/open-dataCoverage: Laval (adjacent to Montréal, connected via metro Orange line to Montmorency)
Feeds: GTFS static (public download)
Real-time: Not publicly available as of March 2026
Common Questions / Questions fréquentes
"When is the next bus at my stop?"
Identify the stop (by name, stop_id, or nearest to coordinates)
If you have a real-time API key → query GTFS-RT Trip Updates
If no API key → parse static GTFS stop_times.txt for the current service day
"How do I get from A to B?"
This requires a trip planner, which combines GTFS from multiple agencies. Recommend users use:
Transit app (transitapp.com) — uses all Montréal agencies
Google Maps / Apple Maps — integrated GTFS
Chrono (ARTM's app) — metropolitan scope
Building a trip planner from raw GTFS is complex (requires graph algorithms). The skill covers data access, not routing.
"Is my bus delayed?"
Requires real-time GTFS-RT feed (STM API key needed). Compare scheduled arrival (stop_times.txt) with predicted arrival (Trip Updates feed).
"How busy is BIXI station X?"
Query GBFS station_status.json — fully public, no auth needed. Compare num_bikes_available to the station's total capacity from station_information.json.
"What metro lines are affected by construction?"
Query STM GTFS-RT Service Alerts feed (API key required). Or check donnees.montreal.ca for stm-perturbations dataset if available.
Gotchas & Edge Cases / Pièges et cas limites
GTFS-Realtime is Protocol Buffers, not JSON. You need gtfs-realtime-bindings or equivalent library. Cannot be consumed with curl alone.
STM API key is free but not instant. Registration on the developer portal may take a business day. Plan accordingly.
Exo GTFS URLs change. The download URL pattern includes an agency code (citl, citpi, etc.) that may shift. Always start from the Exo portal page.
BIXI is seasonal. April–November typically. Winter queries will return 0 bikes everywhere.
Stop IDs are agency-specific. STM stop 51234 and Exo stop 51234 are different stops. Always include agency context.
Coordinate systems: GTFS uses WGS84 (lat/lon). The CKAN Shapefile of bus stops uses NAD 83 MTM Zone 8. Convert if mixing sources.
REM (Réseau express métropolitain): The new automated light metro has been gradually opening. Its data may appear under Exo or a separate feed. Check for updates.
Provenance / Provenance
This skill spans multiple data tiers and publishers:
When citing transit data: Always specify which agency provided the data. "The STM reports..." or "According to BIXI station data..." — not "The city says..."
Related Skills / Compétences connexes
discover-datasets — Find transit datasets on CKAN
borough-context — Map stops to boroughs
spatial-queries — "Nearest bus stop to my location"