# USCG PSIX Vessel Inspections, Deficiencies & Document Expiry (`groundplanes/uscg-psix-vessel-inspections-scraper`) Actor

US Coast Guard PSIX vessel data, one row per vessel: particulars, tonnage, length, Certificate of Documentation expiry, recent inspection cases and deficiency counts. Filter by service type, COD expiring within N days, or open deficiencies.

- **URL**: https://apify.com/groundplanes/uscg-psix-vessel-inspections-scraper.md
- **Developed by:** [Groundplane Labs](https://apify.com/groundplanes) (community)
- **Categories:** Business
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 vessels

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

## USCG PSIX Vessel Inspections, Deficiencies & Document Expiry

Pull US Coast Guard vessel records from PSIX into clean JSON: one row per vessel with its particulars, tonnage and length, its Certificate of Documentation (COD) issue and expiry dates, and how many Coast Guard cases, inspections and deficiencies PSIX records for it in a lookback window. Filter by service type, by COD expiring within N days, or to vessels with deficiencies PSIX records as unresolved.

> This actor is an independent tool. It is not affiliated with or endorsed by the U.S. Coast Guard or the Department of Homeland Security. PSIX data comes "as is"; the Coast Guard states it is not liable for its accuracy, completeness or timeliness.

**No owner data.** PSIX does not publish the vessel owner, managing owner, operator, any address, the hailing port, horsepower or hull material, so this actor has none of those fields. It does not look them up anywhere else.

### What it does

- Lists candidate vessels per service type from the PSIX web service (`getVesselSummaryXMLString`). The service-type filter is applied by PSIX itself.
- Keeps Active vessels (unless you include inactive ones). When the COD filter is on, it keeps only US-flag vessels, because only US-flag vessels hold a Coast Guard Certificate of Documentation (in a live check, 0 of 150 foreign-flag freight ships had one).
- Reads each candidate's documents and keeps the vessel when its newest COD expires between today and today + `docExpirationWithinDays`. **This filter is applied by the actor after reading each vessel's documents; PSIX cannot filter on it.**
- For each vessel that passes, reads particulars, tonnage, dimensions, every Coast Guard case in the lookback window (PSIX applies the date window), and the deficiencies recorded on each case. The open-deficiency filter is applied by the actor.
- Outputs counts only. Deficiency descriptions and resolution notes are free text written by inspectors and are never output.
- Checks the source before and during every run: known records must come back in the expected shape at run start, and the run fails loudly if a renamed element would otherwise look like "no COD", "no deficiencies" or "no tonnage" across many vessels.

### Who it's for

- Marine surveyors and inspectors planning work around expiring documentation or recent inspection history.
- Maritime insurers and P\&I underwriters screening a fleet's inspection and deficiency record.
- Compliance consultants and charter brokers checking a vessel's Coast Guard history before a deal.

### Input

| Field | Type | Default | Description |
|---|---|---|---|
| `vesselServiceTypes` | array | Towing Vessel, Offshore Supply Vessel | PSIX service types (applied by PSIX). 25 values are offered, including Passenger (Inspected), Freight Ship, Tank Ship, Tank Barge and Commercial Fishing Vessel; Recreational is not. Required unless you search a single vessel. See "Run time" below before adding large types. |
| `docExpirationWithinDays` | integer | `90` | Only vessels whose newest COD expires between today and today + N days (applied by this actor). `0` turns the filter off. Already-expired CODs are not included. |
| `onlyWithActiveDeficiencies` | boolean | `false` | Only vessels with at least one deficiency PSIX records as not resolved (`IsResolved` false) on a case in the lookback window (applied by this actor). |
| `inspectionLookbackYears` | integer | `5` | Years of Coast Guard cases and deficiencies to count (applied by PSIX). 1 to 30. |
| `includeInactiveVessels` | boolean | `false` | Off: Active vessels only. On: also Inactive, Laid Up, Scrapped, Sunk and other statuses. |
| `vesselNameOrImoOrOfficialNum` | string | empty | Optional single-vessel search. Digits (with or without an `IMO` prefix) search the vessel's primary number; anything else searches names (PSIX matches names containing it). The service-type list still applies; empty it to search all service types. |
| `maxItems` | integer | `1000` | Maximum vessels to return. |

#### Example input (canary)

```json
{
  "vesselServiceTypes": ["Offshore Supply Vessel"],
  "docExpirationWithinDays": 90,
  "onlyWithActiveDeficiencies": false,
  "inspectionLookbackYears": 5,
  "includeInactiveVessels": false,
  "vesselNameOrImoOrOfficialNum": "",
  "maxItems": 1000
}
```

On 2026-11-01 this returned 30 vessels in about 2.5 minutes: PSIX listed 2,795 Offshore Supply Vessels, 1,124 of them active and US-flag; 389 had a COD and 30 of those expire within 90 days.

#### Example run options (default $50 max charge)

```json
{ "maxTotalChargeUsd": 50 }
```

The actor checks your max charge before every dataset push and stops cleanly when the limit is reached.

### Output

One row per vessel.

| Field | Type | Description |
|---|---|---|
| `uscgVesselId` | integer | PSIX's internal vessel id. |
| `vesselName` | string | Vessel name. |
| `primaryVesselNumber` | string or null | The vessel's primary number in PSIX. |
| `primaryVesselNumberType` | string or null | What that number is: `Official Number (U.S.)`, `IMO Number`, `Coast Guard Number`, `State Number`, `Official Number (Foreign)`, `HIN` or `Hull Number`. |
| `officialNumber` | string or null | US official number, when that is the primary number. |
| `imoNumber` | string or null | IMO number, when that is the primary number. PSIX's web service returns one number per vessel, so a US vessel's IMO number is not available. |
| `callSign` | string or null | Radio call sign (`N/A` in PSIX becomes null). |
| `flag` | string or null | Flag state as PSIX lists it, for example `UNITED STATES`. |
| `serviceType`, `serviceSubType` | string | PSIX service type and sub-type. |
| `vesselStatus` | string | PSIX status, for example `Active`. |
| `buildYear` | integer or null | Year construction was completed (`0` in PSIX becomes null). |
| `grossTons`, `netTons` | number or null | Gross and net tonnage under US regulatory measurement (`Regulatory (Subpart C or D)`, or `Simplified`). |
| `tonnageBasis` | string or null | Which of those two measurement systems the figures use. |
| `grossTonsConvention` | number or null | International (Convention, Subpart B) gross tonnage, when measured. |
| `lengthFeet` | number or null | Registered length in feet (PSIX dimension type `Length`). |
| `certificateOfDocumentationIssueDate`, `certificateOfDocumentationExpDate` | string or null | Newest COD's issue and expiry dates, YYYY-MM-DD. Null when the vessel has no COD, or when its only COD is a pending application (PSIX shows no dates for those). |
| `certificateOfDocumentationStatus` | string or null | That COD's status in PSIX, for example `Valid`, `EXPIRED`, `Case Pending`. |
| `daysUntilDocExpiration` | integer or null | Days from the run date to the COD expiry (negative if past). |
| `recentCasesCount` | integer | All Coast Guard cases in the window: inspections, exams, boardings, incident investigations, enforcement and others. |
| `recentInspectionCasesCount` | integer | Cases of type `Vessel Inspection` or `Uninspected Towing Vessel Exam`. |
| `recentCasesByType` | object | Case counts by PSIX case type. |
| `lastInspectionDate` | string or null | Start date of the newest inspection case in the window. |
| `deficienciesFoundCount` | integer | Deficiencies recorded on all cases in the window. |
| `openDeficienciesCount` | integer | Of those, how many PSIX records as not resolved. |
| `casesSinceDate` | string | Start of the lookback window, YYYY-MM-DD. |

#### Sample row (real, from the canary run)

```json
{
  "uscgVesselId": 911294,
  "vesselName": "KARLA F",
  "primaryVesselNumber": "1203572",
  "primaryVesselNumberType": "Official Number (U.S.)",
  "officialNumber": "1203572",
  "imoNumber": null,
  "callSign": "WDE3008",
  "flag": "UNITED STATES",
  "serviceType": "Offshore Supply Vessel",
  "serviceSubType": "General",
  "vesselStatus": "Active",
  "buildYear": 2008,
  "grossTons": 99.0,
  "netTons": 68.0,
  "tonnageBasis": "Regulatory (Subpart C or D)",
  "grossTonsConvention": 567.0,
  "lengthFeet": 153.3,
  "certificateOfDocumentationIssueDate": "2025-12-03",
  "certificateOfDocumentationExpDate": "2026-12-31",
  "certificateOfDocumentationStatus": "Valid",
  "daysUntilDocExpiration": 60,
  "recentCasesCount": 9,
  "recentInspectionCasesCount": 8,
  "recentCasesByType": { "Vessel Inspection": 8, "Incident Investigation": 1 },
  "lastInspectionDate": "2026-09-21",
  "deficienciesFoundCount": 26,
  "openDeficienciesCount": 0,
  "casesSinceDate": "2021-11-01"
}
```

### How pricing works

Pay per result. You only pay for rows returned.

### Data source and terms

- **USCG CGMIX Port State Information Exchange (PSIX)** web service, `https://cgmix.uscg.mil/xml/PSIXData.asmx` (public, keyless, SOAP). Portal: https://cgmix.uscg.mil/PSIX/.
- **What PSIX is:** in the Coast Guard's words, a weekly snapshot of Freedom of Information Act data from its MISLE system on US-flag vessels, foreign vessels operating in US waters, and Coast Guard contacts with those vessels. **Cases that are still open or pending further action are withheld from PSIX**, so a recent inspection may not appear until it is closed.
- **Update cadence:** weekly, per the PSIX home page. This actor is not real time.
- **Freshness check:** once a run has read 300 or more dated CODs, the newest COD issue date among them must be within 45 days, because CODs are issued every working day. Otherwise the run ends `PARTIAL` and names the date.
- **Terms:** US government data published for public access; the Coast Guard disclaims liability for its use.

### How "open" deficiencies work

`openDeficienciesCount` counts deficiencies whose PSIX record says `IsResolved` false. In live checks, most such records were years old (4 of 6 in one sample were about 15 years old), on cases that are closed. Treat the count as "PSIX has no resolution recorded", not as proof the problem still exists on board.

### Limits and FAQ

- **Run time.** PSIX answers one vessel at a time and the actor keeps to 3 connections, as the Coast Guard server requires, so it reads roughly 5 to 10 vessels a second. Measured on 2026-11-01: the default (Towing Vessel plus Offshore Supply Vessel, 7,903 candidates) took 21 minutes and returned 486 vessels. Large service types take much longer: Passenger (Inspected) has about 17,600 active US candidates and Commercial Fishing Vessel about 68,000, so all five large types together would take several hours. Narrow the service types, or use `maxItems`; the run keeps a reserve before the run timeout (2 hours by default) and stops cleanly with `PARTIAL` if it would run out.
- **How many match?** In the default run, 6,203 of 7,903 candidates had a COD and 486 (about 6%) expire within 90 days. Most CODs run for one year.
- **Null fields.** In the default run, 23 of 486 vessels have no regulatory gross tonnage (some have only Convention tonnage) and every vessel had a length. In a full Passenger Barge (Inspected) run, about a quarter of vessels had no tonnage and 13% no length: PSIX simply has none for them.
- **Single vessel not found with the default filters?** A foreign-flag vessel has no COD, so with `docExpirationWithinDays` above 0 it is excluded. Set it to `0` for a lookup.
- **Already-expired CODs** are not included by the expiry filter; set `docExpirationWithinDays` to `0` and read `daysUntilDocExpiration` instead.
- **Order:** vessels are scanned one service type at a time in turn (round robin), newest PSIX record first within each type. Rows appear in the dataset in that order.

### Privacy note

Rows describe vessels, not people. The actor outputs no owner, operator, crew or address data (PSIX has none) and never outputs the free-text deficiency descriptions or resolution notes, which can name crew members. Recreational vessels are excluded. Some commercial vessels are named after people; vessel names are passed through as PSIX lists them.

### Troubleshooting

- **FAILED with "known official number", "start check" or "schema drift"**: PSIX changed its format, or the known records used for the start check changed. Nothing was delivered.
- **FAILED with "no CERTIFICATE OF DOCUMENTATION record", "no deficiency records", "no gross tonnage" or "no length"**: an element PSIX used to send has been renamed. The run stops instead of shipping empty fields.
- **FAILED with "over the 20% limit"**: more than 1 in 5 vessels could not be read. If rows were pushed before the check, the status says how many; treat them as unreliable.
- **PARTIAL with "vessels skipped"**: some vessels could not be read (named reason and count); the rest were delivered.
- **PARTIAL with "looks stale"**: PSIX has not been refreshed recently.
- **PARTIAL with "Reached maxItems" or "Stopped before the run timeout"**: your limit was reached before every candidate was scanned. Raise `maxItems` or the run timeout, or narrow the service types.
- **Complete: 0**: no vessel matched your filters.

If this keeps happening, please open an issue on this actor's Issues tab and we'll fix it fast.

### Changelog

- **0.1** (2026-11-01): first build.

# Actor input Schema

## `docExpirationWithinDays` (type: `integer`):

Only vessels whose newest Certificate of Documentation expires between today and today + N days. Applied by this actor after reading each vessel's documents (PSIX cannot filter on it). Only US-flag vessels hold a COD. 0 turns the filter off.

## `includeInactiveVessels` (type: `boolean`):

Off: only vessels PSIX lists as Active. On: also Inactive, Laid Up, Scrapped, Sunk and other statuses.

## `inspectionLookbackYears` (type: `integer`):

How many years of Coast Guard cases (inspections, exams, boardings, investigations) and their deficiencies to count. Applied by PSIX itself.

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

Maximum vessels to return. Vessels are scanned service type by service type in turn, newest PSIX record first. A run that stops here before scanning every candidate ends PARTIAL and says how many were left unscanned.

## `onlyWithActiveDeficiencies` (type: `boolean`):

Only vessels with at least one deficiency that PSIX records as not resolved (IsResolved = false) in the lookback window. Some open records are years old: this is PSIX's record, not proof the problem still exists.

## `vesselNameOrImoOrOfficialNum` (type: `string`):

Optional. Digits (for example 1136956 or 8301175) search the vessel's primary number; anything else searches vessel names (PSIX matches names that start with or contain it). The service-type list still applies; leave it empty to search every service type except Recreational.

## `vesselServiceTypes` (type: `array`):

PSIX service types to include (applied by PSIX itself). Recreational vessels are not offered. At least one is required unless you search a single vessel below.

## Actor input object example

```json
{
  "docExpirationWithinDays": 90,
  "includeInactiveVessels": false,
  "inspectionLookbackYears": 5,
  "maxItems": 1000,
  "onlyWithActiveDeficiencies": false,
  "vesselNameOrImoOrOfficialNum": "",
  "vesselServiceTypes": [
    "Towing Vessel",
    "Offshore Supply Vessel"
  ]
}
```

# 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 = {
    "docExpirationWithinDays": 90,
    "inspectionLookbackYears": 5,
    "maxItems": 1000,
    "vesselNameOrImoOrOfficialNum": "",
    "vesselServiceTypes": [
        "Towing Vessel",
        "Offshore Supply Vessel"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("groundplanes/uscg-psix-vessel-inspections-scraper").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 = {
    "docExpirationWithinDays": 90,
    "inspectionLookbackYears": 5,
    "maxItems": 1000,
    "vesselNameOrImoOrOfficialNum": "",
    "vesselServiceTypes": [
        "Towing Vessel",
        "Offshore Supply Vessel",
    ],
}

# Run the Actor and wait for it to finish
run = client.actor("groundplanes/uscg-psix-vessel-inspections-scraper").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 '{
  "docExpirationWithinDays": 90,
  "inspectionLookbackYears": 5,
  "maxItems": 1000,
  "vesselNameOrImoOrOfficialNum": "",
  "vesselServiceTypes": [
    "Towing Vessel",
    "Offshore Supply Vessel"
  ]
}' |
apify call groundplanes/uscg-psix-vessel-inspections-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,groundplanes/uscg-psix-vessel-inspections-scraper"
        }
    }
}
```

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/DIVA7YOuLjGcLTSv0/builds/qsiaMhdBbXFzFvXcF/openapi.json
