# PHMSA Pipeline Incident Feed (DOT Open Data) (`hopeful_crabgrass/phmsa-pipeline-incidents`) Actor

Filtered, flattened PHMSA pipeline incident reports from official U.S. DOT Open Data files, by date window, state and system type. Personal and free-text fields are never output. Not a safety, legal, or insurance determination.

- **URL**: https://apify.com/hopeful_crabgrass/phmsa-pipeline-incidents.md
- **Developed by:** [Juan Marcos](https://apify.com/hopeful_crabgrass) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 60.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $0.00005 / actor start

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/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
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.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## 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.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## PHMSA Pipeline Incident Feed (DOT Open Data)

Returns PHMSA-reported pipeline incidents and accidents (gas distribution, gas transmission and gathering, hazardous liquid, LNG, and optionally hazardous-liquid gravity/reporting-regulated and Type R gas gathering) in a date window, filtered by system type and state, as small flat rows. This is a research and monitoring feed. It is not a safety, legal, compliance, or insurance determination, and it makes no statement about cause or blame.

### Value added over the free files

The underlying reports are free from PHMSA via U.S. DOT Open Data. This Actor:

- downloads the official current-era tab-delimited files and joins the system types into one row format with consistent field names;
- filters by a required date window (received date or incident date), state, and system type, newest first, under a hard cap;
- outputs only a fixed allow-list of 25 fields, so personal and free-text data in the source files never reach your dataset;
- keeps one row per report (the latest supplement);
- optional `onlyNew` skips reports already returned by an earlier run;
- caches the parsed allow-listed rows for 24 hours so scheduled runs do not re-download the files.

### Source and freshness

Files: DOT Open Data dataset `27nc-rsge` (https://data.transportation.gov/d/27nc-rsge), file attachments downloaded through `https://data.transportation.gov/api/views/27nc-rsge/files/<assetId>`. The Actor never fetches www.phmsa.dot.gov pages. Pre-2010 historic files are not used.

DOT refreshes these files irregularly. The copy checked on 2026-11-18 contained reports received up to 2026-02-27, so the default window is the last 366 days. Each run logs the newest report received date it found. Operators file reports within 30 days of an incident and may supplement them later, so values can change.

### Output fields

`reportNumber, reportReceivedDate, incidentDate, systemType, operatorId, operatorName, operatorCity, operatorState, locationCity, locationCounty, locationState, latitude, longitude, commodityReleased, unintentionalRelease, fatalityInd, fatalityCount, injuryInd, injuryCount, igniteInd, explodeInd, numPubEvacuated, estimatedPropertyDamage, datasetUrl, attribution`

- Fatalities and injuries are **counts only**.
- `unintentionalRelease` units follow the source form: thousand cubic feet (MCF) for gas distribution, gas transmission/gathering and Type R; barrels for hazardous liquid and gravity files; as reported for LNG.
- `latitude` / `longitude` are `null` unless you turn on `includeCoordinates`, because a precise point can identify a residence.
- For LNG, only the facility state is given (no city/county).
- City or county values that contain digits (operators sometimes typed a street address there) are blanked.
- Operator names are organisations. A name is blanked if it carries a personal-title cue or looks like a mixed-case personal name (a heuristic; a sole proprietor could slip through).

Never output: preparer, local-contact and authorizer names, titles, emails, phones and fax numbers; narratives, comments and every `*_DETAILS` free-text column; street addresses and postal codes; one-call centre and water-body names; drug and alcohol testing fields.

### Input

| Field | Default | Description |
| --- | --- | --- |
| `sinceDays` | `366` | Used when `from`/`to` are empty. Maximum 366. |
| `from` / `to` | empty | Inclusive YYYY-MM-DD window, at most 366 days |
| `dateField` | `received` | `received` (PHMSA received date) or `incident` (local incident date) |
| `systemTypes` | 4 main types | `gasDistribution`, `gasTransmission`, `hazardousLiquid`, `lng`, `hlGravity`, `typeR` |
| `states` | `[]` | Two-letter location state codes |
| `includeCoordinates` | `false` | Include latitude/longitude |
| `maxResults` | `100` | Hard cap 1,000 |
| `onlyNew` | `false` | Skip report+supplement keys already returned (identifiers only, stored in the named key-value store `phmsa-incidents-seen`). A supplemented report counts as new. |

### Pricing

Pay-per-event. The primary event is `incident-result` at **$0.008** per incident row pushed. The platform also bills a synthetic `apify-actor-start` event automatically; this Actor does not call `Actor.charge()` for that event. If you set a maximum total charge, the Actor stops when a charge is refused or the remaining budget cannot cover another row. A run with zero matching rows is not charged per row.

### Licence and attribution

PHMSA's web policy says it "does not restrict or hinder the public from downloading any information from its website." These are U.S. government works (17 U.S.C. § 105); the DOT catalog record carries no explicit licence string. U.S. government work; not endorsed. No agency logos are used. Every row carries:

`Source: PHMSA pipeline incident / accident data via U.S. DOT Open Data (data.transportation.gov dataset 27nc-rsge); not endorsed by PHMSA or DOT. Reports are operator-submitted and may be supplemented; this is not a safety, legal, or insurance determination.`

### Report or erase a row

If a row contains personal data, open an issue and it will be fixed or removed.

### Support

Contact via the Apify Store Issues tab.

# Actor input Schema

## `sinceDays` (type: `integer`):

Used when from/to are empty. Window ends today (UTC). Maximum 366 days. Default and QA prefill are 366 because DOT Open Data refreshes these files irregularly (the copy checked on 2026-11-18 had reports received up to 2026-02-27); the run log shows the newest report date found.

## `from` (type: `string`):

Inclusive start date. Use with to. Window at most 366 days.

## `to` (type: `string`):

Inclusive end date. Use with from.

## `dateField` (type: `string`):

received = date PHMSA received the report; incident = local incident date reported by the operator.

## `systemTypes` (type: `array`):

Any of gasDistribution, gasTransmission, hazardousLiquid, lng, hlGravity, typeR. Default: the four main current-era types. QA prefill is hazardousLiquid only so the automated test finishes well under 5 minutes.

## `states` (type: `array`):

Optional two-letter USPS codes for the incident location state.

## `includeCoordinates` (type: `boolean`):

Off by default because a precise point can identify a residence.

## `maxResults` (type: `integer`):

Hard cap 1,000. Newest first. Default 100; QA prefill is 5 so the automated test stays small and cheap.

## `onlyNew` (type: `boolean`):

Skip report+supplement keys already returned by an earlier run (identifiers only, stored in a named key-value store). A supplemented report counts as new.

## Actor input object example

```json
{
  "sinceDays": 366,
  "dateField": "received",
  "systemTypes": [
    "hazardousLiquid"
  ],
  "states": [],
  "includeCoordinates": false,
  "maxResults": 5,
  "onlyNew": false
}
```

# Actor output Schema

## `results` (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 = {
    "sinceDays": 366,
    "dateField": "received",
    "systemTypes": [
        "hazardousLiquid"
    ],
    "states": [],
    "includeCoordinates": false,
    "maxResults": 5,
    "onlyNew": false
};

// Run the Actor and wait for it to finish
const run = await client.actor("hopeful_crabgrass/phmsa-pipeline-incidents").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 = {
    "sinceDays": 366,
    "dateField": "received",
    "systemTypes": ["hazardousLiquid"],
    "states": [],
    "includeCoordinates": False,
    "maxResults": 5,
    "onlyNew": False,
}

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

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

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

```

## CLI example

```bash
echo '{
  "sinceDays": 366,
  "dateField": "received",
  "systemTypes": [
    "hazardousLiquid"
  ],
  "states": [],
  "includeCoordinates": false,
  "maxResults": 5,
  "onlyNew": false
}' |
apify call hopeful_crabgrass/phmsa-pipeline-incidents --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hopeful_crabgrass/phmsa-pipeline-incidents"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/DXhhTRTloa8Jc6VRs/builds/CWuGsKg8RA2jaSjIC/openapi.json
