Get route
curl --request POST \
--url https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"code": "NERG"
}'import requests
url = "https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route"
payload = { "code": "NERG" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'NERG'})
};
fetch('https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'NERG'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route"
payload := strings.NewReader("{\n \"code\": \"NERG\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"NERG\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"NERG\"\n}"
response = http.request(request)
puts response.read_body{
"cities_served": "Boston - New Haven - New York - Philadelphia - Wilmington - Washington",
"code": "NERG",
"name": "Northeast Regional",
"observed_at_ms": 1790117621522,
"stops": [
{
"code": "NPN",
"name": "Newport News, VA"
},
{
"code": "WBG",
"name": "Williamsburg, VA"
},
{
"code": "RVM",
"name": "Richmond, VA"
},
{
"code": "NFK",
"name": "Norfolk, VA"
},
{
"code": "PTB",
"name": "Petersburg, VA"
},
{
"code": "RVR",
"name": "Richmond, VA"
},
{
"code": "ASD",
"name": "Ashland, VA"
},
{
"code": "FBG",
"name": "Fredericksburg, VA"
},
{
"code": "QAN",
"name": "Quantico, VA"
},
{
"code": "WDB",
"name": "Woodbridge, VA"
},
{
"code": "RNK",
"name": "Roanoke, VA"
},
{
"code": "LYH",
"name": "Lynchburg, VA"
},
{
"code": "CVS",
"name": "Charlottesville, VA"
},
{
"code": "CLP",
"name": "Culpeper, VA"
},
{
"code": "MSS",
"name": "Manassas, VA"
},
{
"code": "BCV",
"name": "Burke, VA"
},
{
"code": "ALX",
"name": "Alexandria, VA"
},
{
"code": "WAS",
"name": "Washington, DC"
},
{
"code": "NCR",
"name": "New Carrollton, MD"
},
{
"code": "BWI",
"name": "Baltimore, MD"
},
{
"code": "BAL",
"name": "Baltimore, MD"
},
{
"code": "ABE",
"name": "Aberdeen, MD"
},
{
"code": "NRK",
"name": "Newark, DE"
},
{
"code": "WIL",
"name": "Wilmington, DE"
},
{
"code": "PHL",
"name": "Philadelphia, PA"
},
{
"code": "PHN",
"name": "Philadelphia, PA"
},
{
"code": "TRE",
"name": "Trenton, NJ"
},
{
"code": "PJC",
"name": "Princeton Junction, NJ"
},
{
"code": "NBK",
"name": "New Brunswick, NJ"
},
{
"code": "MET",
"name": "Iselin, NJ"
},
{
"code": "EWR",
"name": "Newark, NJ"
},
{
"code": "NWK",
"name": "Newark, NJ"
},
{
"code": "NYP",
"name": "New York, NY"
},
{
"code": "NRO",
"name": "New Rochelle, NY"
},
{
"code": "STM",
"name": "Stamford, CT"
},
{
"code": "BRP",
"name": "Bridgeport, CT"
},
{
"code": "NHV",
"name": "New Haven, CT"
},
{
"code": "STS",
"name": "New Haven, CT"
},
{
"code": "WFD",
"name": "Wallingford, CT"
},
{
"code": "MDN",
"name": "Meriden, CT"
},
{
"code": "BER",
"name": "Berlin, CT"
},
{
"code": "HFD",
"name": "Hartford, CT"
},
{
"code": "WND",
"name": "Windsor, CT"
},
{
"code": "WNL",
"name": "Windsor Locks, CT"
},
{
"code": "SPG",
"name": "Springfield, MA"
},
{
"code": "OSB",
"name": "Old Saybrook, CT"
},
{
"code": "NLC",
"name": "New London, CT"
},
{
"code": "MYS",
"name": "Mystic, CT"
},
{
"code": "WLY",
"name": "Westerly, RI"
},
{
"code": "KIN",
"name": "West Kingston, RI"
},
{
"code": "PVD",
"name": "Providence, RI"
},
{
"code": "RTE",
"name": "Westwood, MA"
},
{
"code": "BBY",
"name": "Boston, MA"
},
{
"code": "BOS",
"name": "Boston, MA"
}
],
"train_numbers": [
"65",
"66",
"67",
"82",
"84",
"85",
"86",
"87",
"88",
"93",
"94",
"95",
"96",
"99",
"111",
"120",
"121",
"122",
"123",
"124",
"125",
"126",
"127",
"129",
"130",
"131",
"132",
"133",
"134",
"135",
"137",
"138",
"139",
"149",
"150",
"151",
"152",
"153",
"154",
"155",
"157",
"158",
"159",
"160",
"161",
"162",
"163",
"164",
"165",
"166",
"167",
"168",
"169",
"170",
"172",
"173",
"174",
"175",
"177",
"178",
"179",
"180",
"181",
"182",
"183",
"184",
"185",
"186",
"187",
"189",
"190",
"192",
"193",
"194",
"195",
"196",
"198",
"1121",
"1135",
"1164",
"1173",
"1174",
"1175",
"1186",
"1192",
"1194",
"1195",
"1776"
]
}Amtrak
Get route
Route detail after list_routes; the train numbers feed train_status, the stop codes feed get_station.
POST
https://api.aisa.one
/
apis
/
v1
/
amtrak-com
/
train-status
/
get-route
Get route
curl --request POST \
--url https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"code": "NERG"
}'import requests
url = "https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route"
payload = { "code": "NERG" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({code: 'NERG'})
};
fetch('https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'code' => 'NERG'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route"
payload := strings.NewReader("{\n \"code\": \"NERG\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"code\": \"NERG\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"code\": \"NERG\"\n}"
response = http.request(request)
puts response.read_body{
"cities_served": "Boston - New Haven - New York - Philadelphia - Wilmington - Washington",
"code": "NERG",
"name": "Northeast Regional",
"observed_at_ms": 1790117621522,
"stops": [
{
"code": "NPN",
"name": "Newport News, VA"
},
{
"code": "WBG",
"name": "Williamsburg, VA"
},
{
"code": "RVM",
"name": "Richmond, VA"
},
{
"code": "NFK",
"name": "Norfolk, VA"
},
{
"code": "PTB",
"name": "Petersburg, VA"
},
{
"code": "RVR",
"name": "Richmond, VA"
},
{
"code": "ASD",
"name": "Ashland, VA"
},
{
"code": "FBG",
"name": "Fredericksburg, VA"
},
{
"code": "QAN",
"name": "Quantico, VA"
},
{
"code": "WDB",
"name": "Woodbridge, VA"
},
{
"code": "RNK",
"name": "Roanoke, VA"
},
{
"code": "LYH",
"name": "Lynchburg, VA"
},
{
"code": "CVS",
"name": "Charlottesville, VA"
},
{
"code": "CLP",
"name": "Culpeper, VA"
},
{
"code": "MSS",
"name": "Manassas, VA"
},
{
"code": "BCV",
"name": "Burke, VA"
},
{
"code": "ALX",
"name": "Alexandria, VA"
},
{
"code": "WAS",
"name": "Washington, DC"
},
{
"code": "NCR",
"name": "New Carrollton, MD"
},
{
"code": "BWI",
"name": "Baltimore, MD"
},
{
"code": "BAL",
"name": "Baltimore, MD"
},
{
"code": "ABE",
"name": "Aberdeen, MD"
},
{
"code": "NRK",
"name": "Newark, DE"
},
{
"code": "WIL",
"name": "Wilmington, DE"
},
{
"code": "PHL",
"name": "Philadelphia, PA"
},
{
"code": "PHN",
"name": "Philadelphia, PA"
},
{
"code": "TRE",
"name": "Trenton, NJ"
},
{
"code": "PJC",
"name": "Princeton Junction, NJ"
},
{
"code": "NBK",
"name": "New Brunswick, NJ"
},
{
"code": "MET",
"name": "Iselin, NJ"
},
{
"code": "EWR",
"name": "Newark, NJ"
},
{
"code": "NWK",
"name": "Newark, NJ"
},
{
"code": "NYP",
"name": "New York, NY"
},
{
"code": "NRO",
"name": "New Rochelle, NY"
},
{
"code": "STM",
"name": "Stamford, CT"
},
{
"code": "BRP",
"name": "Bridgeport, CT"
},
{
"code": "NHV",
"name": "New Haven, CT"
},
{
"code": "STS",
"name": "New Haven, CT"
},
{
"code": "WFD",
"name": "Wallingford, CT"
},
{
"code": "MDN",
"name": "Meriden, CT"
},
{
"code": "BER",
"name": "Berlin, CT"
},
{
"code": "HFD",
"name": "Hartford, CT"
},
{
"code": "WND",
"name": "Windsor, CT"
},
{
"code": "WNL",
"name": "Windsor Locks, CT"
},
{
"code": "SPG",
"name": "Springfield, MA"
},
{
"code": "OSB",
"name": "Old Saybrook, CT"
},
{
"code": "NLC",
"name": "New London, CT"
},
{
"code": "MYS",
"name": "Mystic, CT"
},
{
"code": "WLY",
"name": "Westerly, RI"
},
{
"code": "KIN",
"name": "West Kingston, RI"
},
{
"code": "PVD",
"name": "Providence, RI"
},
{
"code": "RTE",
"name": "Westwood, MA"
},
{
"code": "BBY",
"name": "Boston, MA"
},
{
"code": "BOS",
"name": "Boston, MA"
}
],
"train_numbers": [
"65",
"66",
"67",
"82",
"84",
"85",
"86",
"87",
"88",
"93",
"94",
"95",
"96",
"99",
"111",
"120",
"121",
"122",
"123",
"124",
"125",
"126",
"127",
"129",
"130",
"131",
"132",
"133",
"134",
"135",
"137",
"138",
"139",
"149",
"150",
"151",
"152",
"153",
"154",
"155",
"157",
"158",
"159",
"160",
"161",
"162",
"163",
"164",
"165",
"166",
"167",
"168",
"169",
"170",
"172",
"173",
"174",
"175",
"177",
"178",
"179",
"180",
"181",
"182",
"183",
"184",
"185",
"186",
"187",
"189",
"190",
"192",
"193",
"194",
"195",
"196",
"198",
"1121",
"1135",
"1164",
"1173",
"1174",
"1175",
"1186",
"1192",
"1194",
"1195",
"1776"
]
}请求规范
- 方法与路径: POST /apis/v1/amtrak-com/train-status/get-route
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/amtrak-com/train-status/get-route
{
"operationId": "amtrak-com.train-status.get-route",
"method": "POST",
"path": "/apis/v1/amtrak-com/train-status/get-route",
"servers": [
{
"url": "https://api.aisa.one"
}
],
"parameters": [],
"security": [
{
"bearerAuth": []
}
],
"requestBody": {
"content": {
"application/json": {
"examples": {
"provider": {
"summary": "Official provider example; checked against AIsa request constraints",
"value": {
"code": "NERG"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"code": {
"description": "Route code from list_routes, e.g. NERG Pattern: ^[A-Za-z0-9]{2,8}$.",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
},
"name": {
"description": "Exact route name, e.g. 'Coast Starlight' (case-insensitive)",
"type": "string",
"x-alexandria-option-metadata": {
"in": "body"
}
}
},
"type": "object"
}
}
},
"required": false
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.0005 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
请求体
application/json
响应
One route by code (e.g. NERG) or exact name (e.g. Northeast Regional): cities served, ordered stops with station names, and the train numbers Amtrak maps to the route.
The response contains the tool result directly.
| Documented field | Provider type | Description |
|---|---|---|
cities_served | string | |
code | string | |
name | string | |
observed_at_ms | number | |
stops | object[] | Ordered stops from stopslist.json; empty when the site publishes no stop list for this route |
train_numbers | string[] | Train numbers mapped to this route in TrainCodesResource.xml (ROUTES_TRAIN_NAMES_MAP); empty when none |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.