Skip to content
Documentation

REST API - Trips

Trips

Trips are trips.txt entities imported from GTFS, and include the same basic structure and fields, plus some additional metadata.

Trip responses include their associated shape, calendar, frequency, and stop departure information; these entities do not have stand-alone endpoints.

For an overview of trips, schedules, and service calendars, see the Trips & Schedules concept page.

Request overview

Trips must be accessed through a route; either a route ID or Onestop ID may be used.

Stop time information is only available when requesting a single trip by ID.

To instead see all departures from a given stop, use the stops departures endpoint.

Shapes are included when accessing a single trip, requesting geojson or geojsonl formats, or with include_geometry=true.

Trips scheduled to run on a particular date can be selected using the service_date parameter, a date in YYYY-MM-DD format.

The trip API returns "active" feed versions unless requesting a specific feed version.

Trip API results are based on this GraphQL query.


GEThttps://transit.land/api/v2/rest/routes/{route_key}/trips

  • GEThttps://transit.land/api/v2/rest/routes/{route_key}/trips.{format}Request trips in specified format
  • GEThttps://transit.land/api/v2/rest/routes/{route_key}/trips/{id}Request a trip by ID
  • GEThttps://transit.land/api/v2/rest/routes/{route_key}/trips/{id}.{format}Request a trip by ID in specified format

Request

route_keystringrequired
Route lookup key; can be an integer ID, a '<feed onestop_id>:<gtfs route_id>' key, or a Onestop ID
service_dateoptional string (date)
Search for trips active on this date
trip_idoptional string
Search for records with this GTFS trip_id
include_geometryoptional string
Include shape geometry

Allowed:true, false

use_service_windowoptional string
Use a fall-back service date if the requested service_date is outside the active service period of the feed version. The fall-back date is selected as the matching day-of-week in the week which provides the best level of scheduled service in the feed version. This value defaults to true.

Allowed:true, false

relative_dateoptional string
Search for departures on a relative date label, e.g. TODAY, TUESDAY, NEXT_WEDNESDAY

Allowed:TODAY, MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY, SUNDAY, NEXT_MONDAY, NEXT_TUESDAY, NEXT_WEDNESDAY, NEXT_THURSDAY, NEXT_FRIDAY, NEXT_SATURDAY, NEXT_SUNDAY

include_alertsoptional string
Include alerts from GTFS Realtime feeds

Allowed:true, false

idoptional integer (int32)
Search for a specific internal ID
afteroptional integer (int32)
Pagination cursor value. This should be treated as an opaque value created by the server and returned as the link to the next result page, which may be empty. For historical reasons, this is based on the integer record ID values, but that should not be assumed to be the case in the future.
limitoptional integer (int32)
Maximum number of records to return
formatoptional string
Response format

Allowed:json, geojson, geojsonl

feed_version_sha1optional string
Search for records in this feed version
feed_onestop_idoptional string
Search for records in this feed
latoptional number
Latitude
lonoptional number
Longitude
license_commercial_use_allowedoptional string
Filter entities by feed license 'commercial_use_allowed' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.

Allowed:yes, no, unknown, exclude_no

license_share_alike_optionaloptional string
Filter entities by feed license 'share_alike_optional' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.

Allowed:yes, no, unknown, exclude_no

license_create_derived_productoptional string
Filter entities by feed license 'create_derived_product' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.

Allowed:yes, no, unknown, exclude_no

license_redistribution_allowedoptional string
Filter entities by feed license 'redistribution_allowed' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.

Allowed:yes, no, unknown, exclude_no

license_use_without_attributionoptional string
Filter entities by feed license 'use_without_attribution' value. Please see Source Feed concept for details on license values. 'exclude_no' is equivalent to 'yes' and 'unknown'.

Allowed:yes, no, unknown, exclude_no

Response

tripsarray of Trip
List or search for Trips
trips.idinteger
Internal integer ID
trips.trip_idstring
GTFS trips.trip_id
trips.trip_headsignnullable string
GTFS trips.trip_headsign; text that appears on signage identifying the trip's destination to riders
trips.trip_short_namenullable string
GTFS trips.trip_short_name; public-facing text used to identify the trip to riders, such as a train number
trips.direction_idnullable integer
GTFS trips.direction_id; binary indicator of travel direction [0=outbound, 1=inbound]; meaning depends on the agency
trips.block_idnullable string
GTFS trips.block_id; trips with the same block_id are operated in sequence by the same vehicle
trips.wheelchair_accessiblenullable integer
GTFS trips.wheelchair_accessible [0=no information, 1=vehicle can accommodate at least one rider in a wheelchair, 2=no riders in wheelchairs can be accommodated]
trips.bikes_allowednullable integer
GTFS trips.bikes_allowed [0=no information, 1=vehicle can accommodate at least one bicycle, 2=no bicycles allowed]
trips.cars_allowednullable integer
GTFS trips.cars_allowed [0=no information, 1=vehicle can accommodate at least one car, 2=no cars allowed]
trips.schedule_relationshipnullable string (ScheduleRelationship)
Real-time status of this trip. STATIC means no GTFS-RT data was matched; otherwise reflects the matching TripUpdate's schedule_relationship. See ScheduleRelationship for per-value semantics

Allowed:SCHEDULED, ADDED, UNSCHEDULED, CANCELED, STATIC, SKIPPED, NO_DATA, REPLACEMENT, DUPLICATED, DELETED

trips.stop_pattern_idinteger
Calculated stop pattern ID; an integer scoped to the feed version
trips.feed_versionFeedVersion
Feed version for this entity
trips.shapenullable Shape
Shape for this trip
trips.calendarCalendar
Calendar for this trip
trips.frequenciesarray of Frequency
Frequencies for this trip
trips.alertsnullable array of Alert
GTFS-RT service alerts for this trip; pass active: true to return only currently active alerts
trips.routeRoute
Route for this trip
trips.stop_timesarray of StopTime
Stop times for this trip