Search for trips

get/routes/{route_key}/trips

Request

  • Base URL: https://transit.land/api/v2/rest
  • URL: https://transit.land/api/v2/rest/routes/{route_key}/trips
  • Auth: none declared

Path parameters

route_keystring required

Route lookup key; can be an integer ID, a '<feed onestop_id>:<gtfs route_id>' key, or a Onestop ID

Query parameters

service_datestring date

Search for trips active on this date

trip_idstring

Search for records with this GTFS trip_id

include_geometry'true' | 'false'

Include shape geometry

use_service_window'true' | 'false'

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.

relative_date'TODAY' | 'MONDAY' | 'TUESDAY' | 'WEDNESDAY' | 'THURSDAY' | 'FRIDAY' | 'SATURDAY' | 'SUNDAY' | 'NEXT_MONDAY' | 'NEXT_TUESDAY' | 'NEXT_WEDNESDAY' | 'NEXT_THURSDAY' | 'NEXT_FRIDAY' | 'NEXT_SATURDAY' | 'NEXT_SUNDAY'

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

include_alerts'true' | 'false'

Include alerts from GTFS Realtime feeds

idinteger

Search for a specific internal ID

afterinteger

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.

limitinteger

Maximum number of records to return

format'json' | 'geojson' | 'geojsonl'

Response format

feed_version_sha1string

Search for records in this feed version

feed_onestop_idstring

Search for records in this feed

latnumber

Latitude

lonnumber

Longitude

license_commercial_use_allowed'yes' | 'no' | 'unknown' | 'exclude_no'

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'.

license_share_alike_optional'yes' | 'no' | 'unknown' | 'exclude_no'

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'.

license_create_derived_product'yes' | 'no' | 'unknown' | 'exclude_no'

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'.

license_redistribution_allowed'yes' | 'no' | 'unknown' | 'exclude_no'

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'.

license_use_without_attribution'yes' | 'no' | 'unknown' | 'exclude_no'

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'.

Response

ok

Example response

{
  "trips": [
    {
      "alerts": [
        {
          "informed_entity": [
            {
              "trip": {
                "start_date": "2019-11-15",
                "start_time": "15:21:04"
              }
            }
          ]
        }
      ],
      "calendar": {
        "added_dates": [
          "2019-11-15"
        ],
        "end_date": "2019-11-15",
        "removed_dates": [
          "2019-11-15"
        ],
        "start_date": "2019-11-15"
      },
      "feed_version": {
        "fetched_at": "2019-11-15T00:45:55.409906",
        "sha1": "ab5bdc8b6cedd06792d42186a9b542504c5eef9a"
      },
      "frequencies": [
        {
          "end_time": "15:21:04",
          "start_time": "15:21:04"
        }
      ],
      "route": {
        "agency": {
          "alerts": [
            {
              "informed_entity": [
                {
                  "trip": {
                    "start_date": "2019-11-15",
                    "start_time": "15:21:04"
                  }
                }
              ]
            }
          ]
        },
        "alerts": [
          {
            "informed_entity": [
              {
                "trip": {
                  "start_date": "2019-11-15",
                  "start_time": "15:21:04"
                }
              }
            ]
          }
        ]
      },
      "stop_times": [
        {
          "arrival_time": "15:21:04",
          "departure_time": "15:21:04",
          "stop": {
            "alerts": [
              {
                "informed_entity": [
                  {
                    "trip": {
                      "start_date": "2019-11-15",
                      "start_time": "15:21:04"
                    }
                  }
                ]
              }
            ],
            "stop_id": "400029",
            "stop_name": "MADISON AV/E 68 ST"
          }
        }
      ]
    }
  ]
}

Changes

No recorded changes to this operation across all 1 revision of this API.