Rail Autorouter
Contents
POST /AutoRoute/report
Resource URL
https://pcmrail.alk.com/REST/v{version}/Service.svc/AutoRoute/report
(Available in v32.0 and later)
The AutoRouter endpoint generates one or more rail route options between an origin and destination—often spanning multiple railroad networks—by automatically selecting carriers and interchange junctions for each leg of the route (similar to PC*Miler Rail On-Prem AutoRouter).
This endpoint supports six report formats:
JunctionRailRoadNEW — Summarizes the route by junction/interchange sequence.Railroad— Summarizes the route by railroad/carrier legs.Detailed— Lists all points on the route, along with leg and cumulative mileage between the origin and destination.KeyStation— Includes the user-specified stops on the route with leg and cumulative mileage, and leg mileage summaries by state and railroad.DetailedGeocode— Includes the same information as theDetailedreport, but also lists the SPLC, 3-3-3, and R260 for each stop.State— Lists mileage by state.
How AutoRouter works
AutoRouter picks suitable junction interchanges and carriers, informed by historical interchange patterns (e.g., Carload Waybill Sample–based junction popularity). In general:
- One route option may be generated for each origin railroad × destination railroad combination.
- If the destination has other viable junctions nearby in the same SPLC area, additional route options that pass through those junctions may be returned.
- If a single railroad serves both origin and destination, only local routes may be returned (no interline routes).
- If terminal switching is excluded (see
TerminalSwitching), any interline route that requires a junction interchange at the origin or destination (i.e., terminal switching) is removed from the candidate list.
Limitation
Shortestrouting is generally not recommended for AutoRouter results; shortest-distance routes may be more expensive and/or use less-preferred track.
POST Body Parameters
| Parameter | Description | Type | Required |
|---|---|---|---|
Stops
| An object containing the list of stations in the route. |
object | Yes |
Options
| An object containing routing/report options. |
object | No |
Report
| The report type to generate. Valid values: Railroad, JunctionRailRoad.
|
string | Yes |
Example (JSON)
{
"Stops": [
{ "Format": "StationState", "Name": "KENT OH" },
{ "Format": "StationState", "Name": "NEPISIGUIT JCT NB" }
],
"Options": {
"RoutingPreference": "Practical",
"IncludeRailnetwork": "AB, CN",
"IntermodalOnlyStations": true,
"AmtrakRoutes": false
},
"Report": "Railroad"
}
Stops Object
Stops is an array of stop objects. Minimum of 2 stops (Origin and Destination).
| Field | Description | Type | Required |
|---|---|---|---|
Format
| Stop format / input type. |
string | Yes |
Name
| Stop value encoded per Format.
|
string | Yes |
Railroad
| Optional railroad/carrier code constraint for this stop. Use null (or omit) to allow AutoRouter to consider any valid carriers for the location. If Railroad is provided on a stop, it takes precedence over Options.IncludeRailnetwork for that stop.
|
string | null |
Stop.Format values
| Format | Description | Example Name
|
|---|---|---|
StationState
| Station + state/province. | "KENT OH"
|
StationName
| Station name (no state). (If enabled in your Rail data/region.) | "KENT"
|
SPLC
| Standard Point Location Code. | "123456"
|
ERPC
| Eastern Railroad President’s Conference code (“3-3-3”). | "123123123"
|
FSAC
| Freight Station Accounting Code. | "ABCDE"
|
R260
| Rule 260 junction code. | "9999"
|
For coded formats (SPLC, ERPC, FSAC, R260), StationName should be the raw code string.
Options Object
| Field | Description | Type | Required |
|---|---|---|---|
RoutingPreference
| Routing preference / formula. Recommended: Practical.
|
string | No |
IncludeRailnetwork
| Comma-separated list of rail network/railroad codes to include. |
string | No |
TerminalSwitching
| Indicates whether terminal switching is allowed when generating routes. When true, AutoRouter may include terminal/yard switching moves (switching railroads within a terminal area) as part of a valid route option. When false, routes that require terminal switching are excluded. Default is true.
|
boolean | No |
IntermodalOnlyStations
| When true, limits stop lookups and/or routing candidates to intermodal stations only.
|
boolean | No |
AmtrakRoutes
| When true, allows passenger rail (Amtrak) segments to be considered in route options. When false, excludes Amtrak routes.
|
boolean | No |
Report
| Value | Description |
|---|---|
Railroad
| Summarizes the route by railroad/carrier legs. |
JunctionRailRoad
| Summarizes the route by junction/interchange sequence. |
Example Request
curl --location 'https://pcmrail.alk.com/rest/v32.0/Service.svc/AutoRoute/report' \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--header 'Authorization: {API Key}' \
--data '{
"Stops": [
{ "Format": "StationState", "Name": "KENT OH" },
{ "Format": "StationState", "Name": "NEPISIGUIT JCT NB" }
],
"Options": {
"RoutingPreference": "Practical",
"IncludeRailnetwork": "AB, CN",
"IntermodalOnlyStations": true,
"AmtrakRoutes": false
},
"Report": "RailRoad"
}'
Example Response (Railroad)
{
"ReportList": [
{
"Lines": [
{ "Railroad": "AB", "Distance": "14.7" },
{ "Railroad": "CSXT", "Distance": "239.4" },
{ "Railroad": "CN", "Distance": "1139.9" },
{ "Railroad": "TOTAL", "Distance": "1394.0" }
]
}
]
}
Example Response (JunctionRailRoad)
{
"ReportList": [
{
"Lines": [
{
"Railroad": "AB",
"State": "OH",
"Name": "KENT",
"ERPC": "KENT",
"R260": "KENT",
"SPLC": "344477000",
"FSAC": "33955"
},
{
"Railroad": "CSXT",
"State": "OH",
"Name": "AKRON",
"ERPC": "AKRON",
"R260": "AKRON",
"SPLC": "344700000",
"FSAC": "71429",
"LegDist": "14.7"
},
{
"Railroad": "CN",
"State": "NY",
"Name": "BUFFALO",
"ERPC": "BUFFALO",
"R260": "BUFF",
"SPLC": "185400000",
"FSAC": "45300",
"LegDist": "239.4"
},
{
"Railroad": "CN",
"State": "NB",
"Name": "NEPISIGUIT JCT",
"ERPC": "NEPJCT",
"R260": "NEPJT",
"SPLC": "018540000",
"FSAC": "15502",
"LegDist": "1139.8",
"TotalDist": "1393.9"
}
]
},
{
"Lines": [
{
"Railroad": "WE",
"State": "OH",
"Name": "KENT",
"ERPC": "KENT",
"R260": "KENT",
"SPLC": "344477000",
"FSAC": "33955"
},
{
"Railroad": "CN",
"State": "OH",
"Name": "LANG",
"ERPC": "LANG",
"R260": "LANG",
"SPLC": "343173000",
"FSAC": "55467",
"LegDist": "148.8"
},
{
"Railroad": "CN",
"State": "NB",
"Name": "NEPISIGUIT JCT",
"ERPC": "NEPJCT",
"R260": "NEPJT",
"SPLC": "018540000",
"FSAC": "15502",
"LegDist": "1301.7",
"TotalDist": "1450.5"
}
]
}
]
}