---
name: fra-rail-safety-data-ingestion
description: "How to get FRA rail safety data data into a pandas DataFrame and Parquet: access, the request, the format, limits, quirks and terms."
---

# Load recent FRA accidents and crossing revisions into Parquet

Source entry: https://signal-lab-jet.vercel.app/datasets/fra-rail-safety-data
Provider: https://data.transportation.gov/stories/s/FRA-Safety-Data/dakf-i7zd
Checked against the provider's documentation: 2026-11-01

## Access
- No account or key. DOT exposes both FRA tables through public JSON endpoints.
- This bounded example requests 2026 accidents and the first 5,000 crossing revisions dated from October 1, 2026.

## Request
```bash
curl 'https://data.transportation.gov/resource/85tf-25kj.json?$where=date%20%3E=%20%272026-01-01T00:00:00.000%27&$limit=5000'
```

## Format
JSON arrays. Accident rows include event date, railroad, accident number and type, state, county, damage and cause; crossing rows include revision date, crossing ID, railroad, location, position, coordinates and closure status.

## Load into pandas and Parquet
Needs Python 3 with requests, pandas and pyarrow.
```python
"""Recent FRA rail accidents and crossing-inventory revisions -> Parquet. No key."""
import requests
import pandas as pd

HEADERS = {"User-Agent": "SignalLabCheck/1.0"}
ACCIDENTS = "https://data.transportation.gov/resource/85tf-25kj.json"
CROSSINGS = "https://data.transportation.gov/resource/m2f8-22s6.json"
accident_params = {
    "$select": "date,reportingrailroadcode,accidentnumber,accidenttype,stateabbr,countyname,totaldamagecost,primaryaccidentcause",
    "$where": "date >= '2026-01-01T00:00:00.000'",
    "$order": "date",
    "$limit": 5000,
}
crossing_params = {
    "$select": "revisiondate,crossingid,railroadcode,statename,countyname,cityname,crossingposition,latitude,longitude,crossingclosed",
    "$where": "revisiondate >= '2026-10-01T00:00:00.000'",
    "$order": "revisiondate",
    "$limit": 5000,
}
ra = requests.get(ACCIDENTS, params=accident_params, headers=HEADERS, timeout=60)
ra.raise_for_status()
rc = requests.get(CROSSINGS, params=crossing_params, headers=HEADERS, timeout=60)
rc.raise_for_status()
accidents = pd.DataFrame(ra.json())
crossings = pd.DataFrame(rc.json())
accidents["date"] = pd.to_datetime(accidents["date"], utc=True)
crossings["revisiondate"] = pd.to_datetime(crossings["revisiondate"], utc=True)
accidents.to_parquet("fra_rail_accidents_2026.parquet", index=False)
crossings.to_parquet("fra_crossing_revisions_2026_10.parquet", index=False)
print(len(accidents), "accidents", accidents["date"].min().date(), "to", accidents["date"].max().date(),
      "|", len(crossings), "crossing revisions", crossings["revisiondate"].min().date(), "to",
      crossings["revisiondate"].max().date())
```
Run by us on 2026-11-01 (python 3.13.5 | pandas 3.1.0 | pyarrow 26.0.0 | requests 2.34.2). Result: 1409 accidents 2026-01-01 to 2026-08-31 | 5000 crossing revisions 2026-10-01 to 2026-10-07

## Limits
- Rate limit: Not stated.
- The example's 5,000-row crossing result is a bounded extract, not every October revision.
- The FRA landing page said accident and incident datasets currently include data through August 31, 2026.

## Quirks
- Multiple railroads can file records for one event; use railroad code plus accident number and year as the reporting-record identity.
- Crossing inventory dates describe record revisions, not crossing construction dates.
- Use the historical inventory for prior versions and the current table for the latest record per crossing.

## Terms and attribution
- The DOT metadata labels the accident table Public Domain U.S. Government and the current crossing table Public Domain.
- No attribution requirement was stated in the checked dataset metadata.
- Terms page: https://www.usa.gov/government-copyright

## Sources
- https://data.transportation.gov/stories/s/FRA-Safety-Data/dakf-i7zd: "Datasets and reports currently include data through August 31, 2026."
- https://data.transportation.gov/api/views/85tf-25kj: "Rail Equipment Accident/Incident Data (Form 54)"
- https://data.transportation.gov/api/views/m2f8-22s6: "It contains the current crossing inventory - one record for each crossing."
- https://data.transportation.gov/api/views/85tf-25kj: "Public Domain U.S. Government"
- https://data.transportation.gov/api/views/m2f8-22s6: "Public Domain"

## Help improve this skill
Missing a source, or see something to improve? Call the MCP tool suggest_source or feedback (or POST /api/suggest or /api/feedback). Reviewed ideas: https://signal-lab-jet.vercel.app/agent-suggestions

Information for educational purposes only. Free tiers, limits and licenses belong to the providers and may change; check the provider's own terms before using the data.
