Documentation

Getting Started

To access the OC Transpo Live Next Bus Arrival Data Feed, you will need an API key. Register and receive an API key instantly using the API registration form.

  1. Follow this link to register: https://octranspo-new.3scale.net/signup
  2. Once you have provided your name and contact information, we will send you an email with a link to activate your account. Follow the instructions to activate the account, sign in and generate a new Application ID by clicking on the applications section of the Dashboard.
  3. For security purposes, you will be asked for your Application ID and API key with each request.

Description of Methods

  1. GetRouteSummaryForStop: Retrieves the routes for a given stop number.
  2. GetNextTripsForStop: Retrieves next three trips on the route for a given stop number.
  3. GetNextTripsForStopAllRoutes: Retrieves next three trips for all routes for a given stop number.
  4. GTFS: Retrieves specific records from all sections the of GTFS file.

1) GetRouteSummaryForStop

Retrieves the routes for a given stop number

URL: https://api.octranspo1.com/v1.2/GetRouteSummaryForStop

Parameters:

  • appID: Required.?Generated in the developer portal after registration.
  • apiKey: Required. Generated in the developer portal after registration.
  • stopNo: Required. 4-digit stop number found on bus stops. A full list of stops can be downloaded here: http://www.octranspo1.com/files/google_transit.zip

Usage:

curl -d "appID={appID}&apiKey={apiKey}&stopNo=7659" https://api.octranspo1.com/v1.2/GetRouteSummaryForStop

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.


POST /v1.2/GetRouteSummaryForStop HTTP/1.1
Host: localhost
Content-Type: application/x-www-form-urlencoded
Content-Length: length


stopNo=string
HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Body>
		<GetRouteSummaryForStopResponse xmlns="http://octranspo.com">
			<GetRouteSummaryForStopResult>
				<StopNo xmlns="http://tempuri.org/">string</StopNo>
				<StopDescription 
				 xmlns="http://tempuri.org/">string</StopDescription>
				<Error xmlns="http://tempuri.org/">string</Error>
				<Routes xmlns="http://tempuri.org/">
					<Route>
						<RouteNo>int</RouteNo>
						<DirectionID>int</DirectionID>
						<Direction>string</Direction>
						<RouteHeading>string</RouteHeading>
					</Route>
					<Route>
						<RouteNo>int</RouteNo>
						<DirectionID>int</DirectionID>
						<Direction>string</Direction>
						<RouteHeading>string</RouteHeading>
					</Route>
				</Routes>
			</GetRouteSummaryForStopResult>
		</GetRouteSummaryForStopResponse>
	</soap:Body>
</soap:Envelope>

Bus Type Formats

Here is the list of bus types with different letters: 4,6,40,60,DD, E,EA, A, L, B, DEH

4 or 40 = 40-foot buses
6 or 60 = 60-foot buses
4 and 6 = trips can be done by 60 or 40-foot buses
DD = Double-Decker buses
E, L, A, EA means low-floor Easy Access
B = Bike Rack
DEH = Diesel Electric Hybrid
IN = INVIRO (bus type)
ON = ORION (bus type)

Adjustment Age

AdjustmentAge indicates the last time (in minutes and adjusted in whole and fractional minutes) when the GPS data available for the bus was used to determine the AdjustedScheduleTime. The higher the number the less reliable the AdjustedScheduleTime is.

If the AdjustmentAge is a negative value, it indicates that the AdjustedScheduleTime contains the planned scheduled time.

Possible Error codes for: <Error>string</Error>

Error	Note
1	Invalid API key
2	Unable to query data source
10	Invalid stop number
11      Invalid route number
12      Stop does not service route

XML Format Description


