MSHA Mine Data Scraper - Violations, Inspections, Accidents avatar

MSHA Mine Data Scraper - Violations, Inspections, Accidents

Pricing

from $6.23 / 1,000 mine records

Go to Apify Store
MSHA Mine Data Scraper - Violations, Inspections, Accidents

MSHA Mine Data Scraper - Violations, Inspections, Accidents

Streams all 20 MSHA Open Government Data files, 17.8 million rows on US mines, violations, inspections, accidents, penalties, production and health samples.

Pricing

from $6.23 / 1,000 mine records

Rating

0.0

(0)

Developer

ParseForge

ParseForge

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

8 days ago

Last modified

Categories

Share

ParseForge

MSHA Mine Data Scraper - Violations, Inspections & Accidents

Scrape MSHA mine data from all 20 Open Government Data files: 17,856,581 rows covering every US mine since 1970 and every violation, inspection and accident since 2000. Every row is a flat record with the source's own field names mapped to readable keys, dates normalised to ISO, and no empty columns. No login, no API key, no FOIA request. Export to CSV, JSON, Excel, or XML.

MSHA publishes this data as 582 MB of ZIP archives that you are expected to download whole, unzip, and load into a database before you can ask a single question. This Actor streams the archives and stops reading the moment it has your rows, so a 10-row request against the 1.4 GB violations file transfers a few kilobytes instead of 120 MB, and filters by mine, state, date, penalty or injury run while the file streams.

Who uses itWhat they scrape MSHA data for
Mine safety consultantsViolation and inspection history for a client's mine ID before an audit
Insurance underwritersInjury rates, penalty history and employment size to price a mining risk
Industrial sales teamsActive mines by state, commodity and employee count with operator contacts
Journalists and researchersFatality records, narratives and enforcement outcomes as primary sources
Legal and compliance teamsContested citations, FMSHRC dockets and civil penalty decisions

What it does

This Actor reads MSHA's Open Government Data archives and returns each record as a flat row. Pick one dataset or all twenty in a single run:

  • ⛏️ Mines: 91,979 mines since 1970 with status, type, controller, operator, commodity, SIC, employee count and coordinates.
  • 🚨 Enforcement: 3,096,400 violations, 3,029,093 assessed penalties, 451,718 contested citations, 481,753 civil penalty dockets, 162,065 conferences and 3,861 imminent danger orders.
  • 🔍 Inspections: 1,156,532 inspection events with activity, inspector count, on-site hours and the areas covered.
  • 🩹 Accidents: 274,448 injury and illness reports from MSHA form 7000-1, including the full free-text narrative.
  • 📊 Production: 5,062,796 employment and production rows for mine operators and contractors, quarterly and yearly.
  • 🧪 Health samples: 3,784,443 coal dust, quartz, area, personal health and noise samples.
  • 🔗 Optional joins: add mine master details, operator contact addresses or the latest production summary to any row that carries a mine ID.

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

What you can do with MSHA data

🏭 Build a targeted list of active mines. Filter 91,979 mines down to the ones that matter: active status, a given state, sand and gravel or stone, above a minimum employee count. Tick the operator contact block and every row carries the business name, contact title and street address MSHA has on file.

⚖️ Reconstruct a mine's enforcement history. Feed a mine ID and select violations, assessed violations, contested violations and penalty dockets in one run. You get the citation, its gravity and negligence findings, the penalty proposed, what was actually paid, whether it was contested and how the judge ruled.

📉 Study injuries and fatalities. The accidents dataset carries the degree of injury, the classification, the equipment involved, the miner's experience, days lost, and the inspector's narrative. Filter to fatalities only and you have all 1,210 fatal records with their stories.

🧭 Track an operator across its mines. Controller and operator history maps 169,809 controller-to-operator associations with start and end dates, so you can follow who owned which mine and when, then join production and violations onto the same mine IDs.

Why choose this scraper

What you get
Full coverageAll 20 live MSHA data files, 17,856,581 rows, 562 source columns, nothing summarised away
Streamed, not downloadedReads the ZIP as it arrives and stops early, so small requests stay small
Filters that run upstream of your datasetMine ID, state, date, penalty, injury, negligence and 16 more, applied while the file streams
Clean rowsISO dates, real numbers, Yes/No booleans, "N/A" where MSHA withheld a value, and zero always-empty columns
Joins MSHA makes you do yourselfMine master, operator address and production summary attached by mine ID
Priced per rowYou pay for rows written, not for the 582 MB the source makes you fetch

