Public Transit API Developer's Guide

Transit Alerts Examples

This section provides examples of Transit Alerts requests.

Note: The Alerts are sourced from transit agencies' API feeds and/or Twitter accounts (where available). If the alerts' origin is from Twitter, you are required to follow Twitter's general principles for presenting alerts correctly. We do not provide any data for Twitter's logos and links for Twitter's actions. The full guidance on the display requirements can be found on Twitter Display Requirements page.

Request

The code block below demonstrates the sample request, specifying that the response data are to be delivered in XML.

https://cit.transit.api.here.com/alerts/v1/nearby.xml
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&x=13.3846396
&y=52.5523361

Here is the same request indicating that the response data are to be delivered in JSON.

https://cit.transit.api.here.com/alerts/v1/nearby.json
?app_id={YOUR_APP_ID}
&app_code={YOUR_APP_CODE}
&x=13.3846396
&y=52.5523361

Response

The sample response in XML format is as follows:

<Res serviceUrl="http://search.eu.dv.ext.pt.svc.ovi.com/t0k2/">
<Alerts>
  <Alert origin="TWITTER" operator="S-Bahn" id="uY6CR6WJRwOW5Z7JQKl52w" valid_from="2017-04-11T10:44:27">
    <Info>
      Leider entfällt heute die Zugfahrt der #S45 um 13:19 Uhr von #Bundesplatz bis #Flughafen_Schönefeld, an 13:55 Uhr
    </Info>
    <Lines>
      <Line code="4" name="S45"/>
    </Lines>
  </Alert>
  <Alert origin="TWITTER" operator="S-Bahn" id="oUftd_wTSGe8iBBOhvR9oQ" valid_from="2017-04-11T05:26:17">
    <Info>
      #S5, #S7 & #S75 Noch bis 4.8. (Mo) 1:30 Uhr fahren zw. #Friedrichstr. und #Zoologischer_Garten keine S-Bahnen. Infos: http://t.co/PYwxxTOgsu
    </Info>
    <Lines>
      <Line code="4" name="S5"/>
      <Line code="4" name="S75"/>
      <Line code="4" name="S7"/>
    </Lines>
  </Alert>
</Alerts>
</Res>

The sample response (Twitter) in JSON format is as follows:

{
  "Res":{
    "Alerts":{
      "Alert":[
        {
          "Info":"#S1, #S2, #S25: Nach beendetem Polizeieinsatz ist der Zugverkehr in beiden Richtungen versp\u00e4tet. Mit einzelnen Ausf\u00e4llen ist zu rechnen.",
          "@origin":"TWITTER",
          "Lines":{
            "Line":[
              {
                "@code":"4",
                "@name":"S1"
              },
              {
                "@code":"4",
                "@name":"S2"
              },
              {
                "@code":"4",
                "@name":"S25"
              }
            ]
          },
          "Link":[
            {
              "@href":"http://twitter.com/166866601/status/519449714530738176",
              "@id":"alert",
              "$":"http://twitter.com/166866601/status/519449714530738176"
            }
          ],
          "@operator":"S-Bahn",
          "@id":"fonYpSKZRo-5DmrKvIooNQ"
        },
        {
          "Info":"#S1, #S2, #S25: Wegen eines Polizeieinsatzes in #Nordbahnhof ist der Zugverkehr unregelm\u00e4\u00dfig. Weitere Informationen folgen.",
          "@origin":"TWITTER",
          "Lines":{
            "Line":[
              {
                "@code":"4",
                "@name":"S1"
              },
              {
                "@code":"4",
                "@name":"S2"
              },
              {
                "@code":"4",
                "@name":"S25"
              }
            ]
          },
          "Link":[
            {
              "@href":"http://twitter.com/166866601/status/519446478755213312",
              "@id":"alert",
              "$":"http://twitter.com/166866601/status/519446478755213312"
            }
          ],
          "@operator":"S-Bahn",
          "@id":"09IFCn5KRoGpzynOLSpREQ"
        }
      ]
    },
    "@serviceUrl":"http://search.eu.dv.ext.pt.svc.ovi.com/t0k2/"
  }
}

The sample response (API) in JSON format is as follows:


