|
The STM is making it possible for developers to download its bus and metro schedules in the General Transit Feed Specification (GTFS) format. This document describes the available data and a few STM specifications.
You must also review the legal notes defining the rules and context for using this data. For example, it is strictly forbidden to use the company logo without permission from the STM. You can consult these legal notes by clicking here.
STM data includes the following specifications:
For bus schedules
Schedules are for weekdays, Saturday, Sunday or legal holidays:
- Weekday service (Assignment list identifier code + S): Monday – Friday
- Saturday service (Assignment list identifier code + A): Saturday
- Sunday service (Assignment list identifier code + I): Sunday
- Holiday service (Assignment list identifier code + F1 or F2 or F3 or F4): Legal holidays
For metro schedules
Metro schedules are provided by way of indication only and are essentially used to determine how long a trip will take. They cannot be used to develop an application for metro timetables, as they are only used to estimate the time needed to travel between two stations.
GTFS_stm.zip contains the following files:
- Agency.txt : Basic information about the STM
- Stops.txt : List of bus stops
- Routes.txt : List of bus lines
- Trips.txt : Information about trip schedules
- Stop_times.txt : Schedule of arrival times at bus stops
- Calendar_dates.txt : List of days included in assignment period
- Fare_attributes.txt : List of various STM fares
- Fare_rules.txt : Explains different fares for regular service and airport shuttle
- Shapes.txt : Definition of rules for drawing a bus line itinerary on map
- Frequencies.txt : Defines the frequency of metro service
| File |
GTFS Specifications |
STM Data |
| agency.txt |
Required |
Available |
| calendar_dates.txt |
Optional |
Available |
| fare_attributes.txt |
Optional |
Available |
| fare_rules.txt |
Optional |
Available |
| routes.txt |
Required |
Available |
| shapes.txt |
Optional |
Available |
| stop_times.txt |
Required |
Available |
| stops.txt |
Required |
Available |
| trips.txt |
Required |
Available |
| frequencies.txt |
Optional |
Available |

