Msha Violation Counts
msha_violation_countsCount MSHA violations issued at one mine within a calendar year or year range — in ONE call, not a listing. Returns the TOTAL plus a breakdown by who it was issued to (Operator vs Contractor vs Agent vs Miner) and by significant-and-substantial (S&S) status. Use this instead of msha_mine_detail when the question is "how many" — msha_mine_detail only returns its most recent violations_limit rows (default 20, max 100) and has no true count. Counted by the calendar year of each violation's own issue date (VIOLATION_ISSUE_DT, via MSHA's own CAL_YR field). Only the most recent 5 calendar years are loaded (the response's coverage field says exactly which); a year outside that window comes back flagged as "not loaded," never as a silent zero. Takes a known MSHA Mine ID (use msha_mine_search to find one) or a mine/operator/controller name — the name path only works when it resolves to exactly one mine; otherwise it lists the candidates so you can retry with a mine_id. Sourced from MSHA's own bulk mine-records files (public domain), refreshed weekly. Keyless.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | No | Single calendar year to count, e.g. 2025. | |
| mine_id | No | MSHA Mine ID, e.g. "4601437". Preferred over mine_name — unambiguous. | |
| year_to | No | Last calendar year of a range (inclusive). Use together with year_from instead of year. | |
| mine_name | No | Mine, operator, or controller name to resolve to a Mine ID — used only when mine_id is omitted, and only works if it matches exactly one mine. | |
| year_from | No | First calendar year of a range (inclusive). Use together with year_to instead of year. |