{
  "openapi": "3.0.1",
  "info": {
    "title": "UK HSE Enforcement Monitor - Prosecutions & Notices Scraper",
    "description": "Scrape and monitor the UK Health and Safety Executive registers of convictions (prosecutions, fines, breaches, courts) and enforcement notices (Improvement, Prohibition). Filter by company name, region, industry, fine, notice type, dates. Delta mode with new and updated events. Pay per record.",
    "version": "2.0",
    "x-build-id": "mUclbEreHEu5G64Mb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/stefano_seggio~uk-hse-enforcement-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-stefano_seggio-uk-hse-enforcement-monitor",
        "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/stefano_seggio~uk-hse-enforcement-monitor/runs": {
      "post": {
        "operationId": "runs-sync-stefano_seggio-uk-hse-enforcement-monitor",
        "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/stefano_seggio~uk-hse-enforcement-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-stefano_seggio-uk-hse-enforcement-monitor",
        "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": {
          "datasets": {
            "title": "Registers to extract",
            "minItems": 1,
            "type": "array",
            "description": "Convictions = successful prosecutions (defendant, fine, costs, breaches, court, hearing date; HSE keeps 5 years). Notices = Improvement and Prohibition enforcement notices (recipient, type, served/compliance dates, result; HSE keeps 10 years).",
            "items": {
              "type": "string",
              "enum": [
                "convictions",
                "notices"
              ],
              "enumTitles": [
                "Convictions (prosecutions & fines)",
                "Enforcement Notices (Improvement / Prohibition)"
              ]
            },
            "default": [
              "convictions",
              "notices"
            ]
          },
          "nameContains": {
            "title": "Defendant / recipient name contains",
            "type": "string",
            "description": "Substring match on the defendant's (convictions) or recipient's (notices) name, e.g. 'Skanska' or 'Balfour Beatty'. The contractor-vetting filter. Quotes are treated as single-character wildcards."
          },
          "descriptionContains": {
            "title": "Case / notice summary contains",
            "type": "string",
            "description": "Full-text substring over the case description (convictions) or notice summary (notices), e.g. 'asbestos', 'scaffold', 'silica'."
          },
          "localAuthorityContains": {
            "title": "Local authority contains",
            "type": "string",
            "description": "Local authority where the offence occurred, e.g. 'Bradford', 'Cardiff UA'."
          },
          "mainActivityContains": {
            "title": "Main activity (SIC code or text)",
            "type": "string",
            "description": "A numeric value matches the SIC 2007 code of the offence location; any other text matches the activity description ('ROOFING', 'MACHINING'). The site keeps the two in different columns, so a code never matches as text and vice versa. The code match is a CONTAINS match on the register: use a full 5-digit code for one class ('43910' = roofing) or a 4-digit group ('4391'); 2-3 digit values also match every code that merely contains those digits ('43' returns 14310, 24310, 46430 ...) - use the industry filter for broad selections."
          },
          "region": {
            "title": "UK region",
            "enum": [
              "",
              "1",
              "2",
              "3",
              "4",
              "5",
              "6",
              "7"
            ],
            "type": "string",
            "description": "HSE's seven UK regions.",
            "default": ""
          },
          "country": {
            "title": "Country",
            "enum": [
              "",
              "8",
              "9",
              "10",
              "11"
            ],
            "type": "string",
            "description": "Country of the offence location.",
            "default": ""
          },
          "industry": {
            "title": "Industry",
            "enum": [
              "",
              "12",
              "13",
              "14",
              "15",
              "16"
            ],
            "type": "string",
            "description": "HSE's five industry groups.",
            "default": ""
          },
          "hseDivision": {
            "title": "HSE division",
            "enum": [
              "",
              "17",
              "18",
              "19",
              "20",
              "21",
              "22",
              "23",
              "24",
              "25",
              "26",
              "27"
            ],
            "type": "string",
            "description": "HSE's operational division (finer than region).",
            "default": ""
          },
          "dateFrom": {
            "title": "Date from",
            "type": "string",
            "description": "Offence date (convictions) / date the notice was served (notices). Absolute (2026-01-01) or relative ('30 days', '6 months', '1 year' back from today, UK calendar). Note: both dates lag publication on the register by weeks to years - for 'what is new on the register' use delta mode instead."
          },
          "dateTo": {
            "title": "Date to",
            "type": "string",
            "description": "Absolute or relative upper bound of the same date. Leave empty for 'today'."
          },
          "hseReference": {
            "title": "HSE reference (defendant / recipient id)",
            "pattern": "^\\s*\\d+\\s*$",
            "type": "string",
            "description": "Everything about one party: the numeric HSE Reference shown on a defendant or recipient page (the same id is used on both registers), e.g. 4392330."
          },
          "recordNumber": {
            "title": "Case / notice number",
            "pattern": "^\\s*\\d+\\s*$",
            "type": "string",
            "description": "Look up one record by its case number (convictions) or notice number (notices), e.g. 4883993 or 316005113."
          },
          "defendantStatus": {
            "title": "Defendant status (convictions)",
            "enum": [
              "",
              "1980",
              "1972",
              "1981",
              "1974",
              "1976",
              "1978",
              "1977",
              "1973",
              "1975",
              "1979"
            ],
            "type": "string",
            "description": "Legal form of the defendant. Convictions only.",
            "default": ""
          },
          "resultingFromFatality": {
            "title": "Resulting from a fatality (convictions)",
            "enum": [
              "any",
              "yes",
              "no"
            ],
            "type": "string",
            "description": "Only cases that resulted from the investigation of a (RIDDOR-reportable) fatality. Convictions only.",
            "default": "any"
          },
          "minTotalFineGbp": {
            "title": "Minimum total fine (GBP, convictions)",
            "minimum": 0,
            "type": "integer",
            "description": "Only cases with a total fine of at least this amount. Tip: 100000 leaves about 50 of the 210 cases."
          },
          "maxTotalFineGbp": {
            "title": "Maximum total fine (GBP, convictions)",
            "minimum": 0,
            "type": "integer",
            "description": "Only cases with a total fine of at most this amount."
          },
          "noticeTypes": {
            "title": "Notice types (notices)",
            "type": "array",
            "description": "HSE's nine notice-type codes (labels verified against the register, 2026-09-07). '03' is the ordinary Improvement Notice (22,000+); '01' and '02' are the rare Crown / FEPA variants. Select several to get their union. Notices only.",
            "items": {
              "type": "string",
              "enum": [
                "01",
                "02",
                "03",
                "04",
                "05",
                "06",
                "07",
                "08",
                "09"
              ],
              "enumTitles": [
                "Improvement Notice (Crown)",
                "Improvement Notice (FEPA)",
                "Improvement Notice",
                "Deferred Prohibition Notice (Crown)",
                "Immediate Prohibition Notice (Crown)",
                "Deferred Prohibition Notice",
                "Prohibition Notice (FEPA)",
                "Immediate Prohibition Notice",
                "Prohibition Notice (COMAH)"
              ]
            },
            "default": []
          },
          "act": {
            "title": "Act breached (notices)",
            "enum": [
              "",
              "502",
              "517",
              "519",
              "518",
              "491",
              "512",
              "490",
              "481",
              "488",
              "504",
              "500",
              "513",
              "507",
              "479",
              "482",
              "515",
              "487",
              "505",
              "516",
              "501",
              "514",
              "499",
              "497",
              "489",
              "495",
              "478",
              "494",
              "511",
              "509",
              "521",
              "520",
              "483",
              "485",
              "486",
              "506",
              "503",
              "493",
              "492",
              "484",
              "496",
              "510",
              "508",
              "480"
            ],
            "type": "string",
            "description": "Primary legislation of the breach. Notices only (labels are the register's own, some truncated by the site).",
            "default": ""
          },
          "eventTypes": {
            "title": "Event types to deliver",
            "type": "array",
            "description": "SANCTION = a conviction not delivered before; NEW_LISTING = a notice not delivered before; UPDATED = a record you already received whose case/notice page changed (a notice complied with, a revised compliance date, a breach or hearing added) - delta mode only. Applied by the delta engine, not by the site: changing it later does not fork the delta memory.",
            "items": {
              "type": "string",
              "enum": [
                "SANCTION",
                "NEW_LISTING",
                "UPDATED"
              ],
              "enumTitles": [
                "New convictions",
                "New notices",
                "Updates to known records"
              ]
            },
            "default": [
              "SANCTION",
              "NEW_LISTING",
              "UPDATED"
            ]
          },
          "onlyNew": {
            "title": "Only new / changed since the last run",
            "type": "boolean",
            "description": "Remembers every record it has delivered (per filter set, in a named key-value store) and returns only records that are new or whose page changed since. Convictions (~210 records) are always walked in full; notices stop at the first two pages of already-known records, so a scheduled run costs a few pages.",
            "default": false
          },
          "recheckDays": {
            "title": "Re-check window for updates (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "In delta mode, known records that are still open (Improvement Notices with Result 'Ongoing', and every conviction) are re-read for this many days after they were first delivered (or after their register date, whichever is later) to detect UPDATED events - the register has no 'last updated' field, so this is the only way to see a notice being complied with or a hearing being added. 0 disables re-checks. Up to 2,000 records are re-checked per run.",
            "default": 180
          },
          "deltaStateName": {
            "title": "Delta state name",
            "pattern": "^[A-Za-z0-9-]{1,30}$",
            "type": "string",
            "description": "Optional label for the memory of a monitoring task. Defaults to a fingerprint of your filters, so different schedules never interfere. Set the same name on two tasks to make them share one memory."
          },
          "resetState": {
            "title": "Reset delta memory before this run",
            "type": "boolean",
            "description": "Forget every previously delivered record for this delta state and re-baseline (the run then returns up to 'Max records per register' most recently entered records).",
            "default": false
          },
          "maxItemsPerDataset": {
            "title": "Max records per register",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Hard cap on delivered records per selected register (and therefore on cost: you pay per record). On the very first delta run the cap defines the baseline: the oldest record that run delivers is remembered per register, and records entered before it are history - later delta runs never deliver or charge for them, whatever the cap (run once with onlyNew=false, or set a high cap on the first run, if you want the history). On every later delta run the overflow is a backlog: the walk remembers where it stopped (a per-register watermark in the delta memory) and the next run walks down to that point instead of stopping at the records already delivered.",
            "default": 100
          },
          "fetchDetail": {
            "title": "Fetch the case / notice page",
            "type": "boolean",
            "description": "Opens each record's own page for the description, dates, fine and costs, result, address, industry and HSE admin fields (plus, for convictions, the per-case breach list). Off = listing-row-only records (name, date, local authority, main activity, notice type) at the cheaper 'result-summary' price; no UPDATED detection is possible without it.",
            "default": true
          },
          "fetchBreachDetail": {
            "title": "Fetch per-breach legislation detail",
            "type": "boolean",
            "description": "Convictions: opens each breach's page for the court, Act section / Regulation paragraph, hearing date, result and per-breach fine. Notices: fetches the breach list (Act / regulation / paragraph per breach). Off = the cheaper 'result-summary' price.",
            "default": true
          },
          "fetchPartyDetail": {
            "title": "Fetch defendant / recipient profile and history",
            "type": "boolean",
            "description": "Opens the party's page (registered address, Status such as 'Private Company' or 'Individual', HSE Reference) and its case and notice lists on both registers - the repeat-offender signal (3 extra requests per record, no extra charge).",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel record requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Run-wide cap on simultaneous HTTP requests (listing, detail, breach and party pages together - never more than this in flight). The register is a classic-ASP site that answered 17 concurrent requests without throttling; 5 keeps a 100-record run around a minute.",
            "default": 5
          },
          "dateRange": {
            "title": "Legacy recency preset (deprecated - use 'Date from')",
            "pattern": "^(24h|7d|30d)$",
            "type": "string",
            "description": "Kept for tasks created with version 1: '24h', '7d' or '30d' are interpreted as 'Date from'."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}