Returns OSHA workplace-safety enforcement records from the Department of Labor's enforcement data: inspection cases (who was inspected, where, why, when) with optional violation citations attached (standard cited, violation type, penalties, abatement dates)
Returns OSHA workplace-safety enforcement records from the Department of Labor's enforcement data: inspection cases (who was inspected, where, why, when) with optional violation citations attached (standard cited, violation type, penalties, abatement dates). Use this when the user asks about: a company's workplace-safety record, OSHA penalties or citations, fatality/catastrophe investigations, inspection activity by state or industry (NAICS), or contractor safety research. Result rows are INSPECTIONS. Pass include_violations=true to attach each inspection's citations under a violations array (or pass activity_nr for a direct lookup, which always includes them). min_penalty keeps only inspections with at least one violation whose initial or current penalty meets the threshold (implies include_violations). insp_type codes (DOL's own legend): A=Accident, B=Complaint, C=Referral, D=Monitoring, E=Variance, F=FollowUp, G=Unprog Rel, H=Planned, I=Prog Related, J=Unprog Other, K=Prog Other, L=Other-L, M=Fat/Cat (fatality/catastrophe), N=Unprog Emph. Each record carries insp_type_label with the decoded value. Violation viol_type codes: S=Serious, W=Willful, R=Repeat, O=Other, U=Unclassified. Violations carry delete_flag='X' when the source later deleted the citation — rows are kept with the flag, never dropped. Filter combinations note: server-side indexes support ONE of state / naics_code combined with the open_date sort + since/until. Other filters (establishment_name substring, insp_type, state+naics together, min_penalty) post-filter client-side over a widened fetch window. sort_by=case_mod_date is the 'recently updated cases' firehose and cannot be combined with state / naics_code / since / until. Pure-publisher posture: DOL's enforcement rows as published — codes kept verbatim (with the source's own legend decoded alongside), no safety scoring. Each record's source_url links to the osha.gov establishment inspection-detail page.
Request
- Base URL: https://api.keyvex.com
- URL: https://api.keyvex.com/v1/osha-enforcement
- Auth: API key in header x-api-key
Query parameters
Direct lookup by OSHA inspection activity number (e.g., '317465899'). Returns the inspection with its violations attached. Fastest path.
Case-insensitive substring against the inspected establishment's name (e.g., 'amazon', 'dollar general'). Client-side filter.
Two-letter site state (e.g., 'TX', 'CA').
Exact NAICS industry code of the inspected site (e.g., '238160' roofing contractors). Note: '000000' on many pre-NAICS-era records.
One-letter inspection-type code (e.g., 'M' Fat/Cat, 'B' Complaint, 'H' Planned — full legend in the tool description).
Inspection open_date lower bound (YYYY-MM-DD inclusive).
Inspection open_date upper bound (YYYY-MM-DD inclusive).
Keep only inspections with at least one violation whose initial or current penalty is >= this amount (dollars). Implies include_violations=true.
When true, attaches each returned inspection's violation citations under a violations array (standard, type, penalties, abatement/contest dates). Default false.
Sort key. Default: open_date. case_mod_date = most recently UPDATED cases (cannot combine with state/naics_code/since/until).
Default: desc (most recent first).
Maximum inspections to return. Default 50, max 500.
Response
JSON envelope: { results: [...], count, has_more }.
Changes
No recorded changes to this operation across all 1 revision of this API.