-
Notifications
You must be signed in to change notification settings - Fork 1
Metro API
There are a number of features to get information from the metro data api (which you can set up locally for your own testing using the code in this repo if you have the mad skillz for it)
The api is made up of a number of base classes, upon which you then call methods with parameters to get the data you need. Authentication is not required.
You can make a request as follows:
domain/class/method?params=options&moreparams=somethingelse
The journey class deals with getting information about a journey, including the associate stops.
Gets all the routes available
- Request Type: GET
- Example request url – /Journey/AllRoutes?All
- Parameters
- ?All
- Returns – JSON
- Example return
- [{"RouteNumber":"1A “,”RunningBoard":"4S32 “,”UniqueJourneyIdentifier":“144641”,“OriginStop”:"700000001804"},{"RouteNumber":"1A “,”RunningBoard":"13N01 “,”UniqueJourneyIdentifier":“144643”,“OriginStop”:"700000001213"},{"RouteNumber":"1A “,”RunningBoard":"110 “,”UniqueJourneyIdentifier":“144645”,“OriginStop”:"700000001804"},{"RouteNumber":"1A “,”RunningBoard":"104 “,”UniqueJourneyIdentifier":“144649”,“OriginStop”:"700000001804"},{"RouteNumber":"1A “,”RunningBoard":"111 “,”UniqueJourneyIdentifier":“144655”,“OriginStop”:"700000001804"},
Gets all the stops on a route excluding the origin and the destination
- Request Type: GET
- Example request url – /Journey/StopsOnRoute
- Parameters
- ?route=UniqueJourneyIdentifier
- Required? Yes
- ?route=UniqueJourneyIdentifier
- Example return
- [{"JourneyIntermediateID":“200”,“Location”:“700000001752”,“ArrivalTime”:“08:11:00”,“DepartureTime”:“08:11:00”,“Activity”:“Pick up and Set down”,“BayNumber”:" “,”TimingPoint":“Not Timing Point”,“FareStage”:“Not Fare Stage”,“UniqueJourneyIdentifier”:"144655"},{"JourneyIntermediateID":“201”,“Location”:“700000000916”,“ArrivalTime”:“08:13:00”,“DepartureTime”:“08:13:00”,“Activity”:“Pick up and Set down”,“BayNumber”:" “,”TimingPoint":“Not Timing Point”,“FareStage”:“Not Fare Stage”,“UniqueJourneyIdentifier”:"144655"}]
Returns the first stop on a route, including the gps co-ords
- Request Type: GET
- Example request url – /Journey/RouteOrigin
- Parameters
- ?route=UniqueJourneyIdentifier
- Example return
- [{"JourneyOriginID":“5”,“Location”:“700000001804”,“DepartureTime”:“08:05:00”,“BayNumber”:" “,”TimingPoint":“Timing Point”,“FareStage”:“Not Fare Stage”,“UniqueJourneyIdentifier”:“144655”,“StopID”:“1”,“StopName”:"Donegall Square West “,”StopLat":“54.596978910521”,“StopLong”:“-5.9306756610751”,“StopReference”:"700000001804"}]
Returns the final stop on a route, including the gps co-ords
- Request Type: GET
- Example request url – /Journey/RouteDestination
- Parameters
- ?route=UniqueJourneyIdentifier
- Example return
- [{"JourneyDestinationID":“5”,“Location”:“700000001445”,“ArrivalTime”:“08:50:00”,“BayNumber”:" “,”TimingPoint":“Timing Point”,“FareStage”:“Not Fare Stage”,“UniqueJourneyIdentifier”:“144655”,“StopID”:“116”,“StopName”:"Glenville(Monkstown Avenue) “,”StopLat":“54.681563378634”,“StopLong”:“-5.909640081605”,“StopReference”:"700000001445"}]
Returns all the information for a given stop
- Request Type: GET
- Example request url – /Stop/IndividualStop
- Parameters
- ?stopref=StopReference
- Example return
- {"StopID":“1”,“StopName”:"Donegall Square West “,”StopLat":“54.596978910521”,“StopLong”:“-5.9306756610751”,“StopReference”:"700000001804"}
This method will return all the StopReference’s for a given route
- Request Type: GET
- Example request url – /Stop/RoutesForStop
- Parameters
- ?stopref=StopReference
- Example return
- [{"UniqueJourneyIdentifier":"141875"},{"UniqueJourneyIdentifier":"141876"},{"UniqueJourneyIdentifier":"141877"},{"UniqueJourneyIdentifier":"141878"},{"UniqueJourneyIdentifier":"141879"},{"UniqueJourneyIdentifier":"141880"},{"UniqueJourneyIdentifier":"141881"}]
This method will return all the StopReference’s for a given route
- Request Type: GET
- Example request url – /Stop/RoutesForStop
- Parameters
- ?stopref=StopReference
- Example return
**[{"UniqueJourneyIdentifier":"141875"},{"UniqueJourneyIdentifier":"141876"},{"UniqueJourneyIdentifier":"141877"},{"UniqueJourneyIdentifier":"141878"},{"UniqueJourneyIdentifier":"141879"},{"UniqueJourneyIdentifier":"141880"},{"UniqueJourneyIdentifier":"141881"}]