<!--Response to the web method GetRouteSummaryForStop-->
<RoutesForStopData>
	<!--Errors if any for the request made.-->
	<Error>string</Error>
	<RouteSummaryData>
	<!--Route number-->
	<RouteNo>int</RouteNo>
	<Directions>
	  <!--First direction-->
	  <DirectionData>
		<!--Direction identifier. e.g. 0 = Eastbound, 1 = WestBound-->
		<DirectionId>int</DirectionId>
		<!--The route & direction heading-->
		<RouteHeading>string</RouteHeading>
		<!--Direction description e.g. Inbound / Outbound-->
		<DirDescription>string</DirDescription>
	  </DirectionData>
	  <!--Second direction-->
	  <DirectionData>
		<!--Direction identifier. e.g. 0 = Eastbound, 1 = WestBound-->
		<DirectionId>int</DirectionId>
		<!--The route & direction heading-->
		<RouteHeading>string</RouteHeading>
		<!--Direction description e.g. Inbound / Outbound-->
		<DirDescription>string</DirDescription>
	  </DirectionData>
	</Directions>
	</RouteSummaryData>
</RoutesForStopData>

Sample data for stop 3017.

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<soap:Body>
		<GetRouteSummaryForStopResponse xmlns="http://octranspo.com">
			<GetRouteSummaryForStopResult>
			<StopNo xmlns="http://tempuri.org/">3017</StopNo>
			<StopDescription xmlns="http://tempuri.org/">BASELINE</StopDescription>
			<Error xmlns="http://tempuri.org/" />
			<Routes xmlns="http://tempuri.org/">
				<Route>
					<RouteNo>57</RouteNo>
					<DirectionId>0</DirectionId>
					<Direction>Inbound</Direction>
					<RouteHeading>Downtown / centre-ville</RouteHeading>
				</Route>
				<Route>
					<RouteNo>57</RouteNo>
					<DirectionId>1</DirectionId>
					<Direction>Outbound</Direction>
					<RouteHeading>Baseline</RouteHeading>
				</Route>
				<Route>
					<RouteNo>70</RouteNo>
					<DirectionId>0</DirectionId>
					<Direction>Inbound</Direction>
					<RouteHeading>Downtown / centre-ville</RouteHeading>
				</Route>
				<Route>
					<RouteNo>70</RouteNo>
					<DirectionId>1</DirectionId>
					<Direction>Outbound</Direction>
					<RouteHeading>Barrhaven</RouteHeading>
				</Route>
				<Route>
					<RouteNo>71</RouteNo>
					<DirectionId>0</DirectionId>
					<Direction>Inbound</Direction>
					<RouteHeading>Downtown / Centre-ville</RouteHeading>
				</Route>
				<Route>
					<RouteNo>71</RouteNo>
					<DirectionId>1</DirectionId>
					<Direction>Outbound</Direction>
					<RouteHeading>Barrhaven</RouteHeading>
				</Route>
				<Route>
					<RouteNo>73</RouteNo>
					<DirectionId>0</DirectionId>
					<Direction>Inbound</Direction>
					<RouteHeading>Downtown / centre-ville</RouteHeading>
				</Route>
				<Route>
					<RouteNo>73</RouteNo>
					<DirectionId>1</DirectionId>
					<Direction>Outbound</Direction>
					<RouteHeading>Barrhaven</RouteHeading>
				</Route>
				<Route>
					<RouteNo>76</RouteNo>
					<DirectionId>0</DirectionId>
					<Direction>Inbound</Direction>
					<RouteHeading>Downtown / centre-ville</RouteHeading>
				</Route>
				<Route>
					<RouteNo>76</RouteNo>
					<DirectionId>1</DirectionId>
					<Direction>Outbound</Direction>
					<RouteHeading>Barrhaven</RouteHeading>
				</Route>
				<Route>
					<RouteNo>77</RouteNo>
					<DirectionId>0</DirectionId>
					<Direction>Inbound</Direction>
					<RouteHeading>Downtown / centre-ville</RouteHeading>
				</Route>
			</Routes>
			</GetRouteSummaryForStopResult>
		</GetRouteSummaryForStopResponse>
	</soap:Body>
</soap:Envelope>

2) GetNextTripsForStop

Retrieves next three trips on the route for a given stop number

URL: https://api.octranspo1.com/v1.2/GetNextTripsForStop

Parameters:

  • appID: Required.??Generated in the developer portal after registration.
  • apiKey: Required. Generated in the developer portal after registration.
  • routeNo: Required. Bus route number.
  • stopNo: Requited. 4-digit stop number found on bus stops. A full list of stops can be downloaded here: http://data.ottawa.ca/dataset/oc-transpo-schedules

Usage:

