# US DOT PHMSA Hazmat Registrations (`eclat-data/us-dot-phmsa-hazmat-registrations`) Actor

Fast, lightweight, HTTP-only B2B logistics & EHS compliance data extractor for the official US DOT PHMSA Hazmat Registration search: US and foreign shippers, manufacturers and carriers authorized to offer or transport hazardous materials.

- **URL**: https://apify.com/eclat-data/us-dot-phmsa-hazmat-registrations.md
- **Developed by:** [Siddharth Gupta](https://apify.com/eclat-data) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 33.3% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $5.00 / 1,000 hazmat registration records

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

## US DOT PHMSA Registered Hazmat Shippers & Carriers Extractor

Fast, lightweight, **HTTP-only** B2B logistics & EHS compliance data extractor for the official **US Department of Transportation (DOT) PHMSA Hazmat Registration Company Search** — covering US and foreign shippers, manufacturers, and carriers authorized to offer or transport regulated hazardous materials (chemicals, lithium batteries, industrial gases, fuels).

No headless browsers. Handles Oracle ADF loopback + ViewState sessions cleanly over plain HTTP and triggers PHMSA's official built-in Excel export (`HazmatRegistrationsData.xlsx`) with polite concurrency (`maxConcurrency: 3`).

***

### Key Features

- **100% HTTP-Only Oracle ADF + Bulk Excel Export:** Automatically negotiates PHMSA's Oracle ADF loopback session, executes batched searches by Company Name, Postal Code Prefix, Registration ID, or USDOT ID, and downloads the official Excel export directly.
- **Compliance & Renewal Triggers (`activeOnly`, `expiringWithinDays`):** Filter to Active hazmat registrants or companies approaching their June 30 renewal deadline — ideal for EHS consultants, hazmat packaging/drum suppliers, and freight compliance platforms.
- **Direct Contact & Carrier IDs:** Preserves `contactName`, `usdotId`, `mcNumber`, `hmCompanyId`, and normalized physical/mailing addresses.
- **Change-Monitor Mode (`onlyNewSinceLastRun`):** Persists `registrationId` + `expirationDate` in `phmsa-hazmat-monitor-state` so scheduled runs emit only newly registered or renewed hazmat companies.
- **Pay-Per-Event Ready:** Deduplicates by `registrationId` and honors both `maxItems` and Apify's `maxTotalChargeUsd` budget limit.

***

### Sample Output

```json
{
  "registrationId": "072026550023I",
  "hmCompanyId": "318338",
  "companyName": "S RUMI ENTERPRISES LLC",
  "contactName": "Sheriff Sarumi",
  "usdotId": "3477805",
  "mcNumber": null,
  "registrationStatus": "Active",
  "registrationPeriod": "2026-2027",
  "effectiveDate": "2026-07-01",
  "expirationDate": "2027-06-30",
  "daysUntilExpiration": 220,
  "streetAddress": "1623 MAIN STREET APT 305",
  "city": "DALLAS",
  "state": "TX",
  "postalCode": "75201",
  "country": "UNITED STATES",
  "matchedQuery": "postalCodePrefix:770",
  "sourceUrl": "https://portal.phmsa.dot.gov/HazmatRegistrationSearch",
  "scrapedAt": "2026-11-22T09:00:00.000Z"
}
```

***

### Using with Apify MCP (AI Agents)

```json
{
  "mcpServers": {
    "apify": {
      "command": "npx",
      "args": [
        "-y",
        "@apify/actors-mcp-server",
        "--actors",
        "<YOUR_USERNAME>/us-dot-phmsa-hazmat-registrations"
      ],
      "env": {
        "APIFY_TOKEN": "<YOUR_APIFY_TOKEN>"
      }
    }
  }
}
```

### License

MIT

# Actor input Schema

## `companyNames` (type: `array`):

One or more company name substrings to search (e.g., "Chemical", "Battery", "Logistics"). PHMSA requires at least one search filter across the 4 query fields.

## `postalCodePrefixes` (type: `array`):

One or more 2-to-5 digit ZIP/postal code prefixes (e.g., "770", "908" for Houston or Long Beach industrial corridors). Defaults to \["770"] if all four search filters are left empty.

## `registrationIds` (type: `array`):

Exact PHMSA Hazmat Registration IDs to look up and verify.

## `usdotIds` (type: `array`):

Exact USDOT numbers to look up and verify hazmat registration status.

## `activeOnly` (type: `boolean`):

When enabled, returns only companies with an Active (non-expired) PHMSA hazmat registration period.

## `expiringWithinDays` (type: `integer`):

Optional compliance/renewal trigger: return only registrations expiring within the next N days (e.g., 90 or 180). Leave empty to disable.

## `onlyNewSinceLastRun` (type: `boolean`):

When enabled, persists seen registrationId + expirationDate signatures in the named Apify Key-Value Store (phmsa-hazmat-monitor-state) and outputs ONLY newly registered or renewed companies since the prior run.

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

Maximum number of company records to return. Use this to cap dataset size and control run spend.

## Actor input object example

```json
{
  "companyNames": [],
  "postalCodePrefixes": [
    "770"
  ],
  "registrationIds": [],
  "usdotIds": [],
  "activeOnly": false,
  "onlyNewSinceLastRun": false,
  "maxItems": 100
}
```

# Actor output Schema

## `registrations` (type: `string`):

Default dataset containing one flat JSON object per registered hazmat company.

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

Execution summary including executed queries, exported row counts, and monitor-mode stats.

# 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 = {
    "postalCodePrefixes": [
        "770"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("eclat-data/us-dot-phmsa-hazmat-registrations").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 = { "postalCodePrefixes": ["770"] }

# Run the Actor and wait for it to finish
run = client.actor("eclat-data/us-dot-phmsa-hazmat-registrations").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 '{
  "postalCodePrefixes": [
    "770"
  ]
}' |
apify call eclat-data/us-dot-phmsa-hazmat-registrations --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,eclat-data/us-dot-phmsa-hazmat-registrations"
        }
    }
}
```

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/2Ti2u2GGz6kosdIiD/builds/zE0MXt69Kw2W5dojF/openapi.json
