Public Transit API Developer's Guide

All Next Departures by Station IDs

User Story

The user wants to retrieve a list of transit departures for stations with the specified IDs along the same road for a given date and time.

Note: This service is subject to Terms and Conditions as described in Supplier Terms for Developers Using HERE Location Platform APIs.

Request

The query parameter stnIds takes a list of comma-separated station IDs, 411400892,411406325. The time parameter is specified in ISO 8601 format, 2019-06-24T08:00:00.

https://transit.hereapi.cn/v3/multiboard/by_stn_ids.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&lang=en
&stnIds=411400892,411406325
&max=2
&time=2019-06-24T08%3A00%3A00

Response

The response to the request contains the following information blocks:
  • a maximum of 40 departures per station for all nearby stations, depending on the proximity of the nearby stations to the specified location within a default radius of 500m, can be configured using the optional max and maxStn parameters
  • each departure board element includes the following information:
    • departure time
    • name and ID of the transit stop or station the service departs from
    • name and number of the transit service
    • type of the transit service
    • direction or head-sign of the service
    • optionally, the color of the service line
{
  "Res": {
    "serviceUrl": "http://internal-ptkernel-prd-v010-1479417778.cn-northwest-1.elb.amazonaws.com.cn/goroute/HONG_KONG_SHIFTED_DEMO_V104_20181030",
    "MultiNextDepartures": {
      "MultiNextDeparture": [{
        "Stn": {
          "y": 22.334156,
          "x": 114.15929,
          "name": "Trade Square",
          "id": "411406325"
        },
        "NextDepartures": {
          "Dep": [{
            "time": "2019-06-24T08:00:00",
            "Stn": {
              "y": 22.334156,
              "x": 114.15929,
              "name": "Trade Square",
              "id": "411406325"
            },
            "Transport": {
              "mode": 5,
              "dir": "\u5f00\u5f80 \u8354\u679d\u89d2\u5df4\u58eb\u53c1\u7ad9 \u65b9\u5411",
              "name": "Cross Harbour Route 904",
              "At": {
                "category": "Bus",
                "operator": "acn16100"
              }
            }
          }, {
            "time": "2019-06-24T08:01:00",
            "Stn": {
              "y": 22.334156,
              "x": 114.15929,
              "name": "Trade Square",
              "id": "411406325"
            },
            "Transport": {
              "mode": 5,
              "dir": "\u5f00\u5f80 \u5b89\u852d\u5df4\u58eb\u53c1\u7ad9 \u65b9\u5411",
              "name": "KMB 35A",
              "At": {
                "category": "Bus",
                "operator": "acn05400"
              }
            }
          }],
          "Operators": {
            "Op": [{
              "code": "acn05400",
              "type": "TT",
              "name": "\u4e5d\u53c1\u5df4\u58eb(1933)\u6709\u9650\u516c\u53f8",
              "short_name": "054"
            }, {
              "code": "acn16100",
              "type": "TT",
              "name": "\u65b0\u4e16\u754c\u7b2c\u4e00\u5df4\u58eb\u670d\u52d9\u6709\u9650\u516c\u53f8|\u4e5d\u53c1\u5df4\u58eb(1933)\u6709\u9650\u516c\u53f8",
              "short_name": "161"
            }]
          }
        }
      }, {
        "Stn": {
          "y": 22.30353,
          "x": 114.176448,
          "name": "Nanking St",
          "id": "411400892"
        },
        "NextDepartures": {
          "Dep": [{
            "time": "2019-06-24T08:00:00",
            "Stn": {
              "y": 22.30353,
              "x": 114.176448,
              "name": "Nanking St",
              "id": "411400892"
            },
            "Transport": {
              "mode": 5,
              "dir": "\u5f00\u5f80 \u8607\u5c4b\u53c1 \u65b9\u5411",
              "name": "First Bus 970",
              "At": {
                "category": "Bus",
                "operator": "acn13000"
              }
            }
          }, {
            "time": "2019-06-24T08:00:00",
            "Stn": {
              "y": 22.30353,
              "x": 114.176448,
              "name": "Nanking St",
              "id": "411400892"
            },
            "Transport": {
              "mode": 5,
              "dir": "\u5f00\u5f80 \u6a5f\u5834(\u5730\u9762\u904b\u53c1\u4e2d\u5fc3) \u65b9\u5411",
              "name": "Citybus A21",
              "At": {
                "category": "Bus",
                "operator": "acn02100"
              }
            }
          }],
          "Operators": {
            "Op": [{
              "code": "acn02100",
              "type": "TT",
              "name": "\u57ce\u5df4\u6709\u9650\u516c\u53f8",
              "short_name": "021"
            }, {
              "code": "acn13000",
              "type": "TT",
              "name": "\u65b0\u4e16\u754c\u7b2c\u4e00\u5df4\u58eb\u670d\u52d9\u6709\u9650\u516c\u53f8",
              "short_name": "130"
            }]
          }
        }
      }]
    }
  }
}