{
  "openapi": "3.0.1",
  "info": {
    "title": "USCG PSIX Vessel Inspections, Deficiencies & Document Expiry",
    "description": "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.",
    "version": "0.1",
    "x-build-id": "qsiaMhdBbXFzFvXcF"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/groundplanes~uscg-psix-vessel-inspections-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-groundplanes-uscg-psix-vessel-inspections-scraper",
        "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/groundplanes~uscg-psix-vessel-inspections-scraper/runs": {
      "post": {
        "operationId": "runs-sync-groundplanes-uscg-psix-vessel-inspections-scraper",
        "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/groundplanes~uscg-psix-vessel-inspections-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-groundplanes-uscg-psix-vessel-inspections-scraper",
        "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": {
          "docExpirationWithinDays": {
            "title": "COD expires within (days)",
            "minimum": 0,
            "maximum": 3650,
            "type": "integer",
            "description": "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.",
            "default": 90
          },
          "includeInactiveVessels": {
            "title": "Include inactive vessels",
            "type": "boolean",
            "description": "Off: only vessels PSIX lists as Active. On: also Inactive, Laid Up, Scrapped, Sunk and other statuses.",
            "default": false
          },
          "inspectionLookbackYears": {
            "title": "Inspection lookback (years)",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "How many years of Coast Guard cases (inspections, exams, boardings, investigations) and their deficiencies to count. Applied by PSIX itself.",
            "default": 5
          },
          "maxItems": {
            "title": "Max rows",
            "minimum": 1,
            "type": "integer",
            "description": "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.",
            "default": 1000
          },
          "onlyWithActiveDeficiencies": {
            "title": "Only vessels with open deficiencies",
            "type": "boolean",
            "description": "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.",
            "default": false
          },
          "vesselNameOrImoOrOfficialNum": {
            "title": "Single vessel: name, IMO or official number",
            "type": "string",
            "description": "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.",
            "default": ""
          },
          "vesselServiceTypes": {
            "title": "Vessel service types",
            "type": "array",
            "description": "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.",
            "items": {
              "enum": [
                "Commercial Fishing Vessel",
                "Fish Processing Vessel",
                "Fishing Tender",
                "Freight Barge",
                "Freight Ship",
                "In-service – Inspected",
                "Industrial Vessel",
                "Mobile Offshore Drilling Unit",
                "Not in vessel service",
                "Offshore Supply Vessel",
                "Oil Recovery",
                "Passenger (Inspected)",
                "Passenger (Uninspected)",
                "Passenger Barge  (Inspected)",
                "Passenger Barge  (Uninspected)",
                "Public Freight",
                "Public Tankship/Barge",
                "Public Vessel, Unclassified",
                "Research Vessel",
                "School Ship",
                "Tank Barge",
                "Tank Ship",
                "Towing Vessel",
                "Unclassified",
                "Unknown"
              ],
              "type": "string"
            },
            "default": [
              "Towing Vessel",
              "Offshore Supply Vessel"
            ]
          }
        }
      },
      "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "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
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}