curl -d "appID={appID}&apiKey={apiKey}&routeNo=1&stopNo=7659" https://api.octranspo1.com/v1.2/GetNextTripsForStop

HTTP POST

The following is a sample HTTP POST request and response. The placeholders shown need to be replaced with actual values.


HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
	<soap:Body>
		<GetRouteSummaryForStopResponse xmlns="http://octranspo.com">
			<GetRouteSummaryForStopResult>
				<StopNo xmlns="http://tempuri.org/">string</StopNo>
				<StopDescription 
				 xmlns="http://tempuri.org/">string</StopDescription>
				<Error xmlns="http://tempuri.org/">string</Error>
				<Routes xmlns="http://tempuri.org/">
					<Route>
						<RouteNo>int</RouteNo>
						<DirectionID>int</DirectionID>
						<Direction>string</Direction>
						<RouteHeading>string</RouteHeading>
					</Route>
					<Route>
						<RouteNo>int</RouteNo>
						<DirectionID>int</DirectionID>
						<Direction>string</Direction>
						<RouteHeading>string</RouteHeading>
					</Route>
				</Routes>
			</GetRouteSummaryForStopResult>
		</GetRouteSummaryForStopResponse>
	</soap:Body>
</soap:Envelope>

Possible Error codes for <Error>:

Error	Note
2	Unable to query data source

XML Format Description

<!--Retrieve the next 3 trips for a specific route in a specific direction to pass by the stop. 
	The following is a sample request and response. 
	The placeholders shown need to be replaced with actual values.-->


<!--Response-->
<STOPINFO>
	<!--4 digit stop number-->
	<STOPNO>int</STOPNO>
	<!--Stop description-->
	<STOPLABEL>string</STOPLABEL>
	<!--Errors if any while generating data the stop. i.e. Invalid stop number-->
	<Error>string</Error>
	<Routes>
		<Route>
			<!--Route number-->
			<Route>int</Route>
			<!--Route description-->
			<RouteLabel>string</RouteLabel>
			<!--Trip direction i.e. NorthBound/SouthBound-->
			<Direction>string</Direction>
			<!--Errors if any while generating data the route. 
			 i.e. Route does not pass the stop specified-->
			<Error>string</Error>
			<!--Time the request was processed. This will be using the format 
			 'YYYYMMDDHHMISS' where HH = 24 hour format-->
			<RequestProcessingTime>string</RequestProcessingTime> 
			<Trips>
				<!--First Trip-->
				<Trip>
					<!--Final stop on the trip--> 
					<TripDestination>string</TripDestination> 
					<!--start time for the trip. Format HH:MI, 
					 where HH = 24 hour format-->
					<TripStartTime>string</TripStartTime>		
					<!--adjusted scheduled time in minutes-->
				<AdjustedScheduleTime>string</AdjustedScheduleTime> 
					<!--The time since the scheduled was adjusted 
					 in whole and fractional minutes. -->
					<AdjustmentAge>string</AdjustmentAge>
					<!--last trip to pass the stop for 
					 the route & direction-->
					<LastTripOfSchedule>boolean</LastTripOfSchedule> 
					<!--type of bus : low floor, bike rack etc.-->
					<BusType>string</BusType> 	
<!--speed of the bus in km/hr-- >
					<GPSSpeed>int</GPSSpeed>
					<!--Latitude of the last gps reading for the bus-->
					<Latitude></Latitude>
<!--Longitude of the last gps reading for the bus-->
					<Longitude></Longitude>
				</Trip>
				<!--Second Trip-->
				<Trip>
					<!--Final stop on the trip--> 
					<TripDestination>string</TripDestination> 
					<!--start time for the trip-->
					<TripStartTime>string</TripStartTime>		
					<!--adjusted scheduled time in minutes-->
				<AdjustedScheduleTime>string</AdjustedScheduleTime> 
					<!--The time since the scheduled was adjusted 
					 in whole and fractional minutes-->
					<AdjustmentAge>string</AdjustmentAge>
					<!--last trip to pass the stop 
					 for the route & direction-->
					<LastTripOfSchedule>boolean</LastTripOfSchedule> 
					<!--type of bus : low floor, bike rack etc.-->
					<BusType>string</BusType> 	
 					<!--speed of the bus in km/hr-- >
					<SPEED>int</SPEED>
					<!--Latitude of the last gps reading for the bus-->
					<Latitude></Latitude>
