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

Routes

All bus Routes belong to a Route Group. The Route Group dictates universal properties like color, foreground text color and sort order for the routes it contains.

Think of a Route Group like a section of the Maps and Schedules book, and each page as a route.

API Definitions

Get a route

Path Parameters

routeId

string

required

The id of a route.

Query Parameters

No query parameters.

Response Object

id

string

Stable identifier for this route.
number

string | null

Route name number. Example: "50".
firstTrip

string

The time of the first trip of the day for this route.
lastTrip

string

The time of the last trip of the day for this route.
lastTripAfterMidnight

boolean

True if the last trip of the day is after midnight.
dayType

object

The days and times of day this route is active.

dayPart

string

The part of day. Examples: "Weekday", "Saturday", "Gameday".
timePart

string

The time of day. Examples: "Day", "Night", "Late Night".
daysOfWeek

string

A zero-indexed comma-separated list of ints representing the days of the week this dayType is active. Examples: "1,2,3,4,5" for weekdays only, "0,6" for weekends only.
ValueDefinition
0Sunday
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday
sortOrder

integer

Number used to sort day types in logical order. Lower numbers should appear first in a list.
gtfsRoutes

string[]

GTFS route IDs associated with this route.
routeGroupId

string

The ID of the route group this route belongs to.
GEThttps://api.mtd.dev/routes/{routeId}
curl -X GET "https://api.mtd.dev/routes/{routeId}" \
  -H "X-ApiKey: YOUR_API_KEY"
Sample Response Object
{
	"result": {
		"id": "ac3fc3d0-37af-468f-8b24-d061de7bea93",
		"number": "1",
		"firstTrip": "06:10:00",
		"lastTrip": "19:19:00",
		"lastTripAfterMidnight": false,
		"dayType": {
			"dayPart": "Weekday",
			"timePart": "Day",
			"daysOfWeek": "1,2,3,4,5",
			"sortOrder": 100
		},
		"gtfsRoutes": ["YELLOW", "YELLOW ALT", "YELLOWHOPPER"],
		"routeGroupId": "9773e862-95fa-4697-9e94-edb6d59bdd75"
	},
	"error": null
}

Get a route group

Path Parameters

routeGroupId

string

required

The id of a route group.

Query Parameters

No query parameters.

Response Object

id

string

Stable identifier for this route group.
sortNumber

integer

Number used to sort route groups in logical order. Lower numbers should appear first in a list.
routeGroupName

string

The route name. Examples: "Silver Limited", "Gold", "Blue".
color

string

Hex color code used to represent this route group. # sign is omitted.
textColor

string

Hex text color code for use on top of the route color. # sign is omitted.
routes

Array of routes

The routes within this route group.

id

string

Stable identifier for this route.
number

string | null

Route name number. Example: "50".
firstTrip

string

The time of the first trip of the day for this route.
lastTrip

string

The time of the last trip of the day for this route.
lastTripAfterMidnight

boolean

True if the last trip of the day is after midnight.
dayType

object

The days and times of day this route is active.

dayPart

string

The part of day. Examples: "Weekday", "Saturday", "Gameday".
timePart

string

The time of day. Examples: "Day", "Night", "Late Night".
daysOfWeek

string

A zero-indexed comma-separated list of ints representing the days of the week this dayType is active. Examples: "1,2,3,4,5" for weekdays only, "0,6" for weekends only.
ValueDefinition
0Sunday
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday
sortOrder

integer

Number used to sort day types in logical order. Lower numbers should appear first in a list.
gtfsRoutes

string[]

GTFS route IDs associated with this route.
routeGroupId

string

The ID of the route group this route belongs to.
GEThttps://api.mtd.dev/routes/groups/{routeGroupId}
curl -X GET "https://api.mtd.dev/routes/groups/{routeGroupId}" \
  -H "X-ApiKey: YOUR_API_KEY"
