# PHMSA Pipeline Enforcement Cases (`defenestrator/phmsa-pipeline-enforcement-cases`) Actor

Monitor official PHMSA pipeline enforcement cases and export structured rows for NOPV, warning letters, notices, orders, penalties, operators, and dates. Unofficial public-record scraper.

- **URL**: https://apify.com/defenestrator/phmsa-pipeline-enforcement-cases.md
- **Developed by:** [Defenestrator](https://apify.com/defenestrator) (community)
- **Categories:** Business, News
- **Stats:** 2 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 1,000 phmsa enforcement case rows

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).


# README

## PHMSA Pipeline Enforcement Cases

Export official PHMSA pipeline-safety enforcement case rows into a structured, source-linked Apify dataset for regulatory monitoring, compliance research, infrastructure risk review, insurance research, and legal/regulatory triage.

This Actor reads PHMSA public enforcement-data page JSON and defaults to Notices of Probable Violation (`NOPV`). It can also include Warning Letters (`WL`), Notices of Amendment (`NOA`), Corrective Action Orders (`CAO`), and Safety Orders (`PSO`).

Unofficial / not affiliated: this Actor is not operated by, endorsed by, or affiliated with PHMSA, the U.S. Department of Transportation, or any government agency.

### Common use cases

| Use case | Why it helps |
|---|---|
| Pipeline-safety monitoring | Track new or open enforcement cases from the public PHMSA source. |
| Compliance triage | Filter by case type, status, year, region, operator, or proposed penalty. |
| Infrastructure risk research | Export normalized rows for repeatable review and downstream analysis. |
| Insurance / legal research | Create source-linked datasets before manual document review. |
| Regulatory watchlists | Run bounded scheduled checks for specific operators or regions. |

### Example input