Google Reference:
https://developers.google.com/transit/gtfs/reference
File Agency.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| agency_id |
STM identifier for Google |
3 |
Optional |
Available |
| agency name |
STM name |
40 |
Required |
Available |
| agency_url |
STM web site address |
60 |
Required |
Available |
| agency_timezone |
Time zone for STM |
20 |
Required |
Available |
| agency_lang |
Official language used by STM |
10 |
Optional |
Available |
Example:
agency_id,agency_name,agency_url,agency_timezone,agency_lang
STM,Société de transport de Montréal,http://www.stm.info/,America/Montreal,fr
File stops.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| stop_id |
STM bus stop identifier |
8 |
Required |
Available |
| stop_code |
Bus stop code for customers |
5 |
Optional |
Available |
| stop_name |
Description of bus stop for customers |
50 |
Required |
Available |
| stop_lat |
Latitude |
10 |
Required |
Available |
| stop_long |
Longitude |
10 |
Required |
Available |
| Stop_url |
STM web site (for bus stop info) |
60 |
Optional |
Available |
Example:
stop_id,stop_code,stop_name,stop_lat,stop_lon,stop_url,location_type,parent_station
65,10222,Station Côte-Vertu,45.514141,-73.682861,http://www.stm.info/metro/M65.htm,1,
66,10282,Station Cartier,45.560353,-73.681961,http://www.stm.info/metro/M66.htm,1,
67,10286,Station De la Concorde,45.560845,-73.709646,http://www.stm.info/metro/M67.htm,1,
68,10288,Station Montmorency,45.557976,-73.721346,http://www.stm.info/metro/M68.htm,1,
100323,50101,Louis-Hippolyte-La Fontaine / Curatteau,45.594049,-73.54257,http://www2.stm.info/horaires/frmResult.aspx?Langue=Fr&Arret=50101,0,
100360,50102,Saint-Jacques / No 6640,45.460519,-73.625771,http://www2.stm.info/horaires/frmResult.aspx?Langue=Fr&Arret=50102,0,
100370,50103,Saint-Jacques / No 6710,45.458952,-73.626956,http://www2.stm.info/horaires/frmResult.aspx?Langue=Fr&Arret=50103,0,
100664,50104,Jean-Talon / Wilderton,45.513617,-73.632229,http://www2.stm.info/horaires/frmResult.aspx?Langue=Fr&Arret=50104,0,
100782,50105,Station Viau,45.560897,-73.547212,http://www2.stm.info/horaires/frmResult.aspx?Langue=Fr&Arret=50105,0,23
File routes.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| route_id |
Specific line number |
3 |
Required |
Available |
| agency_id |
Agency code |
3 |
Optional |
Available |
| route_short_name |
Short name |
10 |
Required |
Available |
| route_long_name |
Long name |
40 |
Required |
Available |
| Route_type |
Type of service on line (bus or metro) |
10 |
Required |
Available |
| Route_url |
Link for bus line in STM.info web site |
n/d |
Optional |
Available |
| Route_Color |
Colour of line |
6 |
Optional |
Métro only |
| Route_Text_Color |
Colour of text for line |
6 |
Optional |
Métro only |
Example:
route_id,agency_id,route_short_name,route_long_name,route_type,route_url,route_color,route_text_color
1,STM,1,VERTE,1,http://www.stm.info/metro/frequence.htm#ligne1,00B300,000000
2,STM,2,ORANGE,1,http://www.stm.info/metro/frequence.htm#ligne2,D95700,000000
4,STM,4,JAUNE,1,http://www.stm.info/metro/frequence.htm#ligne4,FFD900,000000
5,STM,5,BLEU,1,http://www.stm.info/metro/frequence.htm#ligne5,0095E6,000000
10,STM,10,De Lorimier,3,http://www.stm.info/bus/geomet/geo10.htm,,
11,STM,11,Montagne,3,http://www.stm.info/bus/geomet/geo11.htm,,
12,STM,12,Île-des-Soeurs,3,http://www.stm.info/bus/geomet/geo12.htm,,
File trips.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| route_id |
Specific line number |
8 |
Required |
Available |
| Service_id |
Code for type of service |
5 |
Required |
Available |
| Trip_id |
Specific code for each trip |
20 |
Required |
Available |
| trip_headsign |
Trip destination |
50 |
Optional |
Available |
Example:
route_id,service_id,trip_id,trip_headsign
1,11N_S,11N_11N_S_1_1_0.22917,Station Honoré-Beaugrand
1,11N_S,11N_11N_S_1_10_0.27292,Station Angrignon
1,11N_S,11N_11N_S_1_19_0.31528,Station Honoré-Beaugrand
File stop_times.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| trip_id |
Specific code for each trip |
20 |
Required |
Available |
| arrival_time |
Arrival times at stop |
8 |
Required |
Available |
| departure_time |
Departure time from stop (the same) |
8 |
Required |
Available |
| stop_id |
STM bus stop identifier |
8 |
Required |
Available |
| stop_sequence |
Sequence of bus stop |
3 |
Required |
Available |
Example:
trip_id,arrival_time,departure_time,stop_id,stop_sequence
11N_11N_S_1_7_0.23611,05:39:59,05:39:59,43,01
11N_11N_S_1_7_0.23611,05:41:00,05:41:00,42,02
11N_11N_S_1_7_0.23611,05:42:59,05:42:59,41,04
File calendar_dates.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| service_id |
Code for type of service |
3 |
Required |
Available |
| date |
Date of service |
8 |
Required |
Available |
| Exception_type |
Availability of service |
1 |
Required |
Available |
Example:
service_id,date,exception_type
11N_S,20111031,1
11N_S,20111101,1
11N_S,20111102,1
File fare_attributes.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| fare_id |
Specific identifier |
15 |
Required |
Available |
| Price |
Price per trip |
5 |
Required |
Available |
| currency_type |
Type of currency |
3 |
Required |
Available |
| payment_method |
Method of payment |
1 |
Required |
Available |
| transfers |
Number of transfers allowed |
1 |
Required |
Not Available |
| transfer_duration |
Duration of each transfer |
4 |
Optional |
Available |
Example:
fare_id,price,currency_type,payment_method,transfers,transfer_duration
tarif_regulier,3.00,CAD,0,,7200
tarif_747,8.00,CAD,0,,7200
File fare_rules.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| fare_id |
Specific identifier |
15 |
Required |
Available |
| route_id |
Specific line number |
8 |
Required |
Available |
| origin_id |
Point of departure identifier |
n/d |
Optional |
Not Available |
| destination_id |
Destination identifier |
n/d |
Optional |
Not Available |
| contains_id |
Bus stop area identifier |
n/d |
Optional |
Not Available |
Example:
fare_id,route_id,origin_id,destination_id,contains_id
tarif_regulier,1,,,
tarif_747,747,,,
File Shapes.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| shape_id |
Specific identifier |
15 |
Required |
Available |
| shape_pt_lat |
Latitude |
10 |
Required |
Available |
| shape_pt_lon |
Longitude |
10 |
Required |
Available |
| shape_pt_sequence |
Sequence |
4 |
Required |
Available |
Example:
shape_id,shape_pt_lat,shape_pt_lon,shape_pt_sequence
11UV-372-SO-E,45.513617,-73.632229,13
11UV-372-LC-E,45.513617,-73.632229,13
11U-92-JO-E,45.513617,-73.632229,18
Frequencies.txt
| Field Name |
Description |
Length |
GTFS Specifications |
STM Data |
| trip_id |
Specific code for each trip |
20 |
Required |
Metro only |
| start_time |
Time at which trip starts |
8 |
Required |
Metro only |
| end_time |
Time at which trip ends |
8 |
Required |
Metro only |
| headway_secs |
Intervals in seconds |
3 |
Required |
Metro only |
Example:
trip_id,start_time,end_time,headway_secs
12J_12J_S_1_1_0.22917,05:30:00,05:40:00,600
12J_12J_S_1_19_0.31528,07:07:00,07:43:00,180
12J_12J_S_1_37_0.40000,09:21:00,09:46:00,300
12J_12J_S_1_8_0.47778,09:46:00,15:04:00,360
12J_12J_S_1_19_0.55278,09:46:00,15:04:00,360
12J_12J_S_1_30_0.62778,15:04:00,15:19:00,300
12J_12J_S_1_5_0.71042,15:49:00,17:10:00,180
|