Skip to content
marramgrass edited this page Sep 13, 2010 · 5 revisions

Intro

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.

Anatomy of a request

You can make a request as follows:

domain/class/method?params=options&moreparams=somethingelse

Class – Journey Class

The journey class deals with getting information about a journey, including the associate stops.

All Routes

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"},

StopsOnRoute

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
  • 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"}]

RouteOrigin

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"}]

RouteDestination

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"}]

Class – Stop Class

IndividualStop

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"}

RoutesForStop

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"}]

RoutesForStop

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"}]

Clone this wiki locally