<!--Longitude of the last gps reading for the bus-->
					<Longitude></Longitude>
				</Trip>
<!--Third Trip-->
				<Trip>
					<!--Final stop on the trip--> 
					<TripDestination>string</TripDestination> 
					<!--start time for the trip-->
					<TripStartTime>string</TripStartTime>		
					<!--adjusted scheduled time in minutes-->
				<AdjustedScheduleTime>string</AdjustedScheduleTime> 
					<!--The time since the scheduled was adjusted 
					 in whole and fractional minutes-->
					<AdjustmentAge>string</AdjustmentAge>
					<!--last trip to pass the stop 
					 for the route & direction-->
					<LastTripOfSchedule>boolean</LastTripOfSchedule> 
					<!--type of bus : low floor, bike rack etc.-->
					<BusType>string</BusType> 	
 					<!--speed of the bus in km/hr-- >
					< GPSSPEED >int</ GPSSPEED >
					<!--Latitude of the last gps reading for the bus-->
					<Latitude></Latitude>
<!--Longitude of the last gps reading for the bus-->
					<Longitude></Longitude>
				</Trip>

			</Trips>
		</Route>
	</Routes>
</STOPINFO>
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" 
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<soap:Body>
<GetNextTripsForStopResponse xmlns="http://octranspo.com">
<GetNextTripsForStopResult>
	<StopNo xmlns="http://tempuri.org/">3017</StopNo>
	<StopLabel xmlns="http://tempuri.org/">BASELINE</StopLabel>
	<Error xmlns="http://tempuri.org/" />
	<Route xmlns="http://tempuri.org/">
		<RouteDirection>
			<RouteNo>95</RouteNo>
			<RouteLabel>Orl?ans</RouteLabel>
			<Direction>Eastbound</Direction>
			<Error />
			<RequestProcessingTime>20120213151218</RequestProcessingTime>
			<Trips>
				<Trip>
					<TripDestination>Trim</TripDestination>
					<TripStartTime>14:59</TripStartTime>
					<AdjustedScheduleTime>2</AdjustedScheduleTime>
					<AdjustmentAge>0.53</AdjustmentAge>
					<LastTripOfSchedule>false</LastTripOfSchedule>
					<BusType>6E - 60</BusType>
					<GPSSpeed>46.68</GPSSpeed>
					<Latitude>45.372693</Latitude>
					<Longitude>-75.734738</Longitude>
				</Trip>
				<Trip>
					<TripDestination>Place d'Orl?ans</TripDestination>
					<TripStartTime>15:22</TripStartTime>
					<AdjustedScheduleTime>10</AdjustedScheduleTime>
					<AdjustmentAge>-1</AdjustmentAge>
					<LastTripOfSchedule>false</LastTripOfSchedule>
					<BusType>6E - 60</BusType>
					<Speed>46.68</Speed>
					<Latitude>45.372693</Latitude>
					<Longitude>-75.734738</Longitude>
				</Trip>
				<Trip>
					<TripDestination>Trim</TripDestination>
					<TripStartTime>15:09</TripStartTime>
					<AdjustedScheduleTime>16</AdjustedScheduleTime>
					<AdjustmentAge>0.73</AdjustmentAge>
					<LastTripOfSchedule>false</LastTripOfSchedule>
					<BusType>6E - 60</BusType>
					<GPSSpeed>46.68</GPSSpeed>
					<Latitude>45.372693</Latitude>
					<Longitude>-75.734738</Longitude>
				</Trip>
			</Trips>
		</RouteDirection>
		<RouteDirection>
			<RouteNo>95</RouteNo>
			<RouteLabel>Barrhaven Centre</RouteLabel>
			<Direction>Westbound</Direction>
			<Error />
			<RequestProcessingTime>20120213151218</RequestProcessingTime>
			<Trips>
				<Trip>
					<TripDestination>Barrhaven Centre</TripDestination>
					<TripStartTime>14:25</TripStartTime>
					<AdjustedScheduleTime>7</AdjustedScheduleTime>
					<AdjustmentAge>0.67</AdjustmentAge>
					<LastTripOfSchedule>false</LastTripOfSchedule>
					<BusType>6E - 60</BusType>
					<GPSSpeed>46.68</GPSSpeed>
					<Latitude>45.372693</Latitude>
					<Longitude>-75.734738</Longitude>
				</Trip>
				<Trip>
					<TripDestination>Barrhaven Centre</TripDestination>
					<TripStartTime>14:55</TripStartTime>
					<AdjustedScheduleTime>9</AdjustedScheduleTime>
					<AdjustmentAge>0.55</AdjustmentAge>
					<LastTripOfSchedule>false</LastTripOfSchedule>
					<BusType>6E - 60</BusType>
					<Speed>46.68</Speed>
					<Latitude>45.372693</Latitude>
					<Longitude>-75.734738</Longitude>
				</Trip>
				<Trip>
					<TripDestination>Barrhaven Centre</TripDestination>
					<TripStartTime>14:35</TripStartTime>
					<AdjustedScheduleTime>18</AdjustedScheduleTime>
					<AdjustmentAge>0.82</AdjustmentAge>
					<LastTripOfSchedule>false</LastTripOfSchedule>
					<BusType>6E - 60</BusType>
					<GPSSpeed>46.68</GPSSpeed>
					<Latitude>45.372693</Latitude>
					<Longitude>-75.734738</Longitude>
				</Trip>
			</Trips>
		</RouteDirection>
	</Route>