```json
{
  "maxItems": 25,
  "caseTypes": ["NOPV"],
  "statuses": ["OPEN"],
  "openedYearFrom": 2025,
  "minProposedPenaltyUsd": 1
}
````

### Input fields

| Field | Notes |
|---|---|
| `maxItems` | Maximum rows to save, 1–1000. |
| `caseTypes` | One or more of `NOPV`, `WL`, `NOA`, `CAO`, `PSO`; defaults to `NOPV`. |
| `statuses` | Optional `OPEN` / `CLOSED` filter. |
| `openedFrom`, `openedTo` | Optional `YYYY-MM-DD` opened-date bounds. |
| `openedYearFrom`, `openedYearTo` | Optional opened-year bounds. |
| `region` | Optional case-insensitive PHMSA region filter. |
| `operatorSearch` | Optional case-insensitive filter on operator name or CPF number. |
| `minProposedPenaltyUsd` | Optional minimum proposed civil penalty. |
| `includeRawFields` | Optional sanitized source-field debugging output when enabled. |

### Output

Each dataset row includes:

- PHMSA CPF number / record key
- case type and status
- opened and closed dates
- operator name and operator ID
- PHMSA region
- proposed, assessed, and collected penalty amounts
- final-order / consent-order dates when present
- source URL and collection timestamp

### Source

Official source: https://primis.phmsa.dot.gov/enforcement-data

PHMSA notes that enforcement data is intended to enhance public understanding, is updated as cases are initiated or resolved, and historical totals may change over time. The source search may not retrieve every document associated with every enforcement action. Use this Actor for monitoring and triage, then verify important decisions against official PHMSA records.

### Pricing

This Actor uses Apify Pay Per Event pricing:

| Event | Price | When charged |
|---|---:|---|
| Actor start | `$0.00005` | Once when the run starts. |
| PHMSA enforcement case row | `$0.003` | Per saved dataset row. |

Platform usage is included in the event price. Set `maxItems` and filters to match your budget.

### Limitations and responsible use

- This output is not legal, regulatory, investment, safety, or compliance advice.
- Do not rely on the dataset as the sole basis for legal/regulatory decisions, public accusations, unsolicited mass outreach, or automated adverse actions.
- PHMSA records can change as cases progress; verify high-stakes findings against the official source.
- No browser, proxy, login, private API, external paid API, or LLM is used. The Actor performs bounded HTTPS requests to official public PHMSA data and writes normalized rows.

# Actor input Schema

## `maxItems` (type: `integer`):

Maximum number of case rows to save.

## `caseTypes` (type: `array`):

PHMSA enforcement case types to include. Supported values: NOPV, WL, NOA, CAO, PSO. Defaults to Notices of Probable Violation (NOPV).

## `statuses` (type: `array`):

Optional PHMSA case statuses to include. Supported values: OPEN, CLOSED.

## `openedFrom` (type: `string`):

Optional inclusive opened-date lower bound in YYYY-MM-DD format.

## `openedTo` (type: `string`):

Optional inclusive opened-date upper bound in YYYY-MM-DD format.

## `openedYearFrom` (type: `integer`):

Optional inclusive opened-year lower bound.

## `openedYearTo` (type: `integer`):

Optional inclusive opened-year upper bound.

## `region` (type: `string`):

Optional case-insensitive region filter, e.g. Eastern, Central, Southwest.

## `operatorSearch` (type: `string`):

Optional case-insensitive filter applied to operator name and CPF number.

## `minProposedPenaltyUsd` (type: `integer`):

Optional minimum proposed civil penalty in USD.

## `includeRawFields` (type: `boolean`):

Include selected raw PHMSA field names for debugging/source reconciliation.

## `timeoutSecs` (type: `integer`):

HTTP timeout for the PHMSA page-data request.

## Actor input object example

```json
{
  "maxItems": 25,
  "caseTypes": [
    "NOPV"
  ],
  "statuses": [],
  "includeRawFields": false,
  "timeoutSecs": 45
}
```

# Actor output Schema

## `results` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {};

// Run the Actor and wait for it to finish
const run = await client.actor("defenestrator/phmsa-pipeline-enforcement-cases").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {}

# Run the Actor and wait for it to finish
run = client.actor("defenestrator/phmsa-pipeline-enforcement-cases").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{}' |
apify call defenestrator/phmsa-pipeline-enforcement-cases --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=defenestrator/phmsa-pipeline-enforcement-cases",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "PHMSA Pipeline Enforcement Cases",
        "description": "Monitor official PHMSA pipeline enforcement cases and export structured rows for NOPV, warning letters, notices, orders, penalties, operators, and dates. Unofficial public-record scraper.",
        "version": "0.0",
        "x-build-id": "8tWnaysfTTpaXn7gV"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/defenestrator~phmsa-pipeline-enforcement-cases/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-defenestrator-phmsa-pipeline-enforcement-cases",
                "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/defenestrator~phmsa-pipeline-enforcement-cases/runs": {
            "post": {
                "operationId": "runs-sync-defenestrator-phmsa-pipeline-enforcement-cases",
                "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/defenestrator~phmsa-pipeline-enforcement-cases/run-sync": {
            "post": {
                "operationId": "run-sync-defenestrator-phmsa-pipeline-enforcement-cases",
                "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": {
                    "maxItems": {
                        "title": "Maximum rows",
                        "minimum": 1,
                        "maximum": 1000,
                        "type": "integer",
                        "description": "Maximum number of case rows to save.",
                        "default": 25
                    },
                    "caseTypes": {
                        "title": "Case types",
                        "type": "array",
                        "description": "PHMSA enforcement case types to include. Supported values: NOPV, WL, NOA, CAO, PSO. Defaults to Notices of Probable Violation (NOPV).",
                        "items": {
                            "type": "string"
                        },
                        "default": [
                            "NOPV"
                        ]
                    },
                    "statuses": {
                        "title": "Statuses",
                        "type": "array",
                        "description": "Optional PHMSA case statuses to include. Supported values: OPEN, CLOSED.",
                        "items": {
                            "type": "string"
                        },
                        "default": []
                    },
                    "openedFrom": {
                        "title": "Opened from",
                        "type": "string",
                        "description": "Optional inclusive opened-date lower bound in YYYY-MM-DD format."
                    },
                    "openedTo": {
                        "title": "Opened to",
                        "type": "string",
                        "description": "Optional inclusive opened-date upper bound in YYYY-MM-DD format."
                    },
                    "openedYearFrom": {
                        "title": "Opened year from",
                        "minimum": 2002,
                        "maximum": 2100,
                        "type": "integer",
                        "description": "Optional inclusive opened-year lower bound."
                    },
                    "openedYearTo": {
                        "title": "Opened year to",
                        "minimum": 2002,
                        "maximum": 2100,
                        "type": "integer",
                        "description": "Optional inclusive opened-year upper bound."
                    },
                    "region": {
                        "title": "PHMSA region",
                        "type": "string",
                        "description": "Optional case-insensitive region filter, e.g. Eastern, Central, Southwest."
                    },
                    "operatorSearch": {
                        "title": "Operator search",
                        "type": "string",
                        "description": "Optional case-insensitive filter applied to operator name and CPF number."
                    },
                    "minProposedPenaltyUsd": {
                        "title": "Minimum proposed penalty",
                        "minimum": 0,
                        "type": "integer",
                        "description": "Optional minimum proposed civil penalty in USD."
                    },
                    "includeRawFields": {
                        "title": "Include raw source fields",
                        "type": "boolean",
                        "description": "Include selected raw PHMSA field names for debugging/source reconciliation.",
                        "default": false
                    },
                    "timeoutSecs": {
                        "title": "Request timeout seconds",
                        "minimum": 10,
                        "maximum": 180,
                        "type": "integer",
                        "description": "HTTP timeout for the PHMSA page-data request.",
                        "default": 45
                    }
                }
            },
            "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
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
