@datafire/wmata_bus_route
Client library for Bus Route and Stop Methods
Installation and Usage
npm install --save @datafire/wmata_bus_route
let wmata_bus_route = require('@datafire/wmata_bus_route').create({
apiKeyHeader: "",
apiKeyQuery: ""
});
.then(data => {
console.log(data);
});
Description
Bus stop information, route and schedule data, and bus positions.
Actions
5476362a281d830c946a3d6e
Description
Returns bus positions for the given route, with an optional search radius. If no parameters are specified, all bus positions are returned.
Note that the RouteID parameter accepts only base route names and no variations, i.e.: use 10A instead of 10Av1 or 10Av2.
Bus positions are refreshed approximately every 20 to 30 7 to 10 seconds.
Response Elements
Element | Description |
---|---|
BusPositions | Array containing bus position information (BusPositions). |
DateTime | Date and time (Eastern Standard Time) of last position update. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:23:40). |
Deviation | Deviation, in minutes, from schedule. Positive values indicate that the bus is running late while negative ones are for buses running ahead of schedule. |
DirectionNum | Deprecated. Use the DirectionText for a customer-friendly description of direction. |
DirectionText | General direction of the trip, not the bus itself (e.g.: NORTH, SOUTH, EAST, WEST). |
Lat | Last reported Latitude of the bus. |
Lon | Last reported Longitude of the bus. |
RouteID | Base route name as shown on the bus. Note that the base route name could also refer to any variant, so a RouteID of 10A could refer to 10A, 10Av1, 10Av2, etc. |
TripEndTime | Scheduled end date and time (Eastern Standard Time) of the bus's current trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
TripHeadsign | Destination of the bus. |
TripID | Unique trip ID. This can be correlated with the data returned from the schedule-related methods. |
TripStartTime | Scheduled start date and time (Eastern Standard Time) of the bus's current trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T12:40:00). |
VehicleID | Unique identifier for the bus. This is usually visible on the bus itself. |
wmata_bus_route.5476362a281d830c946a3d6e({}, context)
Input
- input
object
- RouteID
string
(values: 70): Bus route, e.g.: 70, 10A. - Lat
string
: Center point Latitude, required if Longitude and Radius are specified. - Lon
string
: Center point Longitude, required if Latitude and Radius are specified. - Radius
string
: Radius (meters) to include in the search area, required if Latitude and Longitude are specified.
- RouteID
Output
Output schema unknown
5476362a281d830c946a3d6f
Description
For a given date, returns the set of ordered latitude/longitude points along route variant along with the list of stops served.
Response Elements
Element | Description |
---|---|
Direction0/Direction1 |
Structures describing path/stopinformation. Most routes will return content in both Direction0 and Direction1 elements, though a few will return NULL for Direction0 or for Direction1. 0 or 1 are binary properties. There is no specific mapping to direction, but a different value for the same route signifies that the route is in an opposite direction. |
Name | Descriptive name for the route. |
RouteID | Bus route variant (e.g.: 10A, 10Av1, etc.). |
DirectionNum | Deprecated. Use the DirectionText element to denote the general direction of the route variant. |
DirectionText | General direction of the route variant (NORTH, SOUTH, EAST, WEST, LOOP, etc.). |
Shape | Array containing shape point information (ShapePoint). |
Stops | Array containing stop information (Stop). |
TripHeadsign | Descriptive text of where the bus is headed. This is similar, but not necessarily identical, to what is displayed on the bus. |
Lat | Latitude. |
Lon | Longitude. |
SeqNum | Order of the point in the sequence of ShapePoints. |
Lat | Latitude. |
Lon | Longitude. |
Name | Stop name. May be slightly different from what is spoken or displayed in the bus. |
Routes | String array of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
wmata_bus_route.5476362a281d830c946a3d6f({
"RouteID": ""
}, context)
Input
- input
object
- RouteID required
string
(values: 70): Bus route variant, e.g.: 70, 10A, 10Av1. - Date
string
: Date in YYYY-MM-DD format for which to retrieve route and stop information. Defaults to today's date unless specified.
- RouteID required
Output
Output schema unknown
5476362a281d830c946a3d71
Description
Returns schedules for a given route variant for a given date.
Response Elements
Element | Description |
---|---|
Direction0/Direction1 |
Arrays containing trip information (Trip). Most routes will return content in both Direction0 and Direction1 elements, though a few (especially ones which run in a loop, such as the U8) will return content only for Direction0 and NULL content for Direction1. 0 or 1 are binary properties. There is no specific mapping to direction, but a different value for the same route signifies that the route is in an opposite direction. |
Name | Descriptive name for the route. |
DirectionNum | Deprecated. Use the TripDirectionText element to denote the general direction of the trip. |
EndTime | Scheduled end date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
RouteID | Bus route variant. This can be used in several other bus methods which accept variants. |
StartTime | Scheduled start date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
StopTimes | Array containing location and time information (StopTime). |
TripDirectionText | General direction of the trip (NORTH, SOUTH, EAST, WEST, LOOP, etc.). |
TripHeadsign | Descriptive text of where the bus is headed. This is similar, but not necessarily identical, to what is displayed on the bus. |
TripID | Unique trip ID. This can be correlated with the data returned from the schedule-related methods. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
StopName | Stop name. May be slightly different from what is spoken or displayed in the bus. |
StopSeq | Order of the stop in the sequence of StopTimes. |
Time | Scheduled departure date and time (Eastern Standard Time) from this stop. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
wmata_bus_route.5476362a281d830c946a3d71({
"RouteID": ""
}, context)
Input
- input
object
- RouteID required
string
(values: 70): Bus route variant, e.g.: 70, 10A, 10Av1. - Date
string
: Date in YYYY-MM-DD format for which to retrieve schedule. Defaults to today's date unless specified. - IncludingVariations
boolean
(values: false, true): Whether or not to include variations. For example, if B30 is specified, include all variations such as B30v1, B30v2, etc.
- RouteID required
Output
Output schema unknown
5476362a281d830c946a3d70
Description
Returns a list of all bus route variants (patterns). For example, the 10A and 10Av1 are the same route, but may stop at slightly different locations.
Response Elements
Element | Description |
---|---|
Routes | Array containing route variant information (Route). |
Name | Descriptive name of the route variant. |
RouteID | Unique identifier for a given route variant. Can be used in various other bus-related methods. |
LineDescription | Denotes the route variant’s grouping – lines are a combination of routes which lie in the same corridor and which have significant portions of their paths along the same roadways. |
wmata_bus_route.5476362a281d830c946a3d70(null, context)
Input
This action has no parameters
Output
Output schema unknown
5476362a281d830c946a3d72
Description
Returns a set of buses scheduled at a stop for a given date.
Response Elements
Element | Description |
---|---|
ScheduleArrivals | Array containing scheduled arrival information (ScheduleArrival). |
Stop | Structure describing stop information. |
DirectionNum | Denotes a binary direction (0 or 1) of the bus. There is no specific mapping to direction, but a different value for the same route signifies that the buses are traveling in opposite directions. Use the TripDirectionText element to show the actual destination of the bus. |
EndTime | Scheduled end date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
RouteID | Bus route variant identifier (pattern). This variant can be used in several other bus methods which accept variants. Note that customers will never see anything other than the base route name, so variants 10A, 10Av1, 10Av2, etc. will be displayed as 10A on the bus. |
ScheduleTime | Date and time (Eastern Standard Time) when the bus is scheduled to stop at this location. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
StartTime | Scheduled start date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
TripDirectionText | General direction of the trip (e.g.: NORTH, SOUTH, EAST, WEST). |
TripHeadsign | Destination of the bus. |
TripID | Trip identifier. This can be correlated with the data in our bus schedule information as well as bus positions. |
Lat | Latitude. |
Lon | Longitude. |
Name | Stop name. May be slightly different from what is spoken or displayed in the bus. |
Routes | String array of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
wmata_bus_route.5476362a281d830c946a3d72({
"StopID": ""
}, context)
Input
- input
object
- StopID required
string
(values: 1001195): 7-digit regional stop ID. - Date
string
: Date in YYYY-MM-DD format for which to retrieve schedule. Defaults to today's date unless specified.
- StopID required
Output
Output schema unknown
5476362a281d830c946a3d73
Description
Returns a list of nearby bus stops based on latitude, longitude, and radius. Omit all parameters to retrieve a list of all stops.
Response Elements
Element | Description |
---|---|
Stops | Array containing stop information (Stop). |
Lat | Latitude. |
Lon | Longitude. |
Name | Stop name. May be slightly different from what is spoken or displayed in the bus. |
Routes | String array of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
wmata_bus_route.5476362a281d830c946a3d73({}, context)
Input
- input
object
- Lat
string
(values: 38.878586): Center point Latitude, required if Longitude and Radius are specified. - Lon
string
(values: -76.989626): Center point Longitude, required if Latitude and Radius are specified. - Radius
string
(values: 500): Radius (feet) to include in the search area, required if Latitude and Longitude are specified.
- Lat
Output
Output schema unknown
5476362a281d830c946a3d68
Description
Returns bus positions for the given route, with an optional search radius. If no parameters are specified, all bus positions are returned.
Note that the RouteID parameter accepts only base route names and no variations, i.e.: use 10A instead of 10Av1 or 10Av2.
Bus positions are refreshed approximately every 20 to 30 7 to 10 seconds.
Response Elements
Element | Description |
---|---|
BusPositions | Array containing bus position information (BusPositions). |
DateTime | Date and time (Eastern Standard Time) of last position update. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:23:40). |
Deviation | Deviation, in minutes, from schedule. Positive values indicate that the bus is running late while negative ones are for buses running ahead of schedule. |
DirectionNum | Deprecated. Use the DirectionText for a customer-friendly description of direction. |
DirectionText | General direction of the trip, not the bus itself (e.g.: NORTH, SOUTH, EAST, WEST). |
Lat | Last reported Latitude of the bus. |
Lon | Last reported Longitude of the bus. |
RouteID | Base route name as shown on the bus. Note that the base route name could also refer to any variant, so a RouteID of 10A could refer to 10A, 10Av1, 10Av2, etc. |
TripEndTime | Scheduled end date and time (Eastern Standard Time) of the bus's current trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
TripHeadsign | Destination of the bus. |
TripID | Unique trip ID. This can be correlated with the data returned from the schedule-related methods. |
TripStartTime | Scheduled start date and time (Eastern Standard Time) of the bus's current trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T12:40:00). |
VehicleID | Unique identifier for the bus. This is usually visible on the bus itself. |
wmata_bus_route.5476362a281d830c946a3d68({}, context)
Input
- input
object
- RouteID
string
(values: 70): Base bus route, e.g.: 70, 10A. - Lat
number
: Center point Latitude, required if Longitude and Radius are specified. - Lon
number
: Center point Longitude, required if Latitude and Radius are specified. - Radius
number
: Radius (meters) to include in the search area, required if Latitude and Longitude are specified.
- RouteID
Output
Output schema unknown
5476362a281d830c946a3d69
Description
For a given date, returns the set of ordered latitude/longitude points along a route variant along with the list of stops served.
Response Elements
Element | Description |
---|---|
Direction0/Direction1 |
Structures describing path/stop
information. Most routes will return content in both Direction0 and Direction1 elements, though a few will return NULL for Direction0 or for Direction1. 0 or 1 are binary properties. There is no specific mapping to direction, but a different value for the same route signifies that the route is in an opposite direction. |
Name | Descriptive name for the route. |
RouteID | Bus route variant (e.g.: 10A, 10Av1, etc.). |
DirectionNum | Deprecated. Use the DirectionText element to denote the general direction of the route variant. |
DirectionText | General direction of the route variant (NORTH, SOUTH, EAST, WEST, LOOP, etc.). |
Shape | Array containing shape point information (ShapePoint). |
Stops | Array containing stop information (Stop). |
TripHeadsign | Descriptive text of where the bus is headed. This is similar, but not necessarily identical, to what is displayed on the bus. |
Lat | Latitude. |
Lon | Longitude. |
SeqNum | Order of the point in the sequence of ShapePoints. |
Lat | Latitude. |
Lon | Longitude. |
Name | Stop name. May be slightly different from what is spoken or displayed in the bus. |
Routes | String array of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
wmata_bus_route.5476362a281d830c946a3d69({
"RouteID": ""
}, context)
Input
- input
object
- RouteID required
string
(values: 70): Bus route variant, e.g.: 70, 10A, 10Av1. - Date
string
: Date in YYYY-MM-DD format for which to retrieve route and stop information. Defaults to today's date unless specified.
- RouteID required
Output
Output schema unknown
5476362a281d830c946a3d6b
Description
Returns schedules for a given route variant for a given date.
Response Elements
Element | Description |
---|---|
Direction0/Direction1 |
Arrays containing trip information (Trip). Most routes will return content in both Direction0 and Direction1 elements, though a few (especially ones which run in a loop, such as the U8) will return content only for Direction0 and NULL content for Direction1. 0 or 1 are binary properties. There is no specific mapping to direction, but a different value for the same route signifies that the route is in an opposite direction. |
Name | Descriptive name for the route. |
DirectionNum | Deprecated. Use the TripDirectionText element to denote the general direction of the trip. |
EndTime | Scheduled end date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
RouteID | Bus route variant. This can be used in several other bus methods which accept variants. |
StartTime | Scheduled start date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
StopTimes | Array containing location and time information (StopTime). |
TripDirectionText | General direction of the trip (NORTH, SOUTH, EAST, WEST, LOOP, etc.). |
TripHeadsign | Descriptive text of where the bus is headed. This is similar, but not necessarily identical, to what is displayed on the bus. |
TripID | Unique trip ID. This can be correlated with the data returned from the schedule-related methods. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
StopName | Stop name. May be slightly different from what is spoken or displayed in the bus. |
StopSeq | Order of the stop in the sequence of StopTimes. |
Time | Scheduled departure date and time (Eastern Standard Time) from this stop. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
wmata_bus_route.5476362a281d830c946a3d6b({
"RouteID": ""
}, context)
Input
- input
object
- RouteID required
string
(values: 70): Bus route variant, e.g.: 70, 10A, 10Av1, etc. - Date
string
: Date in YYYY-MM-DD format for which to retrieve schedule. Defaults to today's date unless specified. - IncludingVariations
boolean
(values: false, true): Whether or not to include variations if a base route is specified in RouteID. For example, if B30 is specified and IncludingVariations is set to true, data for all variations of B30 such as B30v1, B30v2, etc. will be returned.
- RouteID required
Output
Output schema unknown
5476362a281d830c946a3d6a
Description
Returns a list of all bus route variants (patterns). For example, the 10A and 10Av1 are the same route, but may stop at slightly different locations.
Response Elements
Element | Description |
---|---|
Routes | Array containing route variant information (Route). |
Name | Descriptive name of the route variant. |
RouteID | Unique identifier for a given route variant. Can be used in various other bus-related methods. |
LineDescription | Denotes the route variant’s grouping – lines are a combination of routes which lie in the same corridor and which have significant portions of their paths along the same roadways. |
wmata_bus_route.5476362a281d830c946a3d6a(null, context)
Input
This action has no parameters
Output
Output schema unknown
5476362a281d830c946a3d6c
Description
Returns a set of buses scheduled at a stop for a given date.
Response Elements
Element | Description |
---|---|
ScheduleArrivals | Array containing scheduled arrival information (ScheduleArrival). |
Stop | Structure describing stop information. |
DirectionNum | Denotes a binary direction (0 or 1) of the bus. There is no specific mapping to direction, but a different value for the same route signifies that the buses are traveling in opposite directions. Use the TripDirectionText element to show the actual destination of the bus. |
EndTime | Scheduled end date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
RouteID | Bus route variant identifier (pattern). This variant can be used in several other bus methods which accept variants. Note that customers will never see anything other than the base route name, so variants 10A, 10Av1, 10Av2, etc. will be displayed as 10A on the bus. |
ScheduleTime | Date and time (Eastern Standard Time) when the bus is scheduled to stop at this location. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
StartTime | Scheduled start date and time (Eastern Standard Time) for this trip. Will be in YYYY-MM-DDTHH:mm:ss format (e.g.: 2014-10-27T13:17:00). |
TripDirectionText | General direction of the trip (e.g.: NORTH, SOUTH, EAST, WEST). |
TripHeadsign | Destination of the bus. |
TripID | Trip identifier. This can be correlated with the data in our bus schedule information as well as bus positions. |
Lat | Latitude. |
Lon | Longitude. |
Name | Stop name. May be slightly different from what is spoken or displayed in the bus. |
Routes | String array of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
wmata_bus_route.5476362a281d830c946a3d6c({
"StopID": ""
}, context)
Input
- input
object
- StopID required
string
(values: 1001195): 7-digit regional stop ID. - Date
string
: Date in YYYY-MM-DD format for which to retrieve schedule. Defaults to today's date unless specified.
- StopID required
Output
Output schema unknown
5476362a281d830c946a3d6d
Description
Returns a list of nearby bus stops based on latitude, longitude, and radius. Omit all parameters to retrieve a list of all stops.
Response Elements
Element | Description |
---|---|
Stops | Array containing stop information (Stop). |
Lat | Latitude. |
Lon | Longitude. |
Name | Stop name. May be slightly different from what is spoken or displayed in the bus. |
Routes | String array of route variants which provide service at this stop. Note that these are not date-specific; any route variant which stops at this stop on any day will be listed. |
StopID | 7-digit regional ID which can be used in various bus-related methods. If unavailable, the StopID will be 0 or NULL. |
wmata_bus_route.5476362a281d830c946a3d6d({}, context)
Input
- input
object
- Lat
number
(values: 38.878586): Center point Latitude, required if Longitude and Radius are specified. - Lon
number
(values: -76.989626): Center point Longitude, required if Latitude and Radius are specified. - Radius
number
(values: 500): Radius (meters) to include in the search area, required if Latitude and Longitude are specified.
- Lat
Output
Output schema unknown
Definitions
This integration has no definitions