{
  "Res": {
    "Alerts": {
      "Alert": [
        {
          "Info": "Silver Line - SL5 experiencing minor delays due to traffic",
          "@origin": "API",
          "@valid_from": "2017-04-11T14:20:39",
          "@valid_till": "2017-04-11T18:20:46",
          "Lines": {
            "Line": [
              {
                "@code": "5",
                "@name": "SL5"
              }
            ]
          },
          "@severity": "LOW",
          "@operator": "MBTA",
          "@id": "TY8Il-diRhmzIxOFHHtGaA"
        },
        {
          "Info": "Routes 80, 87, 88, 89, 90, 94, and 96 detoured from 9:30 AM to 12:00 PM on Sun Sep 21 due to The Memphis Soul-Davis Square 5K.\n\nRoute 80: No service on Broadway between Medford and Powderhouse. \r\nInbound and outbound connections can be made at Powderhouse and Warner or Broadway and Medford\r\n\r\nRoute 87: No service on Holland, Teele Sq, Broadway, or to Elm between Beech & Davis. \r\nInbound and outbound connections can be made at Elm and Porter Sq or at Beech and Orchard. \r\n\r\nRoute 88 & 90: No service to Teele Sq, Broadway, and to Highland between Cedar & Davis. \r\nInbound and outbound connections can be made at Highland & Cedar. \r\n\r\nRoute 89: No service between Medford and Powderhouse. \r\nInbound and outbound connections can be made at Powderhouse and Warner, Broadway and Medford St, and at Clarendon Hill. \r\n\r\nRoute 94: No service to College Ave between Powderhouse and Davis. \r\nInbound and outbound connections can be made at Powderhouse and College Ave. \r\n\r\nRoute 96: No service to Beech, Elm, Davis Sq, College Ave between Davis and Boston St, and to Boston St between College and Winthrop. \r\nInbound connections can be made at Winthrop and Orchard or Porter Sq and Mass Ave. \r\nOutbound connections can be made at Porter Sq, or Winthrop St and Chester.",
          "@origin": "API",
          "@valid_from": "2017-04-11T13:30:00",
          "@valid_till": "2017-04-11T16:00:00",
          "Lines": {
            "Line": [
              {
                "@code": "5",
                "@name": "80"
              },
              {
                "@code": "5",
                "@name": "89"
              },
              {
                "@code": "5",
                "@name": "87"
              },
              {
                "@code": "5",
                "@name": "96"
              },
              {
                "@code": "5",
                "@name": "94"
              }
            ]
          },
          "@severity": "HIGH",
          "@operator": "MBTA",
          "@id": "XnqyeH2xQAa4he2SkF9guA"
        },
        {
          "Info": "Green Line service will be suspended between Park St. and Haymarket Stations in both directions September 20-21.\n\nDue to MBTA track work, the Green Line will be suspended between Park and Haymarket in both directions from start to end of service on Saturday, September 20, through Sunday, September 21. Eastbound trains will terminate at Park and westbound trains will terminate at Haymarket. \r\n\r\nFor customers desiring westbound service beyond Haymarket, transfer to Forest Hills-bound Orange Line service at North Station or Haymarket. Exit at Downtown Crossing and use the Winter St Concourse to Park for access to the Green Line.\r\n\r\nFor customers desiring eastbound service beyond Park, use the Winter St Concourse at Park to Downtown Crossing and board Oak Grove-bound Orange Line service to Haymarket and North Station for access to the Green Line. \r\n\r\nEastbound Green Line customers desiring elevator access should exit at Park using the right-side doors, turn left, and proceed down the slight ramp. After passing through the small corridor, take Elevator 808 on the left down to the Red Line platform. Board any southbound Red Line train (left side of center platform) one stop to Downtown Crossing. Upon exiting at Downtown Crossing, take Elevator 870 up, proceed approx. 10 feet into the open corridor, and turn left toward the fare gates. Exit the fare gates and proceed straight to the Orange Line Oak Grove-bound platform. Please see station personnel for assistance. Alternatively, press the call box button. Board Oak Grove-bound Orange Line service to Haymarket and North Station for access to the Green Line. \r\n\r\nFor Blue Line passengers transferring to eastbound Green Line service, transfer to Oak Grove-bound Orange Line service at State and exit at Haymarket or North Station for Green Line service. \r\n\r\nFor Blue Line passengers transferring to westbound Green Line service, transfer to Forest Hills-bound Orange Line service at State and exit at Downtown Crossing to utilize the Winter St Concourse to Park for Green Line connections. Alternatively, upon exiting the Orange Line at Downtown Crossing, transfer to Alewife-bound Red Line service to Park to make westbound Green Line connections.\r\n\r\nAffected stops:\r\nHaymarket \r\nGovernment Center \r\nPark St.",
          "@origin": "API",
          "@valid_from": "2017-04-11T08:30:00",
          "@valid_till": "2017-04-11T06:30:00",
          "Lines": {
            "Line": [
              {
                "@code": "8",
                "@name": "Green Line"
              }
            ]
          },
          "@severity": "HIGH",
          "@operator": "MBTA",
          "@id": "ILvp4l-ZSF6i1ggfP42zxg"
        },
        {
          "Info": "Buses replacing Red Line service between JFK/UMass and Broadway Stations September 27-28, October 4-5, and October 18-19\n\nDue to the Columbia Junction Signal Replacement Project, buses will replace Red Line trains between JFK/UMass and Broadway Stations in both directions from start to end of service during the following weekends: \r\n\r\n- Saturday, September 27, 2014, through Sunday, September 28, 2014\r\n- Saturday, October 4, 2014, through Sunday, October 5, 2014\r\n- Saturday, October 18, 2014, through Sunday, October 19, 2014 \r\n\r\nRegular Red Line train service will resume at the start of service on Mondays. All shuttle bus stops are accessible for persons with disabilities. \r\n\r\nShuttling the following stops: \r\nBroadway Station\r\nAndrew Station\r\nJFK/UMass Station",
          "@origin": "API",
          "@valid_from": "2017-04-11T08:30:00",
          "@valid_till": "2017-04-11T06:30:00",
          "Lines": {
            "Line": [
              {
                "@code": "7",
                "@name": "Red Line"
              }
            ]
          },
          "@severity": "HIGH",
          "Link": [
            {
              "@href": "http://www.mbta.com/about_the_mbta/t_projects/default.asp?id=26367",
              "@id": "alert",
              "$": "http://www.mbta.com/about_the_mbta/t_projects/default.asp?id=26367"
            }
          ],
          "@operator": "MBTA",
          "@id": "piibHEJ0Q8KtH9eUp3Z90A"
        },
      ]
    },
    "@serviceUrl": "http://search.eu.dv.ext.pt.svc.ovi.com/t0k2/"
  }
}

You cannot use this account to purchase a commercial plan on Developer Portal, as it is already associated to plans with different payment methods.

To purchase a commercial plan on Developer Portal, please register for or sign in with a different HERE Account.

Something took longer than expected.

The project should be available soon under your projects page.

Sorry, our services are not available in this region.

Something seems to have gone wrong. Please try again later.

We've detected that your account is set to Australian Dollars (AUD).
Unfortunately, we do not offer checkouts in AUD anymore.
You can continue using your current plan as normal, but to subscribe to one of our new plans,
please register for a new HERE account or contact us for billing questions on selfservesupport@here.com.