</GetNextTripsForStopResult>
</GetNextTripsForStopResponse>
</soap:Body>
</soap:Envelope>

3) GetNextTripsForStopAllRoutes

Retrieves next three trips for all routes for a given stop number.

URL: https://api.octranspo1.com/v1.2/GetNextTripsForStopAllRoutes

Parameters:

appID
Required. Generated in the developer portal after registration.
apiKey
Required. Generated in the developer portal after registration.
stopNo
Required. 4-digit stop number found on bus stops. A full list of stops can be downloaded here: http://ottawa.ca/online_services/opendata/info/transit_schedule_en.html
format
Optional. Format of the returned data. JSON or XML Default: XML

Usage

curl -d "appID={appID}&apiKey={apiKey}&stopNo=7659&format=json" https://api.octranspo1.com/v1.2/GetNextTripsForStopAllRoutes

XML Format Description

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
 xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
 xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
    <soap:Body>
        <GetRouteSummaryForStopResponse xmlns="http://octranspo.com">
            <GetRouteSummaryForStopResult>
                <StopNo xmlns="http://tempuri.org/">string</StopNo>
                <StopDescription 
                 xmlns="http://tempuri.org/">string</StopDescription>
                <Error xmlns="http://tempuri.org/">string</Error>
                <Routes xmlns="http://tempuri.org/">
                    <Route>
                        <RouteNo>int</RouteNo>
                        <DirectionID>int</DirectionID>
                        <Direction>string</Direction>
                        <RouteHeading>string</RouteHeading>
                        <Trips>
                            <!--First Trip-->
                            <Trip>
                                <!--Final stop on the trip--> 
                                <TripDestination>string
                                </TripDestination> 
                                <!--start time for the trip. Format HH:MI, 
                                 where HH = 24 hour format-->
                                <TripStartTime>string</TripStartTime>        
                                <!--adjusted scheduled time in minutes-->
                                <AdjustedScheduleTime>string</AdjustedScheduleTime>
                                <!--The time since the scheduled was adjusted 
                                 in whole and fractional minutes. -->
                                <AdjustmentAge>string</AdjustmentAge>
                                <!--last trip to pass the stop for 
                                 the route & direction-->
                                <LastTripOfSchedule>boolean</LastTripOfSchedule> 
                                <!--type of bus : low floor, bike rack etc.-->
                                <BusType>string</BusType>     
                                <!--speed of the bus in km/hr-- >
                                <GPSSpeed>int</GPSSpeed>
                                <!--Latitude of the last 
                                gps reading for the bus-->
                                <Latitude></Latitude>
                                <!--Longitude of the last 
                                gps reading for the bus-->
                                <Longitude></Longitude>
                            </Trip>
                            <!--Second Trip-->
                            <Trip>
                                <!--Final stop on the trip--> 
                                <TripDestination>string</TripDestination> 
                                <!--start time for the trip-->
                                <TripStartTime>string</TripStartTime>        
                                <!--adjusted scheduled time in minutes-->
                                <AdjustedScheduleTime>string</AdjustedScheduleTime>
                                <!--The time since the scheduled was adjusted 
                                 in whole and fractional minutes-->
                                <AdjustmentAge>string</AdjustmentAge>
                                <!--last trip to pass the stop 
                                 for the route & direction-->
                                <LastTripOfSchedule>boolean</LastTripOfSchedule> 
                                <!--type of bus : low floor, bike rack etc.-->
                                <BusType>string</BusType>     
                                 <!--speed of the bus in km/hr-- >
                                <SPEED>int</SPEED>
                                <!--Latitude of the last 
                                gps reading for the bus-->
                                <Latitude></Latitude>
                                <!--Longitude of the last 
                                gps reading for the bus-->
                                <Longitude></Longitude>
                            </Trip>
                        </Trips>
                    </Route>
                    <Route>
                        <RouteNo>int</RouteNo>
                        <DirectionID>int</DirectionID>
                        <Direction>string</Direction>
                        <RouteHeading>string</RouteHeading>
                        <Trips>
                            <!--First Trip-->
                            <Trip>
                                <!--Final stop on the trip--> 
                                <TripDestination>string</TripDestination> 
                                <!--start time for the trip. Format HH:MI, 
                                 where HH = 24 hour format-->
                                <TripStartTime>string</TripStartTime>        
                                <!--adjusted scheduled time in minutes-->
                                <AdjustedScheduleTime>string</AdjustedScheduleTime>
                                <!--The time since the scheduled was adjusted 
                                 in whole and fractional minutes. -->
                                <AdjustmentAge>string</AdjustmentAge>
                                <!--last trip to pass the stop for 
                                 the route & direction-->
                                <LastTripOfSchedule>boolean</LastTripOfSchedule> 
                                <!--type of bus : low floor, bike rack etc.-->
                                <BusType>string</BusType>     
                                <!--speed of the bus in km/hr-- >
                                <GPSSpeed>int</GPSSpeed>
                                <!--Latitude of the last 
                                gps reading for the bus-->
                                <Latitude></Latitude>
                                <!--Longitude of the last 
                                gps reading for the bus-->
                                <Longitude></Longitude>
                            </Trip>
                            <!--Second Trip-->
                            <Trip>
                                <!--Final stop on the trip--> 
                                <TripDestination>string</TripDestination> 
                                <!--start time for the trip-->
                                <TripStartTime>string</TripStartTime>        
                                <!--adjusted scheduled time in minutes-->
                                <AdjustedScheduleTime>string</AdjustedScheduleTime> 
                                <!--The time since the scheduled was adjusted 
                                 in whole and fractional minutes-->
                                <AdjustmentAge>string</AdjustmentAge>
                                <!--last trip to pass the stop 
                                 for the route & direction-->
                                <LastTripOfSchedule>boolean</LastTripOfSchedule> 
                                <!--type of bus : low floor, bike rack etc.-->
                                <BusType>string</BusType>     
                                 <!--speed of the bus in km/hr-- >
                                <SPEED>int</SPEED>
                                <!--Latitude of the last 
                                gps reading for the bus-->
                                <Latitude></Latitude>
                                <!--Longitude of the last 
                                gps reading for the bus-->
                                <Longitude></Longitude>
                            </Trip>
                        </Trips>

                    </Route>
                </Routes>
            </GetRouteSummaryForStopResult>
        </GetRouteSummaryForStopResponse>
    </soap:Body>
