Amtrak APIamtrak.com ↗
Search Amtrak trains, compare fares across fare families, look up station details, and retrieve discount programs via a structured JSON API.
What is the Amtrak API?
This API exposes 7 endpoints covering Amtrak train search, fare comparison, station lookup, and support data. Use search_trains to query available journeys between any two station codes on a given date, getting back departure and arrival times, seat availability, and fare families (Value, Flexible, Saver) in a single call. Companion endpoints handle station autocomplete, cheapest-fare lookups, full train schedules, discount programs, and contact information.
No input parameters required.
curl -X GET 'https://api.parse.bot/scraper/f800c27d-0aaa-4ca0-864e-4dc69e20f764/get_stations' \ -H 'X-API-Key: $PARSE_API_KEY'
Typed, relational, agent-ready
A generated client with real types, enums, and the links between objects — the structure a flat JSON response can't carry. Autocompletes in your editor and reads cleanly to coding agents.
- Fully typed · autocompletes
- Objects link to objects
- Typed errors & pagination
Typed Python client. Set up the SDK in your uv project, then pull this API’s typed client:
uv add parse-sdk uv run parse init uv run parse add --marketplace amtrak-com-api
uv run parse add --marketplace pulls a pinned snapshot of this canonical API — it won’t change underneath you. To customize it, subscribe and swap to your own copy.
"""Walkthrough: Amtrak SDK — search stations, compare fares, check schedules."""
from parse_apis.Amtrak_API import Amtrak, Origin, Destination, PassengerType, NotFoundError
client = Amtrak()
# Search for stations matching "New York" — resolve names to codes.
for match in client.station_matches.search(term="New York", limit=3):
print(match.display_name, match.station_code)
# List all stations and check accessibility for a few.
for station in client.stations.list(limit=5):
print(station.station_code, station.staffed, station.station_accessible)
# Find the cheapest fare from Boston to New York.
fare = client.fares.cheapest(origin=Origin.BOS, destination=Destination.NYP, departure_date="2026-07-15")
print(fare.train_name, fare.price, fare.travel_class, fare.fare_family)
# Get detailed schedule for that train.
try:
schedule = client.train_schedules.get(
train_number=fare.train_number,
origin=Origin.BOS,
destination=Destination.NYP,
start_date=fare.departure,
)
print(schedule.name, schedule.days_of_operation)
for stop in schedule.stops[:3]:
print(stop.station_code, stop.arrival, stop.departure)
except NotFoundError as exc:
print(f"Train not found: {exc}")
# Search for available trains with full journey details.
result = client.journey_results.search(
origin=Origin.BOS,
destination=Destination.NYP,
departure_date="2026-07-15",
passenger_type=PassengerType.ADULT,
)
print(result.success, len(result.journey_legs))
# List available everyday discounts.
for discount in client.discounts.list(limit=6):
print(discount.name, discount.description)
print("exercised: stations.list / station_matches.search / fares.cheapest / train_schedules.get / journey_results.search / discounts.list")
Retrieve all Amtrak stations with their codes and accessibility details. Returns the full station list in a single response. Each station includes flags for QuikTrak kiosk availability, staffing, ADA accessibility, and wheelchair availability.
No input parameters required.
{
"type": "object",
"fields": {
"stations": "array of station objects each with stationCode, quikTrakAvailable, staffed, stationAccessible, wheelChairAvailable"
},
"sample": {
"data": {
"stations": [
{
"staffed": true,
"stationCode": "BOS",
"quikTrakAvailable": true,
"stationAccessible": true,
"wheelChairAvailable": true
},
{
"staffed": false,
"stationCode": "AAM",
"quikTrakAvailable": false,
"stationAccessible": false,
"wheelChairAvailable": false
}
]
},
"status": "success"
}
}About the Amtrak API
Station Lookup and Autocomplete
get_stations returns the complete Amtrak station list in one response. Each station object includes a stationCode, plus boolean flags for quikTrakAvailable, staffed, stationAccessible, and wheelChairAvailable. When you only have a city name or partial code, get_station_autocomplete accepts a term string — such as 'Boston' or 'NYP' — and returns matching stations with displayName, city, state, address1, postalCode, and geographic coordinates. Station codes returned here are the inputs required by the train search and fare endpoints.
Train Search and Fare Data
search_trains accepts origin, destination, and departure_date (YYYY-MM-DD), with optional return_date for round-trip queries and num_adults for party size. The response includes journeySolutionOption objects containing journey legs, fare options across Value (VLU), Flexible (FLX), and Saver (SVR) families, seat availability inventory, and ancillary flags for pets and bicycles. For a faster single-value answer, get_cheapest_fare returns the lowest available price in USD alongside train_name, train_number, departure, arrival, class, and fare_family for a given origin-destination-date combination.
Train Details and Discounts
get_train_details takes a train_number and start_date obtained from search_trains results, plus origin and destination, and returns the full stop sequence with per-stop arrival and departure times, station facilities, and onboard amenities under travelService and schedulesAndStops. get_everyday_discounts returns a structured list of Amtrak's permanent discount programs — children, seniors, students, military, passengers with disabilities, and groups — each with a name and description. get_support_info rounds out the API with department phone numbers, FAQ content, headquarters address, safety contacts, and available support channels.
The Amtrak API is a managed, monitored endpoint for amtrak.com — not a raw scraper you maintain. Every endpoint is automatically health-checked on a schedule, and when amtrak.com changes and a check fails, the API is automatically queued for repair and re-verified. It is built to keep working as the site underneath it changes.
This isn't an official amtrak.com API — it's an independent, maintained REST wrapper over public data. Where the source has no official API (or only a limited one), Parse gives you a stable contract over a source that never promised one, and keeps it current. Need a new endpoint or field? You can revise it yourself in plain English and the agent rebuilds it against the live site in minutes — contributing the change back to the shared API is free.
Will this API break when the source site changes?+
Is this an official API from the source site?+
Can I fix or extend this API myself if I need a new endpoint or field?+
What happens if I call an endpoint that has an issue?+
- Build a fare-calendar app that calls get_cheapest_fare for each day in a date range to surface the lowest prices on a route
- Power a station-picker UI with get_station_autocomplete so users can type city names and resolve them to valid station codes
- Display ADA and wheelchair accessibility flags from get_stations to help travelers with mobility needs filter stations
- Aggregate seat availability and fare family data from search_trains to compare Value vs. Flexible vs. Saver pricing on a given route
- Show the full intermediate stop list and onboard amenities for a selected train using get_train_details
- Surface discount eligibility information from get_everyday_discounts for student, military, or senior travelers
- Populate a customer support page with department phone numbers, chat hours, and FAQ content from get_support_info
| Tier | Price | Credits/month | Rate limit |
|---|---|---|---|
| Free | $0/mo | 100 | 5 req/min |
| Hobby | $30/mo | 1,000 | 20 req/min |
| Developer | $100/mo | 5,000 | 100 req/min |
One credit = one API call regardless of which marketplace API you call. Exceeding the rate limit returns a 429 response. Authenticate with the X-API-Key header.