{
  "openapi": "3.0.1",
  "info": {
    "title": "US Coast Guard Vessel Inspections Scraper - PSIX",
    "description": "Search the US Coast Guard PSIX vessel database: IMO number, call sign, flag, service type, build year, length and tonnage, certificates and class society, plus every recorded inspection with its full deficiency narratives, action codes, detentions and resolutions. JSON, CSV, Excel.",
    "version": "0.1",
    "x-build-id": "X84J3eX70x7AHUR4a"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/scrapers_lat~uscg-psix-vessel-inspections-scraper/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-scrapers_lat-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/scrapers_lat~uscg-psix-vessel-inspections-scraper/runs": {
      "post": {
        "operationId": "runs-sync-scrapers_lat-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/scrapers_lat~uscg-psix-vessel-inspections-scraper/run-sync": {
      "post": {
        "operationId": "run-sync-scrapers_lat-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": {
          "searchMode": {
            "title": "Search mode",
            "enum": [
              "name",
              "identifiers",
              "fleet"
            ],
            "type": "string",
            "description": "How to pick the vessels. Name is a partial match on the vessel name. Identifiers looks up exact IMO numbers, official numbers or call signs. Fleet sweeps every vessel under a flag state and/or service type.",
            "default": "name"
          },
          "vesselName": {
            "title": "Vessel name",
            "type": "string",
            "description": "Part of the vessel name, e.g. \"MAERSK\" finds EFFIE MAERSK, MAERSK NEWBURY and so on. Used when search mode is \"By vessel name\"."
          },
          "identifiers": {
            "title": "IMO numbers / official numbers / call signs",
            "type": "array",
            "description": "Exact identifiers to look up, e.g. \"9200835\" (IMO) or \"9VIP6\" (call sign). An \"IMO\" prefix is ignored. Used when search mode is \"By IMO number / official number / call sign\".",
            "items": {
              "type": "string"
            }
          },
          "flag": {
            "title": "Flag state",
            "type": "string",
            "description": "Flag state to sweep, spelled as the registry spells it, e.g. \"PANAMA\", \"LIBERIA\", \"SINGAPORE\", \"MARSHALL ISLANDS\". Used when search mode is \"Fleet sweep\"."
          },
          "serviceType": {
            "title": "Service type",
            "type": "string",
            "description": "Service type to sweep, e.g. \"Tank Ship\", \"Freight Ship\", \"Passenger Ship\", \"Offshore Supply Vessel\", \"Commercial Fishing Vessel\". Used when search mode is \"Fleet sweep\"."
          },
          "buildYearFrom": {
            "title": "Built from year",
            "minimum": 1890,
            "maximum": 2100,
            "type": "integer",
            "description": "Only vessels whose construction was completed in this year or later. In fleet mode this also drives the sweep: the registry only accepts one build year per request, so the range is walked year by year."
          },
          "buildYearTo": {
            "title": "Built to year",
            "minimum": 1890,
            "maximum": 2100,
            "type": "integer",
            "description": "Only vessels whose construction was completed in this year or earlier."
          },
          "outputLevel": {
            "title": "One row per",
            "enum": [
              "vessel",
              "inspection"
            ],
            "type": "string",
            "description": "Vessel gives one rich record per ship with its inspections nested. Inspection gives one flat row per inspection (vessel details repeated), which is easier to pivot and chart.",
            "default": "vessel"
          },
          "maxRecords": {
            "title": "Maximum results",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many results. Free Apify plans are capped at 10 per run.",
            "default": 20
          },
          "statusFilter": {
            "title": "Vessel status",
            "enum": [
              "any",
              "active",
              "inactive"
            ],
            "type": "string",
            "description": "Keep only active hulls, only inactive ones, or both.",
            "default": "any"
          },
          "flagFilter": {
            "title": "Keep only these flag states",
            "type": "array",
            "description": "Post-filter on flag state, e.g. [\"PANAMA\", \"LIBERIA\"]. Useful to narrow a name search to specific registries.",
            "items": {
              "type": "string"
            }
          },
          "serviceTypeFilter": {
            "title": "Keep only these service types",
            "type": "array",
            "description": "Post-filter on service type, matched as a substring, e.g. [\"Tank Ship\"].",
            "items": {
              "type": "string"
            }
          },
          "inspectionDateFrom": {
            "title": "Inspections from",
            "type": "string",
            "description": "Only inspections on or after this date (YYYY-MM-DD)."
          },
          "inspectionDateTo": {
            "title": "Inspections to",
            "type": "string",
            "description": "Only inspections on or before this date (YYYY-MM-DD)."
          },
          "portStateControlOnly": {
            "title": "Port State Control exams only",
            "type": "boolean",
            "description": "Keep only inspections flagged by the Coast Guard as Port State Control related — the foreign-flag exams that drive detention and targeting decisions.",
            "default": false
          },
          "detentionsOnly": {
            "title": "Detentions only",
            "type": "boolean",
            "description": "Keep only inspections that resulted in a detention (deficiency action code 30) or a recorded control action.",
            "default": false
          },
          "withDeficienciesOnly": {
            "title": "Only inspections with deficiencies",
            "type": "boolean",
            "description": "Drop clean inspections.",
            "default": false
          },
          "unresolvedDeficienciesOnly": {
            "title": "Only unresolved deficiencies",
            "type": "boolean",
            "description": "Keep only inspections that still carry at least one deficiency the registry has not marked resolved.",
            "default": false
          },
          "minDeficiencies": {
            "title": "Minimum deficiencies per vessel",
            "minimum": 0,
            "type": "integer",
            "description": "Drop vessels with fewer than this many recorded deficiencies in total. A quick way to isolate problem tonnage."
          },
          "deficiencySystem": {
            "title": "Deficiency system contains",
            "type": "string",
            "description": "Keep only inspections with a deficiency against this system or sub-system, e.g. \"Fire Fighting\", \"Engineering\", \"Lifesaving\", \"Pollution\"."
          },
          "deficiencyKeyword": {
            "title": "Deficiency text contains",
            "type": "string",
            "description": "Free-text search inside the inspector's deficiency narrative, e.g. \"lifeboat\", \"corrosion\", \"ISM\", \"oily water separator\"."
          },
          "portContains": {
            "title": "Inspection port contains",
            "type": "string",
            "description": "Keep only inspections at ports matching this text, e.g. \"Houston\", \"Louisiana\", \"New Orleans\"."
          },
          "maxInspectionsPerVessel": {
            "title": "Maximum inspections per vessel",
            "minimum": 1,
            "maximum": 500,
            "type": "integer",
            "description": "Newest inspections first. Lower this to speed up large sweeps; raise it for a complete inspection history.",
            "default": 25
          },
          "includeInspections": {
            "title": "Include the inspection history",
            "type": "boolean",
            "description": "Nest every matching inspection in the vessel record.",
            "default": true
          },
          "includeDeficiencies": {
            "title": "Include deficiency detail",
            "type": "boolean",
            "description": "Include each deficiency's full narrative, system classification, action code and resolution. This is the slowest part of a run — switch it off for a fast fleet inventory.",
            "default": true
          },
          "includeCertificates": {
            "title": "Include certificates and documents",
            "type": "boolean",
            "description": "Include the certificate list (COI, load line, IOPP, class documents) with issue and expiry dates.",
            "default": true
          },
          "includeDimensions": {
            "title": "Include dimensions",
            "type": "boolean",
            "description": "Include length, breadth and depth.",
            "default": true
          },
          "includeTonnage": {
            "title": "Include tonnage",
            "type": "boolean",
            "description": "Include gross, net, deadweight and displacement tonnage.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Concurrency",
            "minimum": 1,
            "maximum": 12,
            "type": "integer",
            "description": "How many vessels to read at once.",
            "default": 6
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. The registry is reachable without a proxy; add one only if your network needs it.",
            "default": {
              "useApifyProxy": false
            }
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}