</soap:Envelope>

JSON Example Response

{
    "GetRouteSummaryForStopResult": {
        "StopNo": "7659",
        "StopDescription": "BANK FIFTH",
        "Error": "",
        "Routes": {
            "Route": [
                {
                    "RouteNo": 1,
                    "DirectionID": 1,
                    "Direction": "Northbound",
                    "RouteHeading": "Ottawa-Rockcliffe",
                    "Trips": [
                        {
                            "TripDestination": "Ottawa Rockcliffe",
                            "TripStartTime": "14:51",
                            "AdjustedScheduleTime": "13",
                            "AdjustmentAge": "0.39",
                            "LastTripOfSchedule": false,
                            "BusType": "4L - IN",
                            "Latitude": "45.379298",
                            "Longitude": "-75.667908",
                            "GPSSpeed": "0.5"
                        },
                        {
                            "TripDestination": "Ottawa Rockcliffe",
                            "TripStartTime": "15:09",
                            "AdjustedScheduleTime": "25",
                            "AdjustmentAge": "0.76",
                            "LastTripOfSchedule": false,
                            "BusType": "4E - DEH",
                            "Latitude": "45.351322",
                            "Longitude": "-75.652007",
                            "GPSSpeed": "22.4"
                        },
                        {
                            "TripDestination": "Ottawa Rockcliffe",
                            "TripStartTime": "15:24",
                            "AdjustedScheduleTime": "39",
                            "AdjustmentAge": "0.57",
                            "LastTripOfSchedule": false,
                            "BusType": "4E - DEH",
                            "Latitude": "45.360289",
                            "Longitude": "-75.658753",
                            "GPSSpeed": "0.5"
                        }
                    ]
                },
                {
                    "RouteNo": 7,
                    "DirectionID": 1,
                    "Direction": "Eastbound",
                    "RouteHeading": "St. Laurent",
                    "Trips": [
                        {
                            "TripDestination": "St. Laurent",
                            "TripStartTime": "15:04",
                            "AdjustedScheduleTime": "3",
                            "AdjustmentAge": "0.55",
                            "LastTripOfSchedule": false,
                            "BusType": "4L - IN",
                            "Latitude": "45.392585",
                            "Longitude": "-75.682208",
                            "GPSSpeed": "23.5"
                        },
                        {
                            "TripDestination": "Brittany",
                            "TripStartTime": "15:21",
                            "AdjustedScheduleTime": "9",
                            "AdjustmentAge": "-1",
                            "LastTripOfSchedule": false,
                            "BusType": "6EB - 60",
                            "Latitude": "",
                            "Longitude": "",
                            "GPSSpeed": ""
                        },
                        {
                            "TripDestination": "St. Laurent",
                            "TripStartTime": "15:18",
                            "AdjustedScheduleTime": "14",
                            "AdjustmentAge": "-1",
                            "LastTripOfSchedule": false,
                            "BusType": "4LA - DEH",
                            "Latitude": "",
                            "Longitude": "",
                            "GPSSpeed": ""
                        }
                    ]
                }
            ]
        }
    }
}

