Back to API parent page

The <route/> Element

The <route/> element models agencies in OneBusAway. Routes are directly mapped from entries in the GTFS routes.txt file from the GTFS feeds that power an API instance.


  <longName>U Dist/Greenwood</longName> 
  <description>U Dist/Greenwood</description>


The fields of the route element closely match the fields defined for routes in the GTFS spec.

A few important details:

  • The only fields that are absolutely required are id, type and agencyId.
  • Agencies are not required to specify both a shortName and longName, thought they must specify at least one. Some will specify one but not the other. Others will include both. Confounding matters even more, some agencies (ahem King County Metro) dont specify a longName but do specify a description thats effectively a longName. The result is that care must be taken when constructing a route name by using the information that youre actually given.