Sample Response Object
{
	"result": {
		"id": "9773e862-95fa-4697-9e94-edb6d59bdd75",
		"sortNumber": 1,
		"routeGroupName": "Yellow",
		"color": "fcee1f",
		"textColor": "000000",
		"routes": [
			{
				"id": "ac3fc3d0-37af-468f-8b24-d061de7bea93",
				"number": "1",
				"firstTrip": "06:10:00",
				"lastTrip": "19:19:00",
				"lastTripAfterMidnight": false,
				"dayType": {
					"dayPart": "Weekday",
					"timePart": "Day",
					"daysOfWeek": "1,2,3,4,5",
					"sortOrder": 100
				},
				"gtfsRoutes": ["YELLOW", "YELLOW ALT", "YELLOWHOPPER"],
				"routeGroupId": "9773e862-95fa-4697-9e94-edb6d59bdd75"
			}
		]
	},
	"error": null
}

Get all route groups

Path Parameters

No path parameters.

Query Parameters

No query parameters.

Response Object

id

string

Stable identifier for this route group.
sortNumber

integer

Number used to sort route groups in logical order. Lower numbers should appear first in a list.
routeGroupName

string

The route name. Examples: "Silver Limited", "Gold", "Blue".
color

string

Hex color code used to represent this route group. # sign is omitted.
textColor

string

Hex text color code for use on top of the route color. # sign is omitted.
routes

Array of routes

The routes within this route group.

id

string

Stable identifier for this route.
number

string | null

Route name number. Example: "50".
firstTrip

string

The time of the first trip of the day for this route.
lastTrip

string

The time of the last trip of the day for this route.
lastTripAfterMidnight

boolean

True if the last trip of the day is after midnight.
dayType

object

The days and times of day this route is active.

dayPart

string

The part of day. Examples: "Weekday", "Saturday", "Gameday".
timePart

string

The time of day. Examples: "Day", "Night", "Late Night".
daysOfWeek

string

A zero-indexed comma-separated list of ints representing the days of the week this dayType is active. Examples: "1,2,3,4,5" for weekdays only, "0,6" for weekends only.
ValueDefinition
0Sunday
1Monday
2Tuesday
3Wednesday
4Thursday
5Friday
6Saturday
sortOrder

integer

Number used to sort day types in logical order. Lower numbers should appear first in a list.
gtfsRoutes

string[]

GTFS route IDs associated with this route.
routeGroupId

string

The ID of the route group this route belongs to.
GEThttps://api.mtd.dev/routes/groups
curl -X GET "https://api.mtd.dev/routes/groups" \
  -H "X-ApiKey: YOUR_API_KEY"
Sample Response Object
{
	"result": [
		{
			"id": "9773e862-95fa-4697-9e94-edb6d59bdd75",
			"sortNumber": 1,
			"routeGroupName": "Yellow",
			"color": "fcee1f",
			"textColor": "000000",
			"routes": [
				{
					"id": "ac3fc3d0-37af-468f-8b24-d061de7bea93",
					"number": "1",
					"firstTrip": "06:10:00",
					"lastTrip": "19:19:00",
					"lastTripAfterMidnight": false,
					"dayType": {
						"dayPart": "Weekday",
						"timePart": "Day",
						"daysOfWeek": "1,2,3,4,5",
						"sortOrder": 100
					},
					"gtfsRoutes": ["YELLOW", "YELLOW ALT", "YELLOWHOPPER"],
					"routeGroupId": "9773e862-95fa-4697-9e94-edb6d59bdd75"
				}
			]
		},
		{
			"id": "01ba67cc-b207-43b0-a7c7-a7b2f7e63514",
			"sortNumber": 2,
			"routeGroupName": "Red",
			"color": "e7131a",
			"textColor": "ffffff",
			"routes": [
				{
					"id": "dac5f56a-9c54-4a6a-a4ab-389d2eee31a3",
					"number": "2",
					"firstTrip": "06:03:00",
					"lastTrip": "19:15:00",
					"lastTripAfterMidnight": false,
					"dayType": {
						"dayPart": "Weekday",
						"timePart": "Day",
						"daysOfWeek": "1,2,3,4,5",
						"sortOrder": 100
					},
					"gtfsRoutes": ["RED"],
					"routeGroupId": "9773e862-95fa-4697-9e94-edb6d59bdd75"
				}
			]
		}
	],
	"error": null
}
* * *