4) GTFS

Retrieves specific records from all sections of the GTFS file.

URL: https://api.octranspo1.com/v1.2/Gtfs

Parameters:

appID
Required. Generated in the developer portal after registration.
apiKey
Required. Generated in the developer portal after registration.
table
Required. The table to query. (Tables Listed Below)
id
Optional. A specific row in a table by the id value.
column
Optional. A specific column in a table. The use of column requires the use of the value parameter. (Columns listed below.)
value
Optional*. A specific value in a column. *Required if column is specified.
order_by
Optional. Specify a column to sort by.
direction
Optional. Specify the direction of sorted records. asc or desc. Default asc.
limit
Optional. Specify a maximum limit of returned records.
format
Optional. Format of the returned data. json OR xml Default: xml

Usage

curl -d "appID={appID}&apiKey={apiKey}&table=stops&column=stop_id&value=AA010&order_by=stop_code&direction=desc&limit=10&format=json" https://api.octranspo1.com/v1.2/Gtfs

GTFS Query: Tables and Columns

Table Columns JSON
agency
  • id
  • agency_name
  • agency_url
  • agency_timezone
  • agency_lang
{
    "Query": {
        "table": "agency",
        "direction": "ASC",
        "column": "id",
        "value": "1",
        "format": "json"
    },
    "Gtfs": [
        {
            "id": "1",
            "agency_name": "OC Transpo-a",
            "agency_url": "http:\/\/www.octranspo.com",
            "agency_timezone": "America\/Montreal",
            "agency_lang": "en"
        }
    ]
}
calendar
  • id
  • service_id
  • monday
  • tuesday
  • wednesday
  • thursday
  • friday
  • saturday
  • sunday
  • start_date
  • end_date
{
    "Query": {
        "table": "calendar",
        "direction": "ASC",
        "column": "id",
        "value": "1",
        "format": "json"
    },
    "Gtfs": [
        {
            "id": "1",
            "service_id": "JUN26-JUNDA13-Weekday-01",
            "monday": "1",
            "tuesday": "1",
            "wednesday": "1",
            "thursday": "1",
            "friday": "1",
            "saturday": "0",
            "sunday": "0",
            "start_date": "20130626",
            "end_date": "20130627"
        }
    ]
}
calendar_dates
  • id
  • service_id
  • date
  • exception_type
{
    "Query": {
        "table": "calendar_dates",
        "direction": "ASC",
        "column": "id",
        "value": "1",
        "format": "json"
    },
    "Gtfs": [
        {
            "id": "1",
            "service_id": "JUN13-JUNDA13-Weekday-99",
            "date": "20130701",
            "exception_type": "2"
        }
    ]
}
routes
  • id
  • route_id
  • route_short_name
  • route_long_name
  • route_desc
  • route_type
{
    "Query": {
        "table": "routes",
        "direction": "ASC",
        "column": "id",
        "value": "1",
        "format": "json"
    },
    "Gtfs": [
        {
            "id": "1",
            "route_id": "1-146",
            "route_short_name": "1",
            "route_long_name": "",
            "route_desc": "",
            "route_type": "3"
        }
    ]
}
stops
  • id
  • stop_id
  • stop_code
  • stop_name
  • stop_desc
  • stop_lat
  • stop_lon
  • stop_street
  • stop_city
  • stop_region
  • stop_postcode
  • stop_country
  • zone_id
{
    "Query": {
        "table": "stops",
        "direction": "ASC",
        "column": "stop_id",
        "value": "AA010",
        "format": "json"
    },
    "Gtfs": [
        {
            "id": "1",
            "stop_id": "AA010",
            "stop_code": "8767",
            "stop_name": "SUSSEX \/ CHUTE RIDEAU FALLS",
            "stop_desc": "",
            "stop_lat": "45.4399",
            "stop_lon": "-75.6958",
            "stop_street": "",
            "stop_city": "",
            "stop_region": "",
            "stop_postcode": "",
            "stop_country": "",
            "zone_id": ""
        }
    ]
}
NOTE: stops table requires stop_id, stop_code or id values specified.
stop_times
  • id
  • trip_id
  • arrival_time
  • departure_time
  • stop_id
  • stop_sequence
  • pickup_type
{
    "Query": {
        "table": "stop_times",
        "direction": "ASC",
        "column": "stop_id",
        "value": "AA010",
        "format": "json"
    },
    "Gtfs": [
        {
            "id": "133436",
            "trip_id": "27212870-CADA13-CADA13-Sunday-71",
            "arrival_time": "08:29:00",
            "departure_time": "08:29:00",
            "stop_id": "AA010",
            "stop_sequence": "20",
            "pickup_type": "0",
            "drop_off_type": "0"
        }
    ]
}
NOTE: stop_times table requires trip_id, stop_id or id values specified.
trips
  • id
  • route_id
  • service_id
  • trip_id
  • trip_headsign
  • block_id
{
    "Query": {
        "table": "trips",
        "direction": "ASC",
        "column": "route_id",
        "value": "135-147",
        "format": "json"
    },
    "Gtfs": [
        {
            "id": "1",
            "route_id": "135-147",
            "service_id": "CADA13-CADA13-Sunday-71",
            "trip_id": "27210104-CADA13-CADA13-Sunday-71",
            "trip_headsign": "Esprit",
            "block_id": "3406628"
        }
    ]
}
NOTE: trips table requires route_id or id values specified.

XML Format Description

<?xml version="1.0"?>
<Gtfs>
  <result id="[ID of record]">
    <[Column Name]>[Value]</[Column Name]>
    <[Column Name With Null Value] />
  </result>
</Gtfs>

E-mail this page

PRESTO