{
  "openapi": "3.0.1",
  "info": {
    "title": "nmap - Network Port Scanner & Service Detection",
    "description": "Cloud-hosted nmap (industry-standard network scanner by Fyodor). TCP connect port scans, service/version detection, NSE scripts. Results streamed as structured dataset records — one row per discovered port. $0.005 per record. Authorize scans before running.",
    "version": "1.0",
    "x-build-id": "Lk6SE8DTToupDjFAK"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/anshumanatrey~nmap-scanner/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-anshumanatrey-nmap-scanner",
        "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/anshumanatrey~nmap-scanner/runs": {
      "post": {
        "operationId": "runs-sync-anshumanatrey-nmap-scanner",
        "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/anshumanatrey~nmap-scanner/run-sync": {
      "post": {
        "operationId": "run-sync-anshumanatrey-nmap-scanner",
        "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",
        "required": [
          "target"
        ],
        "properties": {
          "target": {
            "title": "Target",
            "type": "string",
            "description": "IP address, hostname, CIDR range, or space-separated list. Examples: 8.8.8.8 | scanme.nmap.org | 192.168.1.0/24 | 10.0.0.1 10.0.0.2. You MUST be authorized to scan the target."
          },
          "scanProfile": {
            "title": "Scan Profile",
            "enum": [
              "quick",
              "standard",
              "thorough",
              "web",
              "vuln",
              "custom"
            ],
            "type": "string",
            "description": "Preset combinations. quick = top 100 ports fast | standard = top 1000 + service detection | thorough = all 65535 ports + scripts | web = web ports + HTTP scripts | vuln = vulnerability NSE scripts. Pick 'custom' to use the raw flags below.",
            "default": "standard"
          },
          "ports": {
            "title": "Ports",
            "type": "string",
            "description": "Port specification (only used when scanProfile is 'custom'). Examples: 22 | 1-1000 | 22,80,443 | top-100 | top-1000 | all. Leave empty for nmap default."
          },
          "scanTechnique": {
            "title": "Scan Technique",
            "enum": [
              "tcp-connect"
            ],
            "type": "string",
            "description": "TCP connect (-sT) is the only technique that works without root. Apify containers run unprivileged so SYN/UDP/etc are not available.",
            "default": "tcp-connect"
          },
          "serviceDetection": {
            "title": "Service & Version Detection (-sV)",
            "type": "boolean",
            "description": "Identify what service is running on each open port and its version. Adds 10-60s per host.",
            "default": true
          },
          "defaultScripts": {
            "title": "Default NSE Scripts (-sC)",
            "type": "boolean",
            "description": "Run the default category of NSE scripts (~100 useful scripts: banner grabbing, SSL info, HTTP titles, etc.).",
            "default": false
          },
          "customScripts": {
            "title": "Custom NSE Scripts (--script)",
            "type": "string",
            "description": "Comma-separated NSE script names or categories. Examples: http-title,ssl-cert | vuln | http-* | safe and discovery."
          },
          "timing": {
            "title": "Timing Template",
            "enum": [
              "T0",
              "T1",
              "T2",
              "T3",
              "T4",
              "T5"
            ],
            "type": "string",
            "description": "T0 paranoid (slow, IDS-evading) ... T5 insane (very fast, may miss results). T4 is the sweet spot for most internet targets.",
            "default": "T4"
          },
          "skipHostDiscovery": {
            "title": "Skip Host Discovery (-Pn)",
            "type": "boolean",
            "description": "Assume host is up, skip ping probe. Recommended — Apify network often blocks ICMP.",
            "default": true
          },
          "excludePorts": {
            "title": "Exclude Ports",
            "type": "string",
            "description": "Comma-separated ports to exclude (--exclude-ports). Example: 9100,4444"
          },
          "openPortsOnly": {
            "title": "Show Only Open Ports (--open)",
            "type": "boolean",
            "description": "Suppress closed/filtered ports in the output. Cleaner dataset.",
            "default": true
          },
          "customArgs": {
            "title": "Custom nmap Arguments (advanced)",
            "type": "string",
            "description": "Raw nmap flags appended to the command. Use with care — must be valid nmap flags. Example: --max-retries 2 --host-timeout 30s"
          },
          "timeout": {
            "title": "Subprocess Timeout (seconds)",
            "minimum": 30,
            "maximum": 3600,
            "type": "integer",
            "description": "Hard kill nmap after this many seconds. Default 1800 (30 min).",
            "default": 1800
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}