How it compares

Four other MSHA Actors exist on the Apify Store, and each covers one slice: a mine lookup, an operator lead list, or the assessed violations file. None of them reads all twenty files, and none joins the mine master onto the enforcement rows. This Actor costs more per row than the cheapest of them, and what the difference buys is coverage and the joins: one run can return mines, their violations, their inspections, their accidents and their production, with state and status filters working even on the files that carry neither column.

This ActorTypical single-file MSHA ActorDownloading the files yourself
Datasets covered201 to 220
Rows reachable17,856,581Under 3.1 million17,856,581
Filters22, applied while streamingUsually a mine IDWhatever you write
Bytes moved for 10 rowsA few KBVaries582 MB, then unzip
Mine master joinBuilt inNoWrite it yourself
SetupNoneNoneDownload, unzip, parse, load

What an MSHA mine record looks like

One real row from a verified run, unedited:

{
"dataset": "mines",
"mineId": "0100003",
"mineName": "O'Neal Quarry & Mill",
"coalOrMetal": "M",
"mineType": "Surface",
"mineStatus": "Active",
"mineStatusDate": "1979-01-22",
"controllerId": "0041044",
"controllerName": "Lhoist Group",
"operatorId": "L13586",
"operatorName": "Lhoist North America of Alabama, LLC",
"state": "AL",
"bureauOfMinesStateCode": "01",
"countyFipsCode": "117",
"countyName": "Shelby",
"congressionalDistrict": "06",
"companyType": "Other",
"controllerBeginDate": "1989-07-01",
"district": "M3",
"officeCode": "M3661",
"officeName": "Birmingham AL Field Office (A)",
"assessmentControlNo": "000638053",
"primarySicCode": "327400",
"primarySicDescription": "Lime",
"primarySicCodeShort": "3274",
"primarySicSuffix": "00",
"secondarySicCode": "142200",
"secondarySicDescription": "Crushed, Broken Limestone NEC",
"secondarySicCodeShort": "1422",
"secondarySicSuffix": "00",
"primaryCommodityCode": "6",
"primaryCommodity": "Stone",
"secondaryCommodityCode": "6",
"secondaryCommodity": "Stone",
"status103i": "Never Had 103I Status",
"status103iDate": "N/A",
"portableOperation": "No",
"portableStateFipsCode": "N/A",
"daysPerWeek": 7,
"hoursPerShift": 8,
"productionShiftsPerDay": 3,
"maintenanceShiftsPerDay": 0,
"employeeCount": 108,
"part48Training": "Yes",
"longitude": -86.758889,
"latitude": 33.177778,
"avgMineHeightInches": "N/A",
"gasCategoryCode": "N/A",
"methaneLiberationCfd": "N/A",
"producingPitCount": "N/A",
"nonProducingPitCount": "N/A",
"tailingPondCount": 0,
"pillarRecoveryUsed": "No",
"highwallMinerUsed": "No",
"multiplePits": "No",
"minersRepresentative": "No",
"safetyCommittee": "No",
"milesFromOffice": 100,
"directionsToMine": "Approx 7 miles south of the city of Alabaster on Hwy 31.",
"nearestTown": "Calera",
"mineDataRetrievalUrl": "https://www.msha.gov/mine-data-retrieval-system?mineid=0100003",
"scrapedAt": "2026-08-27T16:20:57.704Z"
}

Rows from the other 19 datasets carry that dataset's own columns instead. Violations, inspections, accidents and the sample files each have their own shape, and the dataset key tells you which one you are looking at.

Configure the run

Pick datasets, set maxItems, and add filters. Filters run as each record is read, so only matches reach your dataset, and a filter naming a column the selected dataset does not have is ignored for that dataset. The Input tab lists every parameter.

Active sand and gravel mines in Texas, with the operator's mailing address:

{ "datasets": ["mines"], "states": ["TX"], "mineStatuses": ["Active"], "commodities": ["SandAndGravel"], "includeOperatorContact": true, "maxItems": 500 }

Everything MSHA has on one mine, across four enforcement datasets:

{ "datasets": ["violations", "assessedViolations", "contestedViolations", "penaltyDockets"], "mineIds": ["0100003"], "maxItems": 2000 }

The most recent fatal accidents in West Virginia, with the mine master joined on:

