An API service for the Corvallis Transit System
The basic documentation can be found on GoDoc
- Go (the programming language)
- Google App Engine SDK for Go
- Add these to your path (optional)
(Install prerequisites)
git clone https://github.com/OSU-App-Club/corvallis-bus-server
cd corvallis-bus-server
goapp serve
This will start a server at http://localhost:8080.
This API service is an HTTP GET based set of web services
##Paths
-
Default: returns nothing
-
Params:
- stops -- comma delimited list of stop ids (required & limited to 20 ids); Default: ""
- date -- date in RFC822Z format; Default: "currentDate"
-
Response:
- stops: map stopNumber to array of arrival times in RFC822Z
-
Schedule: time bus is scheduled to arrive
-
Expected: time bus will arrive based on real-time data (often equal to scheduled)
-
Example
URL: http://www.corvallis-bus.appspot.com/arrivals?stops=13713
{
"13713":[
{
"Expected":"15 Apr 14 16:57 -0700",
"Route":"4",
"Scheduled":"15 Apr 14 16:57 -0700"
},
{
"Expected":"15 Apr 14 17:32 -0700",
"Route":"CVA",
"Scheduled":"15 Apr 14 17:32 -0700"
},
{
"Expected":"15 Apr 14 18:57 -0700",
"Route":"4",
"Scheduled":"15 Apr 14 18:57 -0700"
}
]
}
```
### /routes
* Default: returns all routes without stops
* Params:
1. names -- comma delimited list of route numbers (optional); Default: ""
2. stops -- include stop information ["true" or "false"]; Default: "false"
3. onlyNames -- only include route names ["true" or "false"]; Default: "false"
* Example
URL: http://www.corvallis-bus.appspot.com/routes
```json
{
"routes":[
{
"Name":"1",
"AdditionalName":"OSU, Witham Hill, Hewlett Packard, and Timberhill Shopping Center",
"Description":"ROUTE 1 provides hourly service to OSU, Witham Hill, Hewlett Packard \u0026 Timberhill Shopping Center (Equipped with a wheelchair lift. A bicycle rack is available on a first-come, first-served basis.)",
"URL":"http://www.corvallisoregon.gov/index.aspx?page=822",
"Polyline":"_a_oGh{ioVL{@RHdAb@fAd@p@VpClAQlAa@`CCPWvA_@rBq@lEw@xE}@c@_CcAiEgBIj@QdAYfBo@lEm@zDo@vDKn@c@nCm@zDo@zDMx@a@hC{@~Fy@|FGj@CPk@nEo@nEO\\a@j@i@n@{@d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?v@?pGAhCC|C_A?k@Lk@Zi@f@]v@yAvEg@zAwA~D[r@w@jAs@r@u@h@}@^^dCh@|DTdBL`ARzBBd@NnCHzBBtB@vAj@CXHdA\\`@Nf@T`AZ~@HlAC`B??~H?|HAfBAl@C`AKvAIr@e@xCOz@g@bDQ|ACn@A|@@hA`AIr@O`@_@^c@Ta@NWt@eBZm@r@yALSTMVGX@h@LrAp@^RTTh@f@Z^^b@TXj@|@p@r@VRZPZL\\Fr@JbAAz@Ev@St@c@p@k@Z[p@q@zFyF\\]hCkC~AaBrBsBf@i@`BcBvAqApA{Av@iA`BcCj@}@jCmEFMt@mAbBoCzDkGNStAuBzFAz@AdGAzDAR?dACfBA|D?`EA?_BAyBFwC?q@GiD?_@AcE?oEAaE?U?iE?m@Xg@`AoAf@q@n@w@nCmDbA_BdBuB`@k@N]n@oEn@aFFk@x@}Fz@_Gn@cEn@{Dl@{Dn@_En@wDTwAVcBn@mEXgBZqBt@sEv@sEn@gE@EBMN{@j@ITyA",
"Color":"00ADEE",
"Direction":"Clockwise"
}
]
}
-
Default: returns all stops
-
Params:
- ids: comma delimited list of stop ids (optional); Default: ""
- lat: latitude for search; Default: ""
- lng: longitude for search; Default: ""
- radius: radius in meters to make search; Default: 500
- limit: limit the amount of stops returned; Default: none
-
Response:
- stops: array of stops objects
- Sort order different based on paramaters 1. location: sorted by distance 2. ids: sorted by ids
- stops: array of stops objects
-
Example
URL: http://www.corvallis-bus.appspot.com/stops?lat=44.57181000&lng=-123.2910000&radius=200&limit=1
{
"stops":[
{
"Name":"NW Harrison Blvd \u0026 NW 36th St",
"Road":"NW Harrison Blvd",
"Bearing":181.3342,
"AdherancePoint":false,
"Lat":44.57181054,
"Long":-123.2914071,
"ID":12483,
"Distance":32.24711617308209
}
]
}