# FRA Railroad Accidents & Incidents Scraper (`compute-edge/fra-railroad-accidents-scraper`) Actor

Extract railroad accident and incident reports from the Federal Railroad Administration (FRA) open data. Filter by state, railroad, year range, accident type, and minimum damage cost. 181,000+ reports since 1975.

- **URL**: https://apify.com/compute-edge/fra-railroad-accidents-scraper.md
- **Developed by:** [Compute Edge](https://apify.com/compute-edge) (community)
- **Categories:** Lead generation
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, NaN bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.00 / 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.

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

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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

## FRA Railroad Accidents & Incidents Scraper

Extract **railroad accident and incident reports** from the **Federal Railroad Administration (FRA)** open data portal. This Actor provides access to over **181,000 accident/incident records** dating back to 1975, sourced directly from the U.S. Department of Transportation's official Socrata API.

Use this scraper to analyze **railroad safety trends**, research **specific derailments or collisions**, identify **high-cost accidents by state or railroad**, and build datasets for **transportation safety research**, **insurance risk analysis**, **regulatory compliance monitoring**, and **investigative journalism**.

### Key Features

- **181,000+ accident records** from 1975 to present
- **Filter by state** — target specific states using two-letter abbreviations (TX, CA, OH, etc.)
- **Filter by railroad** — search by railroad company name (CSX, Union Pacific, BNSF, etc.)
- **Filter by year range** — specify start and end years for targeted analysis
- **Filter by accident type** — derailments, collisions, highway-rail crossings, fires, and more
- **Filter by damage cost** — find only high-cost incidents above your threshold
- **Detailed casualty data** — employees killed/injured, passengers killed/injured, others killed/injured
- **Full damage breakdown** — equipment damage, track damage, and total damage costs
- **Location data** — state, county, station, milepost, latitude, longitude
- **Environmental context** — temperature, visibility, weather conditions
- **Train details** — speed, tonnage, locomotive count, freight/passenger car counts
- **Hazmat tracking** — hazmat cars involved and hazmat releases
- **Accident narratives** — detailed text descriptions when available
- **Direct FRA report links** — URL to the official Form 54 report for each incident

| Field | Description |
|-------|-------------|
| reportingRailroadName | Name of the reporting railroad company |
| date | Date of the accident/incident |
| accidentType | Type of accident (Derailment, Collision, etc.) |
| stateName / stateAbbr | State where the accident occurred |
| countyName | County where the accident occurred |
| station | Nearest station or location name |
| latitude / longitude | Geographic coordinates |
| totalDamageCost | Total damage cost in dollars |
| primaryAccidentCause | Primary cause of the accident |
| totalPersonsKilled | Total fatalities |
| totalPersonsInjured | Total injuries |
| trainSpeed | Speed of the train at time of accident |
| narrative | Detailed text description of the incident |
| reportUrl | Link to official FRA Form 54 report |

### How to Scrape FRA Railroad Accident Data

1. **Go to this Actor's page** on the Apify Store
2. **Click "Start"** to open the input configuration form
3. **Set your filters:**
   - Enter a **State** abbreviation (e.g., `TX` for Texas) or leave blank for all states
   - Enter a **Railroad Name** (e.g., `Union Pacific`) or leave blank for all railroads
   - Set **Start Year** and **End Year** to narrow the date range
   - Enter an **Accident Type** (e.g., `Derailment`) or leave blank for all types
   - Set a **Minimum Total Damage Cost** to filter for major incidents
   - Set **Max Results** to control how many records you want (default: 100)
4. **Click "Start"** to run the Actor
5. **Download your data** in JSON, CSV, Excel, or other formats from the Dataset tab

#### Example: Find All Texas Derailments in 2023 with Damage Over $100,000

```json
{
    "state": "TX",
    "startYear": 2023,
    "endYear": 2023,
    "accidentType": "Derailment",
    "minDamageCost": 100000,
    "maxResults": 500
}
````

#### Example: Find All CSX Accidents Nationwide Since 2020

```json
{
    "railroad": "CSX Transportation",
    "startYear": 2020,
    "maxResults": 1000
}
```

### Pricing

This Actor uses a **pay-per-result** pricing model:

| Cost Type | Price |
|-----------|-------|
| Per Actor start | $0.00005 |
| Per result | $0.002 |

**Example costs:**

- 100 accident records: ~$0.20
- 1,000 accident records: ~$2.00
- 10,000 accident records: ~$20.00

You also pay standard Apify platform compute costs on top of Actor pricing.

### Input Parameters

| Parameter | Type | Required | Default | Description |
|-----------|------|----------|---------|-------------|
| state | string | No | (all) | Two-letter state code (e.g., `TX`, `CA`) |
| railroad | string | No | (all) | Railroad name filter (partial match, e.g., `Union Pacific`) |
| startYear | integer | No | (any) | Start year (1975-2030) |
| endYear | integer | No | (any) | End year (1975-2030) |
| accidentType | string | No | (all) | Accident type (e.g., `Derailment`, `Collision`) |
| minDamageCost | integer | No | (none) | Minimum total damage cost in dollars |
| maxResults | integer | No | 100 | Maximum results to return (1-200,000) |

### Output Example

```json
{
    "reportingRailroadCode": "UP",
    "reportingRailroadName": "Union Pacific Railroad Company",
    "accidentNumber": "0723GC025",
    "year": 2023,
    "date": "2023-07-17T00:00:00.000",
    "time": "6:10 PM",
    "accidentTypeCode": "11",
    "accidentType": "Fire/violent rupture",
    "stateCode": "48",
    "stateAbbr": "TX",
    "stateName": "TEXAS",
    "countyName": "VICTORIA",
    "station": "VICTORIA",
    "milepost": "221.0",
    "latitude": 28.805,
    "longitude": -96.985,
    "temperature": 89.0,
    "visibility": "Dusk",
    "weatherCondition": "Clear",
    "trackType": "Yard",
    "trackClass": "1",
    "trainDirection": "South",
    "trainSpeed": 10,
    "maximumSpeed": 10,
    "grossTonnage": 1394,
    "headendLocomotives": 1,
    "loadedFreightCars": 10,
    "loadedPassengerCars": 0,
    "equipmentDamageCost": 50000,
    "trackDamageCost": 0,
    "totalDamageCost": 50000,
    "primaryAccidentCauseCode": "E74L",
    "primaryAccidentCause": "Electrically caused fire (LOCOMOTIVE)",
    "railroadEmployeesKilled": 0,
    "railroadEmployeesInjured": 0,
    "passengersKilled": 0,
    "passengersInjured": 0,
    "othersKilled": 0,
    "othersInjured": 0,
    "totalPersonsKilled": 0,
    "totalPersonsInjured": 0,
    "hazmatCars": 0,
    "hazmatReleasedCars": 0,
    "narrative": "AT 6:10 PM A FIRE WAS REPORTED ON A LOCOMOTIVE...",
    "reportUrl": "https://safetydata.fra.dot.gov/Officeofsafety/Publicsite/FORM54/F54Report.aspx?..."
}
```

### FAQ

#### Is it legal to scrape FRA railroad accident data?

Yes. This Actor accesses publicly available data from the U.S. Department of Transportation's open data portal. The data is public government data made freely available under open data initiatives. No authentication is required.

#### How Much Does It Cost to Scrape FRA Data?

See the pricing table above. At $0.002 per result, fetching 1,000 accident records costs approximately $2.00 in Actor fees plus minimal Apify compute costs.

#### Can I export FRA data to Excel or CSV?

Yes. Apify supports exporting results in JSON, CSV, Excel, XML, and other formats directly from the Dataset tab after a run completes.

#### How often is the FRA data updated?

The FRA updates the Socrata dataset regularly. Most recent data is typically available within a few months of the incident date. You can schedule this Actor to run at any interval.

#### What date range does the data cover?

The FRA database contains over 181,000 accident/incident records dating back to 1975, with data extending to the present.

### Other Scrapers by SeatSignal

- [NHTSA Vehicle Safety Scraper](https://apify.com/seatsignal/nhtsa-vehicle-safety-scraper) — Extract vehicle recalls, complaints, and safety investigations
- [OSHA Inspections Scraper](https://apify.com/seatsignal/osha-inspections-scraper) — Extract OSHA workplace safety inspection data
- [MSHA Mine Safety Scraper](https://apify.com/seatsignal/msha-mine-safety-scraper) — Extract mine safety and health inspection data
- [FEMA Disasters Scraper](https://apify.com/seatsignal/fema-disasters-scraper) — Extract federal disaster declaration data
- [NREL Alternative Fuel Stations Scraper](https://apify.com/seatsignal/nrel-alt-fuel-stations-scraper) — Extract EV charging and alternative fuel station data

### Legal Disclaimer

This Actor extracts publicly available data from the U.S. Department of Transportation's open data portal (data.transportation.gov). This is public government data made freely available under open data initiatives. The data is provided "as is" without warranty. Users are responsible for ensuring their use of the data complies with applicable laws and regulations. This Actor does not access any restricted, private, or authenticated data sources.

For questions or support, contact the Actor author through the Apify Store.

# Actor input Schema

## `state` (type: `string`):

Two-letter state abbreviation to filter by (e.g. 'TX', 'CA', 'OH'). Leave empty for all states.

## `railroad` (type: `string`):

Railroad name to filter by (e.g. 'CSX Transportation', 'Union Pacific Railroad Company'). Partial match supported via LIKE. Leave empty for all railroads.

## `startYear` (type: `integer`):

Start year for filtering (e.g. 2020). Data available from 1975.

## `endYear` (type: `integer`):

End year for filtering (e.g. 2024). Defaults to current year if start year is set.

## `accidentType` (type: `string`):

Filter by accident type description (e.g. 'Derailment', 'Hwy-rail crossing', 'Collision', 'Fire/violent rupture').

## `minDamageCost` (type: `integer`):

Minimum total damage cost in dollars. Only returns accidents with damage at or above this amount.

## `maxResults` (type: `integer`):

Maximum number of accident records to return.

## Actor input object example

```json
{
  "state": "",
  "railroad": "",
  "accidentType": "",
  "maxResults": 100
}
```

# Actor output Schema

## `dataset` (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 = {};

// Run the Actor and wait for it to finish
const run = await client.actor("compute-edge/fra-railroad-accidents-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 = {}

# Run the Actor and wait for it to finish
run = client.actor("compute-edge/fra-railroad-accidents-scraper").call(run_input=run_input)

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

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

```

## CLI example

```bash
echo '{}' |
apify call compute-edge/fra-railroad-accidents-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=compute-edge/fra-railroad-accidents-scraper",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "FRA Railroad Accidents & Incidents Scraper",
        "description": "Extract railroad accident and incident reports from the Federal Railroad Administration (FRA) open data. Filter by state, railroad, year range, accident type, and minimum damage cost. 181,000+ reports since 1975.",
        "version": "0.1",
        "x-build-id": "FBMfGsf3cIjzBB2XT"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/compute-edge~fra-railroad-accidents-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-compute-edge-fra-railroad-accidents-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/compute-edge~fra-railroad-accidents-scraper/runs": {
            "post": {
                "operationId": "runs-sync-compute-edge-fra-railroad-accidents-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/compute-edge~fra-railroad-accidents-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-compute-edge-fra-railroad-accidents-scraper",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "state": {
                        "title": "State",
                        "type": "string",
                        "description": "Two-letter state abbreviation to filter by (e.g. 'TX', 'CA', 'OH'). Leave empty for all states.",
                        "default": ""
                    },
                    "railroad": {
                        "title": "Railroad Name",
                        "type": "string",
                        "description": "Railroad name to filter by (e.g. 'CSX Transportation', 'Union Pacific Railroad Company'). Partial match supported via LIKE. Leave empty for all railroads.",
                        "default": ""
                    },
                    "startYear": {
                        "title": "Start Year",
                        "minimum": 1975,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "Start year for filtering (e.g. 2020). Data available from 1975."
                    },
                    "endYear": {
                        "title": "End Year",
                        "minimum": 1975,
                        "maximum": 2030,
                        "type": "integer",
                        "description": "End year for filtering (e.g. 2024). Defaults to current year if start year is set."
                    },
                    "accidentType": {
                        "title": "Accident Type",
                        "type": "string",
                        "description": "Filter by accident type description (e.g. 'Derailment', 'Hwy-rail crossing', 'Collision', 'Fire/violent rupture').",
                        "default": ""
                    },
                    "minDamageCost": {
                        "title": "Minimum Total Damage Cost ($)",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Minimum total damage cost in dollars. Only returns accidents with damage at or above this amount."
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 200000,
                        "type": "integer",
                        "description": "Maximum number of accident records to return.",
                        "default": 100
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
