Journey Planner

Introduction

This API is designed to provide transit route information. It facilitates the retrieval of available transit routes based on the provided geographical coordinates of origin and destination locations with

  • customized route planning,
  • transit model filtering,
  • walking preference,
  • transfer management
  • route visualization.

Authentication

To use the API you need to add an apiKey to your requests

Endpoint

APIs provide you with an endpoint or a specific URL where the data or functions you want are exposed. The endpoint for the transit route API is available at:

https://api.jp.ahoyte.ch/v2/transitRoute

Request

The following are the Query Paramteres for the request

  • apiKey: represents the API Key to access the API. Possible value should be “465f8aeb-8226-43b5-8a5a-0e243be2f238”
  • origin: the location of origin in latitude, and longitude format. Possible value should be" 25.08951203377821,55.1478855144492"
  • destination: location of the destination in latitude and longitude format. Possible value should be “25.064392415143992,55.13844798847745”
  • departureTime: Date and time of departure in local time zone (yyyy-MM-dd HH24:mm:ss) i.e “2023-09-20 10:00:00”
  • arrivalTime: Date and time of arrival in local time zone (yyyy-MM-dd HH24:mm:ss) i.e. “2023-09-20 10:00:00”
  • transportMode: The user’s preferred transportation options, expressed as a comma-separated string for multiple values. i.e. BUS, SUBWAY, TRAM, FERRY
  • numAlternatives: Count of alternative viable routes for the return journey. i.e integer value >= 0
  • intermediateStops: Retrieve intermediary stop information for each mode of transit, excluding the details of the starting point and the final destination. i.e Boolean (True/ false)
  • maxTransfers: The highest limit on the number of transfers allowed for a journey, which is determined by one plus the maximum number of times a passenger can board transit vehicles during the journey. i.e 5 (integer value )
  • walkingSpeed: The user’s walking speed in meters/second. i.e. 1.3 (double precision value)
  • waitingReluctance: An indicator of the extent to which walking is less favorable than being in transit for the same duration. Value between 10 and 20 will reduce the walking distance i.e 5 (integer value > 0)
  • waitingReluctance: To what extent does waiting for a transit vehicle differ from being onboard, quantified as a multiplier? The default value assumes that waiting time and on-vehicle time are equal. i.e. 1 (double precision value)
  • walkingSafety: The extent to which pedestrian safety is factored into routing, expressed as a percentage. This value should fall within the range of 0 to 100, with safety considerations disregarded when set to 0. 100 (integer value between 0 to 100)
  • geomFormat: Format of the returned geometry for each mode of journey. i.e. POLYLINE, WKT
  • wheelchair access: Whether the wheelchair is accessible along the journey i.e. Boolean (true or false)

Response

{
  "routeInfo": {
    "datetime": "2023-10-06T02:40:00",
    "arriveBy": false,
    "origin": {
      "name": "Origin",
      "lng": 55.1478855,
      "lat": 25.089512,
      "type": "PLACE"
    },
    "destination": {
      "name": "Destination",
      "lng": 55.138448,
      "lat": 25.0643924,
      "type": "PLACE"
    }
  },
  "routes": [
    {
      "id": "ROUTE-01",
      "totalDuration": 3566,
      "startDateTime": "2023-10-06T02:40:00",
      "endDateTime": "2023-10-06T03:39:26",
      "totalWalkingTime": 3566,
      "totalTransitTime": 0,
      "totalWaitingTime": 0,
      "totalWalkingDistance": 4147.39990234375,
      "totalTransfers": 0,
      "routeModes": [
        {
          "id": "ROUTE-01/01",
          "mode": "WALK",
          "departureTime": "2023-10-06T02:40:00",
          "arrivalTime": "2023-10-06T03:39:26",
          "distance": 4147.39990234375,
          "duration": 3566,
          "isTransit": false,
          "steps": [
            {
              "action": "DEPART",
              "duration": 50.83076923076923,
              "distance": 66.08,
              "direction": "SOUTHWEST",
              "street": "service road",
              "isFillerName": true,
              "stayOn": false,
              "lng": 55.1480252,
              "lat": 25.0892998
            },
            {
              "action": "LEFT",
              "duration": 31.4,
              "distance": 40.82,
              "direction": "SOUTH",
              "street": "path",
              "isFillerName": true,
              "stayOn": true,
              "lng": 55.1475598,
              "lat": 25.0888882
            }
          ],
          "startingFrom": {
            "name": "Origin",
            "lng": 55.1478855,
            "lat": 25.089512,
            "departureTime": "2023-10-06T02:40:00",
            "type": "PLACE"
          },
          "endingAt": {
            "name": "Destination",
            "lng": 55.138448,
            "lat": 25.0643924,
            "arrivalTime": "2023-10-06T03:39:26",
            "type": "PLACE"
          },
          "interlineWithPreviousLeg": false,
          "geom": "agcxCcbroI??FH~@`ADFBHHABBLQFIHQCCF?FCFCTOBABABAD@n@_APWfA_B^c@JMFGFG??VVx@eAFBJCz@q@fAa@TIJAbBYv@GL@LHPLD@PALALMHAJArAR^HjAn@BBPJPLz@r@p@v@TVFRA@FAB?JP?DCJDFHJBDNRR^HNHHFFBEFHAD`@v@bBxB|@}@BAFIBC@AlBkBp@q@xBeBh@z@BDHLUXMPZl@Zj@V`@V\\DFpAbB\\d@jB~BHJz@~@j@p@DFjAtAHJzA|ALLFBFDDBFFLJvAvAh@d@XV`@^LBLFJFHHJJDBD@D?VVFDDDVTNJNHRBZERI\\_@p@aATYRYNSj@s@GIRYjA~@^SLIGIPQDGOQTWv@}@f@k@\\a@b@m@RWXc@HIHIHIFIJMLKLKRKRIRETCTAV@VDTFRHRLPL`@\\z@z@JJFFHHRPTPVNTTzAtAnAjAd@b@tArA~@`AZ\\vArA`C~B`A|@bC|B|@~@LJJ`@DFDHDDFFlA`ABH@H?JCJEJEHININKNKN}@lACBCBEDEBGBE?E?E@EBGDEHCD?F?F?D@DBDDDb@i@"
        }
      ]
    }
  ]
}

Status Codes

With every request you make, you’ll receive a status code. This three-digit number tells you whether or not your request was successful. Here are some status codes:

  • 200 - API response in case of success
  • 400 - API response in case of bad request.
  • 401 - API response in case of unauthorized access.
  • 403 -API response in case of forbidden access.
  • 500 - API response in case of internal server error.
  • 502 - API response in case of bad gateway.
  • 503 - API response in case of service unavailable.
  • 504 - API response in case of gateway timeout.