New API is in preview! Subject to change. Send feedback to contact@mtd.dev

Trips

A trip is an individual run of a route at a specific time. While multiple trips may follow the same stop pattern, a trip is a single instance of that pattern.

API Definitions

Get a trip

Path Parameters

tripId

string

required

The id of a trip. You MUST URL encode this value, as it may contain forward slashes. This is planned to be changed in the future.

Query Parameters

No query parameters.

Response Object

id

string

Stable identifier for this trip.
blockId

string

Stable identifier for the block this trip is part of.
shapeId

string

Stable identifier for this trip's shape.
headsign

string

The headsign displayed on the vehicle for this trip.
direction

object | null

The direction of travel for this trip, if applicable.

id

integer | null

Direction id (0 or 1).
name

string

Direction display name.
shortName

string | null

Short direction code.
route

object | null

Route details associated with this trip.

id

string

Stable identifier for the route.
routeGroupId

string | null

Stable identifier for the route group this route belongs to.
gtfsRouteId

string

Stable GTFS route identifier.
longName

string | null

Long route name.
shortName

string | null

Short route name or number.
color

string | null

Hex route color code without #.
textColor

string | null

Hex text color code without #.
GEThttps://api.mtd.dev/trips/{tripId}
curl -X GET "https://api.mtd.dev/trips/{tripId}" \
  -H "X-ApiKey: YOUR_API_KEY"
Sample Response Object
{
	"result": {
		"id": "[@12.0.42224456@][3][1246897112109]/0__SV4_SCH_UIF",
		"blockId": "SV4 SCH UIF",
		"shapeId": "130N SILVER EVENING 2",
		"headsign": "Lincoln Square",
		"direction": {
			"id": 0,
			"name": "North",
			"shortName": "N"
		},
		"route": {
			"id": "60bda5b3-dd69-4f8c-9891-72d9dac9fb68",
			"routeGroupId": "cdfc9380-d084-4885-ae79-c6314a1071f5",
			"gtfsRouteId": "SILVER EVENING",
			"longName": "Silver",
			"shortName": "130",
			"color": "cccccc",
			"textColor": "000000"
		}
	},
	"error": null
}

Get all trips

Path Parameters

No path parameters.

Query Parameters

No query parameters.

Response Object

id

string

Stable identifier for this trip.
blockId

string

Stable identifier for the block this trip is part of.
shapeId

string

Stable identifier for this trip's shape.
headsign

string

The headsign displayed on the vehicle for this trip.
direction

object | null

The direction of travel for this trip, if applicable.

id

integer | null

Direction id (0 or 1).
name

string

Direction display name.
shortName

string | null

Short direction code.
route

object | null

Route details associated with this trip.

id

string

Stable identifier for the route.
routeGroupId

string | null

Stable identifier for the route group.
gtfsRouteId

string

Stable GTFS route identifier.
longName

string | null

Long route name.
shortName

string | null

Short route name or number.
color

string | null

Hex route color code without #.
textColor

string | null

Hex text color code without #.
GEThttps://api.mtd.dev/trips
curl -X GET "https://api.mtd.dev/trips" \
  -H "X-ApiKey: YOUR_API_KEY"
Sample Response Object
{
	"result": [
		{
			"id": "[@12.0.42224456@][3][1246897112109]/0__SV4_NOSCH_UIF",
			"blockId": "SV4 NOSCH UIF",
			"shapeId": "130N SILVER EVENING 2",
			"headsign": "Lincoln Square",
			"direction": {
				"id": 0,
				"name": "North",
				"shortName": "N"
			},
			"route": {
				"id": "60bda5b3-dd69-4f8c-9891-72d9dac9fb68",
				"routeGroupId": "cdfc9380-d084-4885-ae79-c6314a1071f5",
				"gtfsRouteId": "SILVER EVENING",
				"longName": "Silver",
				"shortName": "130",
				"color": "cccccc",
				"textColor": "000000"
			}
		},
		{
			"id": "[@12.0.42224456@][3][1246897112109]/0__SV4_NOSCH_UIMTH",
			"blockId": "SV4 NOSCH UIMTH",
			"shapeId": "130N SILVER EVENING 2",
			"headsign": "Lincoln Square",
			"direction": {
				"id": 0,
				"name": "North",
				"shortName": "N"
			},
			"route": {
				"id": "60bda5b3-dd69-4f8c-9891-72d9dac9fb68",
				"routeGroupId": "cdfc9380-d084-4885-ae79-c6314a1071f5",
				"gtfsRouteId": "SILVER EVENING",
				"longName": "Silver",
				"shortName": "130",
				"color": "cccccc",
				"textColor": "000000"
			}
		}
	],
	"error": null
}
* * *