# FRA Highway-Rail Grade Crossing Incidents (250K+) (`compute-edge/fra-grade-crossings-scraper`) Actor

Extract highway-rail grade crossing incident reports from FRA open data. Filter by state, railroad, year, and highway user type. 250K+ incident records with casualties, vehicle/train data, and weather conditions.

- **URL**: https://apify.com/compute-edge/fra-grade-crossings-scraper.md
- **Developed by:** [Compute Edge](https://apify.com/compute-edge) (community)
- **Categories:** Other
- **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 Highway-Rail Grade Crossing Incidents Scraper

Extract **highway-rail grade crossing incident reports** from the **Federal Railroad Administration (FRA)** open data portal. This Actor provides access to over **250,000 grade crossing incident records** dating back to 1975, sourced directly from the U.S. Department of Transportation's official Socrata API.

Use this scraper to analyze **grade crossing safety trends**, research **specific incidents by location or railroad**, identify **high-risk crossings by casualties or damage**, and build datasets for **transportation safety research**, **railroad liability analysis**, **risk assessment**, and **investigative journalism**.

### Key Features

- **250,000+ incident records** from 1975 to present
- **Filter by state** — target specific states (Texas, California, Ohio, etc.)
- **Filter by railroad** — search by railroad company name (Union Pacific, CSX, BNSF, etc.)
- **Filter by year range** — specify start and end years for targeted analysis
- **Filter by highway user type** — auto, truck, bus, pedestrian, motorcycle, or other
- **Detailed casualty data** — total killed and injured
- **Equipment tracking** — equipment involved, equipment type, equipment struck
- **Location data** — state, county, city, highway name
- **Environmental context** — temperature, visibility, weather conditions
- **Train details** — train speed during incident
- **Vehicle information** — estimated vehicle speed and direction
- **Damage assessment** — vehicle damage classification
- **Warning devices** — crossing warning device status
- **Hazmat tracking** — hazmat involvement classification
- **Incident narratives** — detailed text descriptions when available

| Field | Description |
|-------|-------------|
| railroadName | Name of the railroad involved |
| date | Date of the grade crossing incident |
| stateName / countyName | State and county where the incident occurred |
| cityName | City or nearest city to the incident |
| highwayName | Name of the highway at the crossing |
| highwayUser | Type of highway user (Auto, Truck, Bus, Pedestrian, etc.) |
| vehicleSpeed | Estimated speed of vehicle (mph) |
| trainSpeed | Speed of the train (mph) |
| publicPrivate | Whether crossing is public or private |
| warningDevice | Type of warning device at crossing |
| equipmentInvolved | Type of vehicle/equipment involved |
| equipmentType | More detailed equipment type |
| totalKilled | Total fatalities |
| totalInjured | Total injuries |
| vehicleDamage | Severity of vehicle damage |
| hazmatInvolvement | Whether hazmat was involved |
| narrative | Detailed text description of the incident |

### How to Scrape FRA Grade Crossing Incident 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** name (e.g., `Texas`, `California`) 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 a **Highway User Type** (e.g., `Auto`, `Truck`) or leave blank for all types
   - 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 Auto-vs-Train Incidents in 2022-2023 with Fatalities

```json
{
    "state": "Texas",
    "highwayUser": "Auto",
    "startYear": 2022,
    "endYear": 2023,
    "maxResults": 500
}
````

#### Example: Find All Union Pacific Grade Crossing Incidents Nationwide Since 2020

```json
{
    "railroad": "Union Pacific",
    "startYear": 2020,
    "maxResults": 1000
}
```

#### Example: Find All Truck-Involved Grade Crossing Incidents Nationwide

```json
{
    "highwayUser": "Truck",
    "maxResults": 2000
}
```

### Pricing

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

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

**Example costs:**

- 100 incident records: ~$0.30
- 1,000 incident records: ~$3.00
- 10,000 incident records: ~$30.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) | State name (e.g., `Texas`, `California`) |
| 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) |
| highwayUser | string | No | (all) | Highway user type (e.g., `Auto`, `Truck`, `Bus`) |
| maxResults | integer | No | 100 | Maximum results to return (1-250,000) |

### Output Example

```json
{
    "date": "2023-06-15T00:00:00.000",
    "time": "3:45 PM",
    "railroadCode": "UP",
    "railroadName": "Union Pacific Railroad Company",
    "incidentNumber": "0623GC001",
    "gradeCrossingId": "TX1234567",
    "stateName": "Texas",
    "countyName": "Harris",
    "cityName": "Houston",
    "highwayName": "State Highway 290",
    "publicPrivate": "Public",
    "highwayUser": "Auto",
    "vehicleSpeed": 35,
    "vehicleDirection": "East",
    "equipmentInvolved": "Automobile",
    "equipmentType": "2-door sedan",
    "equipmentStruck": "Yes",
    "hazmatInvolvement": "No",
    "temperature": 92.5,
    "visibility": "Good",
    "weatherCondition": "Clear",
    "trainSpeed": 45,
    "totalKilled": 0,
    "totalInjured": 2,
    "vehicleDamage": "Major",
    "warningDevice": "Crossing gate and bells",
    "narrative": "Vehicle failed to stop at crossing gate and collided with freight train. Driver and passenger sustained non-life-threatening injuries."
}
```

### FAQ

#### Is it legal to scrape FRA grade crossing 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 Grade Crossing Data?

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

#### Can I export grade crossing 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 250,000 grade crossing incident records dating back to 1975, with data extending to the present.

#### What are the different highway user types?

Common highway user types in the dataset include: Auto (passenger car), Truck, Bus, Pedestrian, Motorcycle, Farm Equipment, Other Motor Vehicle, and more.

#### Can I filter by multiple states at once?

Currently, the input accepts a single state name. To extract data for multiple states, run the Actor multiple times with different state filters, or request a larger maxResults value and filter the results afterward.

### Data Quality

This dataset is maintained by the Federal Railroad Administration and represents officially reported grade crossing incidents. Data quality and completeness may vary depending on reporting requirements and railroad company practices. Some fields may be null for older incidents or those with incomplete reporting.

### Other Scrapers by SeatSignal

- [FRA Railroad Accidents & Incidents Scraper](https://apify.com/seatsignal/fra-railroad-accidents-scraper) — Extract railroad accident reports (181,000+ records)
- [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`):