{ "datasets": ["accidents"], "states": ["WV"], "fatalitiesOnly": true, "sortBy": "newestFirst", "includeMineDetails": true, "maxItems": 200 }

Pricing

Pay-per-event: $0.007 per row, dropping to $0.00623 at higher volume, plus a $0.02 run-start fee and $0.02 for each dataset file opened. The three optional joins add $0.003 per row enriched, and only when the join actually resolved. You pay only for rows written to your dataset.

Rows collectedApproximate cost
100$0.74
1,000$7.04
10,000$70.04

Those figures are for one dataset with no optional blocks. Each extra dataset in the same run adds $0.02. At higher monthly volume the per-row rate drops to $0.00623, so 10,000 rows runs about $62.34. New Apify accounts start with $5 in free credit.

Free users

Free-plan runs return up to 10 rows as a preview. Upgrade your Apify plan to collect up to 1,000,000 rows per run.

Run it

  1. Create a free Apify account with $5 in credit.
  2. Open the MSHA Mine Data Scraper.
  3. Pick one or more datasets, set maxItems, add any filters, and click Start.
  4. Export the results as CSV, Excel, JSON, or XML from the Dataset tab.

Run it programmatically through the Apify API or the ApifyClient for JavaScript and Python.

Use with AI agents (MCP)

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

$claude mcp add --transport http apify "https://mcp.apify.com?tools=parseforge/msha-mine-data-scraper"

Then prompt it in plain language:

  • "List the active underground coal mines in West Virginia with more than 50 employees."
  • "Pull every violation issued at mine ID 4600015 since 2024 and total the proposed penalties."
  • "Find the most recent fatal mining accidents and summarise the narratives."

Troubleshooting

No results at all. Check that the filters you set exist on the dataset you picked. mineIds returns nothing on contractor production or conferences, because neither file carries a mine ID. degreesOfInjury only applies to accidents.

Fewer rows than I asked for. Either the filters matched fewer records than maxItems, or the run hit its time limit on a large file. Selecting several datasets splits maxItems between them unless you set maxItemsPerDataset. Free-plan runs stop at 10 rows.

A sorted run returned fewer rows than an unsorted one. Sorting has to read the whole file and hold the candidates, so it is capped by the run's memory and by a hard ceiling of 50,000 rows per dataset. The log says the cap it settled on. Narrow the filters, drop the optional joins, or use file order to get the full set.

A field is empty. MSHA leaves fields blank when it never recorded the value, and those arrive as "N/A". Coordinates are present on 51.8% of mines and sectionOfAct on 0.6% of violations; that is the source, not the scraper. Columns that are empty in every single row upstream are dropped rather than shipped.

The run is slow. File order is the fast path and stops early. A sort, or a filter that matches rarely, forces a full read of files that reach 1.4 GB uncompressed: a full pass over all 3,096,400 violations takes a couple of minutes. Narrow the date range or the mine list to cut the work.

FAQ

QuestionAnswer
Do I need an MSHA account or API key?No. These are public Open Government Data files served without any login or rate limit.
How fresh is the data?MSHA refreshes the files every Friday afternoon. Each run reports the publication date it read.
Which datasets are included?All 20 live ones: mines, violations, assessed and contested violations, inspections, accidents, penalty dockets, conferences, 107(a) orders, addresses, controller history, four production files and five sample files.
Can I get everything for one mine in a single run?Yes. Select the datasets you want and set mineIds. Every dataset that carries a mine ID is filtered to it.
Can I filter violations by state?Yes. The violations file has no state column, so the Actor resolves it through the mine master. That lookup is loaded once and is not billed.
What is the mine ID format?Seven characters, zero padded, for example 0100003. Shorter IDs are padded for you.
How many rows per run?Free plan: 10. Paid: up to 1,000,000, bounded by what your filters match and the run's time limit.
Are the accident narratives included?Yes, the full free-text narrative from MSHA form 7000-1 is in the narrative field of every accident row.
Why are some numeric fields "N/A"?Because MSHA left them blank. The Actor never emits a literal null, so a withheld number arrives as "N/A" and a real one as a number.
Is this an official MSHA product?No. It is unofficial and reads only publicly published MSHA data files.

Browse the full ParseForge collection 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 the Mine Safety and Health Administration or the US Department of Labor. It collects only publicly published MSHA Open Government Data. You are responsible for using the data in compliance with applicable laws, including GDPR, CCPA, and PIPL. Accident records describe injuries to identifiable workers; do not use them to identify, profile, or target individuals.