Search stations
curl --request POST \
--url https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"q": "Chicago"
}'import requests
url = "https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations"
payload = { "q": "Chicago" }
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({q: 'Chicago'})
};
fetch('https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations', 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/search-stations",
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([
'q' => 'Chicago'
]),
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/search-stations"
payload := strings.NewReader("{\n \"q\": \"Chicago\"\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/search-stations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"Chicago\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations")
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 \"q\": \"Chicago\"\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"location_count": 5,
"observed_at_ms": 1790117600078,
"query": "Chicago",
"source_url": "https://www.amtrak.com/services/maps.stationfinder.json?searchTerm=Chicago",
"stations": [
{
"address": {
"city": "Chicago",
"line1": "255 South Clinton Street",
"line2": null,
"postal_code": "60606",
"state": "IL"
},
"aliases": [
"Union Station"
],
"code": "CHI",
"display_name": "Chicago, IL - Union Station (CHI)",
"facility_name": "Union Station",
"geo": {
"lat": 41.87899985314727,
"lng": -87.64102075320515
},
"match_type": "name",
"name": "Chicago, IL",
"rank": null,
"url": "https://www.amtrak.com/stations/chi"
}
]
}Amtrak
Search stations
Find a station code when you know a place name or a partial name; get_station for full detail.
POST
https://api.aisa.one
/
apis
/
v1
/
amtrak-com
/
train-status
/
search-stations
Search stations
curl --request POST \
--url https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"q": "Chicago"
}'import requests
url = "https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations"
payload = { "q": "Chicago" }
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({q: 'Chicago'})
};
fetch('https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations', 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/search-stations",
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([
'q' => 'Chicago'
]),
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/search-stations"
payload := strings.NewReader("{\n \"q\": \"Chicago\"\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/search-stations")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"q\": \"Chicago\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations")
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 \"q\": \"Chicago\"\n}"
response = http.request(request)
puts response.read_body{
"count": 1,
"location_count": 5,
"observed_at_ms": 1790117600078,
"query": "Chicago",
"source_url": "https://www.amtrak.com/services/maps.stationfinder.json?searchTerm=Chicago",
"stations": [
{
"address": {
"city": "Chicago",
"line1": "255 South Clinton Street",
"line2": null,
"postal_code": "60606",
"state": "IL"
},
"aliases": [
"Union Station"
],
"code": "CHI",
"display_name": "Chicago, IL - Union Station (CHI)",
"facility_name": "Union Station",
"geo": {
"lat": 41.87899985314727,
"lng": -87.64102075320515
},
"match_type": "name",
"name": "Chicago, IL",
"rank": null,
"url": "https://www.amtrak.com/stations/chi"
}
]
}请求规范
- 方法与路径: POST /apis/v1/amtrak-com/train-status/search-stations
- 可用状态: enabled
- 请求 URL 模板:
https://api.aisa.one/apis/v1/amtrak-com/train-status/search-stations
{
"operationId": "amtrak-com.train-status.search-stations",
"method": "POST",
"path": "/apis/v1/amtrak-com/train-status/search-stations",
"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": {
"q": "Chicago"
}
}
},
"schema": {
"additionalProperties": true,
"properties": {
"q": {
"description": "Search term: city, station name, alias or code",
"type": "string"
}
},
"required": [
"q"
],
"type": "object"
}
}
},
"required": true
},
"x-aisa-status": "enabled",
"components": {
"securitySchemes": {
"bearerAuth": {
"scheme": "bearer",
"type": "http"
}
}
}
}
费用与请求规则
按实际用量收费。 默认请求预估费用:$0.0005 USD。 最终费用以实际用量为准。 账户适用价格可能不同;支持报价的接口可按实际请求获取报价。授权
响应
Station finder autocomplete of amtrak.com: free-text search by station name, city, alias or 3-letter code. Returns matching stations with street address and coordinates. Non-station place suggestions the geocoder returns are counted, not listed.
The response contains the tool result directly.
The provider identifies stations as the primary payload key.
| Documented field | Provider type | Description |
|---|---|---|
address | object | Street address from the station finder; null when the finder has no record for the code. |
aliases | string[] | |
code | string | 3-letter station code |
display_name | string | Autocomplete label, e.g. 'Chicago, IL - Union Station (CHI)' |
facility_name | string | |
geo | object | WGS84 coordinates from the station finder; null when unavailable. |
match_type | string | How the term matched: name, code, alias, city ... as the source states it |
name | string | Station name, e.g. 'Chicago, IL' |
rank | number | Station rank from the source; null when blank |
url | string |
These are the provider's documented fields. Field requiredness, nullability and nested object structures are specified only where the descriptions explicitly say so.