State name to filter by (e.g. 'Texas', 'California', 'Ohio'). Leave empty for all states.

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

Railroad name to filter by (e.g. '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.

## `highwayUser` (type: `string`):

Filter by highway user type (e.g. 'Auto', 'Truck', 'Bus', 'Pedestrian', 'Motorcycle'). Partial match supported. Leave empty for all types.

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

Maximum number of incident records to return.

## Actor input object example

```json
{
  "state": "",
  "railroad": "",
  "highwayUser": "",
  "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-grade-crossings-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-grade-crossings-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-grade-crossings-scraper --silent --output-dataset

```

## MCP server setup

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

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "FRA Highway-Rail Grade Crossing Incidents (250K+)",
        "description": "Extract highway-rail grade crossing incident reports from FRA open data. Filter by state, railroad, year, and highway user type. 250K+ incident records with casualties, vehicle/train data, and weather conditions.",
        "version": "0.1",
        "x-build-id": "orMmVVbVk88qlIgla"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/compute-edge~fra-grade-crossings-scraper/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-compute-edge-fra-grade-crossings-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-grade-crossings-scraper/runs": {
            "post": {
                "operationId": "runs-sync-compute-edge-fra-grade-crossings-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-grade-crossings-scraper/run-sync": {
            "post": {
                "operationId": "run-sync-compute-edge-fra-grade-crossings-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": "State name to filter by (e.g. 'Texas', 'California', 'Ohio'). Leave empty for all states.",
                        "default": ""
                    },
                    "railroad": {
                        "title": "Railroad Name",
                        "type": "string",
                        "description": "Railroad name to filter by (e.g. '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."
                    },
                    "highwayUser": {
                        "title": "Highway User Type",
                        "type": "string",
                        "description": "Filter by highway user type (e.g. 'Auto', 'Truck', 'Bus', 'Pedestrian', 'Motorcycle'). Partial match supported. Leave empty for all types.",
                        "default": ""
                    },
                    "maxResults": {
                        "title": "Max Results",
                        "minimum": 1,
                        "maximum": 250000,
                        "type": "integer",
                        "description": "Maximum number of incident 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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
