# Amtrak Train Tracker Scraper (`parseforge/amtrak-train-tracker-scraper`) Actor

Collects live Amtrak train positions, speeds, and schedule status from the public tracker feed. Returns each active train as a flat row with coordinates, delay minutes, and route name.

- **URL**: https://apify.com/parseforge/amtrak-train-tracker-scraper.md
- **Developed by:** [ParseForge](https://apify.com/parseforge) (community)
- **Categories:** Automation, Integrations, Travel
- **Stats:** 3 total users, 0 monthly users, 90.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $7.50 / 1,000 results

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

[![ParseForge](https://raw.githubusercontent.com/ParseForge/apify-assets/main/banner.jpg)](https://apify.com/parseforge?fpr=vmoqkp)

### Amtrak Train Tracker Scraper

**Track Amtrak trains in real time by route, train number, or station, up to a million per run.** Each train record includes its current speed, location coordinates, arrival estimates, and schedule status. No API key required. Export to CSV, JSON, Excel, or XML.

Amtrak's public train tracker website shows live positions, but collecting that data at scale for analysis or monitoring means manual copying or brittle screen scraping. This Actor reads the same real-time feeds the official map uses, filters by route name, and returns every active train in one consistent row. No browser, no login, and no Amtrak developer account needed.

| Who uses it | What they scrape Amtrak for |
|---|---|
| Transit analysts | Measure on-time performance and delay patterns across the Amtrak network. |
| Travel app developers | Power a custom arrival board or map overlay with live train locations. |
| Rail enthusiasts | Log every movement of a specific route or locomotive over a day. |
| Logistics coordinators | Monitor a connecting train's ETA to adjust pickup or transfer schedules. |

### What it does

This Actor collects live Amtrak train positions and schedule data from the public tracker feed and returns each active train as a flat row.

- 🚂 **Route filter:** Narrow results to a specific service like Acela, Northeast Regional, or Empire Builder by typing a partial route name.
- 📍 **Live position data:** Latitude, longitude, speed, and heading for every train currently in motion.
- ⏱️ **Schedule context:** Each record includes the posted departure and arrival times plus any delay minutes reported by the tracker.
- 📦 **Flat row output:** One train per row, ready for a spreadsheet, database, or dashboard without nested JSON parsing.

Results export to CSV, JSON, Excel, or XML, or straight from the API.

### What you can do with Amtrak data

**🚉 Build a live arrival display.**

A transit agency runs the Actor every 60 seconds for the Northeast Corridor, filters to 'Northeast Regional', and pushes the ETA and track data to a public status screen.

**📊 Analyze on-time trends.**

A researcher collects every active train every 5 minutes for a week, then computes average delay minutes by route and time of day to publish a performance report.

**🗺️ Populate a railfan map.**

A hobbyist developer runs the Actor with no route filter, stores the lat/lon of every train, and renders them as moving icons on a personal web map.

**📱 Send delay alerts to travelers.**

A travel app monitors a specific train number each morning and pushes a notification to users when the delay field exceeds 15 minutes.

### Why choose this scraper

|  | What you get |
|---|---|
| **No API registration** | Reads the same public endpoint the official Amtrak map uses, so you skip OAuth and rate-limit paperwork. |
| **Real-time snapshots** | Every run pulls the current state of active trains, not cached or historical data. |
| **Route-level filtering** | Collect only the trains you care about by passing a route name like 'Sunset Limited'. |
| **Scalable collection** | Set maxItems up to 1,000,000 to capture every active train across the entire country in one run. |

### How it compares

No other Store actor targets Amtrak the same way, so the honest comparison is with the alternatives teams actually weigh.

| | Amtrak Train Tracker Scraper | Build it in-house | By hand |
|---|---|---|---|
| Setup | Run it now, zero config | Days of engineering | None, but hours per pull |
| When Amtrak changes | Maintained for you | You fix it | You re-learn the page |
| Proxies, retries, anti-bot | Built in | Your problem | Browser only |
| Output | Fixed JSON schema, CSV/Excel export | Whatever you build | Copy-paste |
| Cost | Pay per result | Engineering time | Analyst hours |

### Configure the run

Drive the Actor by setting a maximum number of trains to collect and an optional route name substring filter that runs as each record is read so only matching trains reach your dataset. The Input tab lists every parameter.

A first run with the defaults:

```json
{
  "maxItems": 10
}
```

A larger pull:

```json
{
  "maxItems": 200
}
```

### Pricing

Pay-per-result: **$0.0085 per result** collected. You pay only for the results written to your dataset.

| Results collected | Approximate cost |
|---|---|
| 100 results | $0.85 |
| 1,000 results | $8.50 |
| 10,000 results | $85.00 |

New Apify accounts start with $5 in free credit.

### Free users

Free-plan runs return up to 10 results as a preview. [Upgrade your Apify plan](https://console.apify.com/sign-up?fpr=vmoqkp) to collect up to 1,000,000 results per run.

### Run it

1. [Create a free Apify account with $5 in credit](https://console.apify.com/sign-up?fpr=vmoqkp).
2. Open the [Amtrak Train Tracker Scraper](https://apify.com/parseforge/amtrak-train-tracker-scraper?fpr=vmoqkp).
3. Set your inputs and any filters, then click **Start**.
4. Export the results as CSV, Excel, JSON, or XML from the **Dataset** tab.

Run it programmatically through the [Apify API](https://docs.apify.com/api/v2) (`run-sync-get-dataset-items`) or the [ApifyClient](https://docs.apify.com/api/client/js) for JavaScript and Python.

### Use with AI agents (MCP)

Give an AI agent live access to Amtrak through the Model Context Protocol. Add the Actor to Claude, Cursor, or any MCP client:

```bash
claude mcp add --transport http apify "https://mcp.apify.com/?tools=parseforge/amtrak-train-tracker-scraper"
```

Then prompt it in plain language to run the scraper and read back the results.

### Troubleshooting

**Why am I getting zero results?**

Check your route filter spelling. The filter matches a substring, so 'Acela' works but 'Acella' does not. Also try running without any route filter to confirm trains are active on the network.

**The Actor runs but returns fewer trains than I expected.**

The Amtrak tracker only shows trains that are currently in motion or stopped at a station with an active status. Trains that have completed their run or are not yet dispatched will not appear.

**Some fields are empty or null in the output.**

The upstream tracker does not always populate every field for every train. Delay minutes, for example, may be absent when a train is running on time or the data is temporarily unavailable.

**The location data seems stale or frozen.**

Amtrak's feed updates on a cycle. If a train is stopped at a station or in a dead zone, its last reported position may persist. Run the Actor again after a minute to get a fresh snapshot.

### FAQ

| Question | Answer |
|---|---|
| Does this Actor need an Amtrak API key or account? | No. It reads the same public data feed that powers the official Amtrak train tracker map, so no registration or credentials are required. |
| How often is the data refreshed? | The Actor pulls a fresh snapshot from the Amtrak tracker endpoint on every run. Schedule it to run as frequently as every minute on Apify for near-real-time updates. |
| Can I filter by a specific train number? | The input schema provides a route name filter. To isolate a specific train number, collect all trains and filter the resulting dataset by the train number field after the run completes. |
| What geographic area does this cover? | It covers the entire Amtrak national network. Every active train that appears on the public tracker map is available, from the Northeast Corridor to long-distance western routes. |
| Does this Actor return historical train data? | No, it returns only the live positions and schedule status of trains that are active at the moment the run executes. To build history, schedule recurring runs and store the results. |
| What format is the location data in? | Latitude and longitude are returned as decimal degrees. Speed is typically in miles per hour, and heading is in degrees from true north. |
| Can I get station stop information for each train? | The tracker feed includes the next station and estimated arrival time where available. Past stops and full route itineraries are not part of the live tracker data. |
| Is there a limit to how many trains I can collect? | You set the maximum with the maxItems field, up to 1,000,000 per run. The total number of active Amtrak trains at any moment is typically far below that ceiling. |

### Related actors

Browse the full [ParseForge collection](https://apify.com/parseforge?fpr=vmoqkp) for more scrapers.

🆘 **Need help?** Email parseforge@protonmail.com with your run ID, your input, and what you expected.

⚠️ **Disclaimer.** This Actor is unofficial and is not affiliated with, endorsed by, or sponsored by National Railroad Passenger Corporation. It collects only publicly available data. You are responsible for using the collected data in compliance with the source's terms of service and applicable data-protection laws, including GDPR, CCPA, and PIPL. Do not use it to collect personal data unlawfully.

# Actor input Schema

## `maxItems` (type: `integer`):

How many trains to collect per run.

## `route` (type: `string`):

Optional route name substring to filter (e.g. Acela, Northeast Regional).

## Actor input object example

```json
{
  "maxItems": 10
}
```

# Actor output Schema

## `results` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "maxItems": 10
};

// Run the Actor and wait for it to finish
const run = await client.actor("parseforge/amtrak-train-tracker-scraper").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "maxItems": 10 }

# Run the Actor and wait for it to finish
run = client.actor("parseforge/amtrak-train-tracker-scraper").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "maxItems": 10
}' |
apify call parseforge/amtrak-train-tracker-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,parseforge/amtrak-train-tracker-scraper"
        }
    }
}

```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/bEiC1ISCEa2du48jd/builds/1fLkrvcu43LnaawN7/openapi.json
