Amtrak Timetable API
Get Amtrak timetables between station codes for a travel day via REST or OpenAny MCP—with pay-per-use pricing and no subscription. Powered by Apish, pass parameters such as days_ahead, from, output, and retrieve structured data including selected travel date, source connection count, leg train number, origin timezone, and destination timezone for timetable display, and station links.
- Selected price
- $0.002 / billing creditPublished pricing
- Sellers / APIs
- 1 / 1
- Requests · 30d
- 0Selected implementation · last 30 days
- Success rate · 30d
- —No requests in this period
Amtrak Timetable API
Prepare your request, then continue with your agent.
Pricing
$0.002 / billing credit
Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.
- Provider
- API
- Pricing
On this page
Overview
Amtrak Timetable API
Provide from and to station codes with date or days_ahead. Each trip contains legs with station identities, local timezone references and scheduled arrival or departure values; connections remain part of the itinerary.
Quick Facts
| Fact | Value |
|---|---|
| Access | OpenAny REST |
| Authentication | OpenAny API key in the Authorization header |
| Core inputs | Required: from, to. Optional: date, days_ahead. JSON output; fresh=1 bypasses cache and raw=0 omits raw source blocks. |
| Selected implementation | apish · Amtrak timetable between two stations API |
| Billing | See the pricing area for the selected implementation and request options |
What You Can Build
- Timetable display: Keep scheduled legs and connections together.
- Station links: Use source station codes for detail and operational lookups.
Returned Data
| Field | Meaning |
|---|---|
date |
Selected travel date |
trips[].changes |
Source connection count |
trips[].legs[].train_number |
Leg train number |
trips[].legs[].duration_minutes |
Scheduled leg duration in minutes |
trips[].legs[].origin.time_zone |
Origin timezone |
trips[].legs[].destination.time_zone |
Destination timezone |
Quick Start
- Set OPENANY_API_KEY to your OpenAny API key.
- Review the selected implementation and pricing, then adapt the request below to your target.
- Check the HTTP response and business result before reading optional fields.
curl --request GET --get \
https://api.openany.si/v1/agent-apis/apish/amtrak/v1/schedules \
-H "Authorization: Bearer ${OPENANY_API_KEY}" \
--data-urlencode days_ahead=14 \
--data-urlencode from=NYP \
--data-urlencode output=json \
--data-urlencode raw=0 \
--data-urlencode to=WAS
Request and Response Examples
The response example is a documentation reference and may be abbreviated. The documented request is a calling template; use the published contract and returned response for the selected implementation.
Published Amtrak Timetable API implementation contract.
Pricing and Billing
The pricing area reflects the selected API implementation. Review its billing unit and any request-dependent rules before calling; a source service's public availability does not determine OpenAny billing.
Frequently Asked Questions
Related APIs
Playground
Run sends a real API request. Charges follow the published API contract.
Sellers
| Seller | Pricing | Requests · 30d | Performance | Access |
|---|---|---|---|---|
apishCurrent Amtrak timetable between two stations API · GET · View API reference | $0.002 / billing credit | 0 | —successP50— |
- Pricing
- $0.002
Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.
Statistics use persisted gateway logs from the last 30 days up to now, including today.
Success rate = successful requests / all requests;
P50 = median latency of successful requests.
Prices reflect the published API contract. Contract revision: 3. Price update time: not supplied.
API
- Method
- GET
- Endpoint
https://api.openany.si/v1/agent-apis/apish/amtrak/v1/schedules- Content type
- application/json
- Authentication
Authorization: Bearer $OPENANY_API_KEY
Input parameters
Fields in this listing; additional options and input encoding can vary by provider.
| Parameter | Location | Type | Required | Description |
|---|---|---|---|---|
from | URL query parametersquery | string | Yes | Departure station code, e.g. NYP. |
to | URL query parametersquery | string | Yes | Arrival station code, e.g. WAS. |
date | URL query parametersquery | string | No | Travel day, YYYY-MM-DD. Give this or `days_ahead`. |
days_ahead | URL query parametersquery | integer | No | Travel day as days from today (0-365), when `date` is not given. |
raw | URL query parametersquery | string | No | 0 leaves out the bulky `raw` source blocks (often 10-30x smaller). enum: "0", "1" |
fields | URL query parametersquery | string | No | Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included. |
fresh | URL query parametersquery | string | No | 1 skips the 24-hour cache and fetches live. enum: "1" |
output | URL query parametersquery | string | No | JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported. enum: "json" |
records | URL query parametersquery | string | No | With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row. |
Required markers inside a nested object or variant apply when that object or variant is used.
Response structure
cachedbooleancountintegercredits_usedintegerdatestringfetched_atstringfromstringtostringtripsobject[]arrivalstring | nullchangesintegerdeparturestring | nullidintegerlegsobject[]amenitiesstring[]arrivalstringbikebooleanclassesstring[]days_of_operationstring[]departurestringdestinationobjectcodestringfacilitystringnamestringtime_zonestring
distance_milesintegerduration_minutesintegeroperatorstringoriginobjectcodestringfacilitystringnamestringtime_zonestring
overnightbooleanpetsbooleanrestrictedbooleanroutestringroute_codestringself_transferbooleanstopsobject[]alightingbooleanarrivalstringboardingbooleandeparturestringmiles_to_nextintegernumberintegerstationobjectcodestringfacilitystring | nullnamestringtime_zonestring
train_numberstringtypestring
train_numbersstring[]
Composite rule pricing
Calculated from input parameters and actual returned quantities. Estimate the maximum cost before calling.
Base fee: $0.000000. One matching variant replaces the base fee. Matching add-ons and quantity charges are added.
| Fee item | Price | Metering source | When | Quantity limit |
|---|---|---|---|---|
| Actual API.SH credits consumed | $0.002000 / billing credit | Response · /credits_used · Numeric value | Always | 1 billing credit · Decimal places: 0 |
Each quantity charge is rounded before summing: ceil. Requests exceeding this cost limit are rejected; it is not a price cap: $0.002000.
Response quantities settle after the response. Before execution, the maximum quantity determines the reservation; unused reservation is released. Missing or invalid quantities are not treated as zero.
Pricing parameters and defaults
[]
Agent integration
Copy the resource contract without sharing an API key.
Error handling
| Status | Next step |
|---|---|
400 | Check the offering and request fields. |
401 / 403 | Verify your credentials and access permissions. |
402 | Inspect the selected access mode and returned payment requirements. |
429 | Respect the returned rate limit and retry guidance. |
5xx | Inspect the error and usage record before retrying a paid operation. |
Examples
Official example · Live API.SH response · Minimal request
Example from the provider's documentation. Field values in your results will differ.
Prepare your environment
Use a terminal with cURL installed.
Use an OpenAny API key with shared-balance access. Confirm availability and price before running; a call may charge your balance.
Set the key in your terminal using the hidden prompt below. Keep its value out of source files and logs.
Terminal · macOS / Linuxprintf 'OpenAny API key: ' read -r -s OPENANY_API_KEY export OPENANY_API_KEY printf '\n'Run the request
Paste the complete command below into your terminal.
Values to replace before running 9
Review these request fields before running. Keep the published provider and request method unchanged.
from- Departure station code, e.g. NYP.
to- Arrival station code, e.g. WAS.
date- Travel day, YYYY-MM-DD. Give this or `days_ahead`.
days_ahead- Travel day as days from today (0-365), when `date` is not given.
raw- 0 leaves out the bulky `raw` source blocks (often 10-30x smaller).
fields- Comma-separated fields to return, e.g. `posts.id,posts.title`. Call metadata is always included.
fresh- 1 skips the 24-hour cache and fetches live.
output- JSON only for this OpenAny product. Omit output or use json; CSV and NDJSON are not supported.
records- With output=csv|ndjson: the top-level list to turn into rows (e.g. `reviews`), or `.` for the whole object as one row.
Terminal · cURLcurl \ 'https://api.openany.si/v1/agent-apis/apish/amtrak/v1/schedules?days_ahead=14&from=NYP&output=json&raw=0&to=WAS' \ -X GET \ -H "Authorization: Bearer $OPENANY_API_KEY" \ -H 'Content-Type: application/json'Check the response
Sample response · Documented HTTP 200
Sample response{ "cached": false, "count": 45, "credits_used": 1, "date": "2026-12-03", "fetched_at": "2026-11-19T12:24:32.399Z", "from": "NYP", "to": "WAS", "trips": [ { "arrival": "2026-12-03T08:32:00", "changes": 0, "departure": "2026-12-03T04:50:00", "id": 1, "legs": [ { "amenities": [ "Cafe", "Quiet Car", "Free WiFi", "Seat Selection" ], "arrival": "2026-12-03T08:32:00", "bike": true, "classes": [ "Business Class Seat", "Coach Seat" ], "days_of_operation": [ "MON", "TUE", "WED", "THU", "FRI" ], "departure": "2026-12-03T04:50:00", "destination": { "code": "WAS", "facility": "Union Station", "name": "Washington, DC", "time_zone": "America/New_York" }, "distance_miles": 226, "duration_minutes": 222, "operator": "Amtrak", "origin": { "code": "NYP", "facility": "Moynihan Train Hall at Penn Sta.", "name": "New York, NY", "time_zone": "America/New_York" }, "overnight": false, "pets": true, "restricted": false, "route": "Northeast Regional", "route_code": "NERG", "self_transfer": false, "stops": [ { "alighting": true, "arrival": "04:50:00", "boarding": true, "departure": "04:50:00", "miles_to_next": 10, "number": 1, "station": { "code": "NYP", "facility": "Moynihan Train Hall at Penn Sta.", "name": "New York, NY", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "05:05:00", "boarding": true, "departure": "05:06:00", "miles_to_next": 14, "number": 2, "station": { "code": "NWK", "facility": "Penn Station", "name": "Newark, NJ", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "05:18:00", "boarding": true, "departure": "05:20:00", "miles_to_next": 8, "number": 3, "station": { "code": "MET", "facility": null, "name": "Metropark, NJ", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "05:29:00", "boarding": true, "departure": "05:30:00", "miles_to_next": 16, "number": 4, "station": { "code": "NBK", "facility": null, "name": "New Brunswick, NJ", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "05:42:00", "boarding": true, "departure": "05:43:00", "miles_to_next": 10, "number": 5, "station": { "code": "PJC", "facility": null, "name": "Princeton Junction, NJ", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "05:51:00", "boarding": true, "departure": "05:56:00", "miles_to_next": 33, "number": 6, "station": { "code": "TRE", "facility": null, "name": "Trenton, NJ", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "06:24:00", "boarding": true, "departure": "06:27:00", "miles_to_next": 25, "number": 7, "station": { "code": "PHL", "facility": "William H Gray III 30th St. Sta.", "name": "Philadelphia, PA", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "06:47:00", "boarding": true, "departure": "06:49:00", "miles_to_next": 69, "number": 8, "station": { "code": "WIL", "facility": null, "name": "Wilmington, DE", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "07:46:00", "boarding": true, "departure": "07:48:00", "miles_to_next": 11, "number": 9, "station": { "code": "BAL", "facility": "Penn Station", "name": "Baltimore, MD", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "07:59:00", "boarding": true, "departure": "08:01:00", "miles_to_next": 21, "number": 10, "station": { "code": "BWI", "facility": null, "name": "BWI Marshall Airport, MD", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "08:16:00", "boarding": true, "departure": "08:17:00", "miles_to_next": 9, "number": 11, "station": { "code": "NCR", "facility": null, "name": "New Carrollton, MD", "time_zone": "America/New_York" } }, { "alighting": true, "arrival": "08:32:00", "boarding": true, "departure": "08:32:00", "miles_to_next": 0, "number": 12, "station": { "code": "WAS", "facility": "Union Station", "name": "Washington, DC", "time_zone": "America/New_York" } } ], "train_number": "111", "type": "Intercity Train" } ], "train_numbers": [ "111" ] }, { "arrival": null, "changes": 0, "departure": null, "id": 2, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 3, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 4, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 5, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 6, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 7, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 8, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 9, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 10, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 11, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 12, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 13, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 14, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 15, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 16, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 17, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 18, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 19, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 20, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 21, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 22, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 23, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 24, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 25, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 26, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 27, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 28, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 29, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 30, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 31, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 32, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 33, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 34, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 35, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 36, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 37, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 38, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 39, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 40, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 41, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 42, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 43, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 44, "legs": [], "train_numbers": [] }, { "arrival": null, "changes": 0, "departure": null, "id": 45, "legs": [], "train_numbers": [] } ] }