Search for routes

get/routes

Request

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

Query parameters

route_keystring

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

agency_keystring

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

route_idstring

Search for records with this GTFS route_id

route_typeinteger

Search for routes with this GTFS route (vehicle) type

route_typesstring

Search for routes with these GTFS route (vehicle) types. Accepts comma separated values.

operator_onestop_idstring

Search for records by operator OnestopID

serves_stop_onestop_idstring

Search for routes serving a stop with this OnestopID

include_alerts'true' | 'false'

Include alerts from GTFS Realtime feeds

include_geometry'true' | 'false'

Include route geometry

include_stops'true' | 'false'

Include route stops

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

searchstring

Full text search

onestop_idstring

Search for a specific Onestop ID

feed_version_sha1string

Search for records in this feed version

feed_onestop_idstring

Search for records in this feed

radiusnumber

Search radius (meters); requires lat and lon

latnumber

Latitude

lonnumber

Longitude

bboxstring

Geographic search using a bounding box, with coordinates in (min_lon, min_lat, max_lon, max_lat) order as a comma separated string

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

{
  "routes": [
    {
      "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"
              }
            }
          ]
        }
      ],
      "feed_version": {
        "fetched_at": "2019-11-15T00:45:55.409906",
        "sha1": "ab5bdc8b6cedd06792d42186a9b542504c5eef9a"
      },
      "route_stops": [
        {
          "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.