# Port Scan

POST /lookup/port-scan: Scans a host in real time and returns its open TCP/UDP ports and the services running on them.

Source: https://docs.deepinfo.com/reference/lookup/port-scan/

Last updated: 2026-09-27

---
`POST https://api.deepinfo.com/v1/lookup/port-scan`

Scans a host in real time and returns its open TCP/UDP ports and the services running on them. Optionally detects service versions and the operating system.

> Only scan hosts you own or are authorized to test.

## Authentication

Send your API key in the `apikey` request header.

## Query Parameters

| Parameter | Required | Description | Example |
|---|---|---|---|
| `target` | Required | Domain name or IP address to scan. | `deepinfo.com` |
| `timeout` | Optional | Scan timeout in seconds. Maximum and default: `85`. | `85` |
| `proxy` | Optional | Optional proxy to scan through, in the form `scheme://user:password@host:port`. |  |

## Request Body

| Parameter | Type | Description |
|---|---|---|
| `tcp_ports` | string | TCP ports to scan: a list (`"80,443"`), a range (`"440-445"`) or both. Omit to scan the default port set of `mode` |
| `udp_ports` | string | UDP ports to scan |
| `mode` | `light` \| `full` | Scan depth. Default `light` |
| `version` | boolean | Detect service versions. Default `false` |
| `os` | boolean | Detect the operating system. Default `false` |
| `scripts` | boolean | Run service detection scripts. Default `false` |

```json
{
  "tcp_ports": "80,443",
  "mode": "light",
  "version": true
}
```

## Response Fields

| Field | Description |
|---|---|
| `status` | `success`, or `host_down` if the host did not respond |
| `target` | The scanned host |
| `target_ip` | The IP address the host resolved to |
| `port_data.tcp[]` | One entry per TCP port in the result |
| `port_data.tcp[].port_number` | Port number |
| `port_data.tcp[].state` | Port state, e.g. `open` |
| `port_data.tcp[].service_name` | Name of the service, e.g. `https` |
| `port_data.tcp[].service_product` | Product that runs the service |
| `port_data.tcp[].service_version` | Version of that product |
| `port_data.tcp[].extra_data` | Additional data about the service |
| `port_data.udp[]` | One entry per UDP port in the result |
| `port_data.udp[].port_number` | Port number |
| `port_data.udp[].state` | Port state, e.g. `open` |
| `port_data.udp[].service_name` | Name of the service, e.g. `https` |
| `port_data.udp[].service_product` | Product that runs the service |
| `port_data.udp[].service_version` | Version of that product |
| `port_data.udp[].extra_data` | Additional data about the service |
| `os` | Operating system matches, when `os` is `true` |
| `check_date` | When the scan was performed (UTC) |

## Response Schema

_Inferred from examples._ Built from the 2 saved 2xx example responses: the fields they contain, with the types seen there. It is not a contract.

| Field | Type |
|---|---|
| `status` | string |
| `target` | string |
| `target_ip` | string |
| `check_date` | string |
| `port_data` | object |
| `port_data.tcp` | array<object> |
| `port_data.tcp[].port_number` | number |
| `port_data.tcp[].service_name` | string |
| `port_data.tcp[].service_product` | null |
| `port_data.tcp[].service_version` | null |
| `port_data.tcp[].state` | string |
| `port_data.tcp[].extra_data` | object |
| `port_data.udp` | array |
| `os` | array |

## Errors

`400` if `target` is missing or the body is invalid.

## Examples

### 200 · TCP 80,443

```bash
curl -X POST 'https://api.deepinfo.com/v1/lookup/port-scan?target=deepinfo.com' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "tcp_ports": "80,443",
  "mode": "light",
  "version": true
}'
```

`Content-Type: application/json` · `deepinfo-request-id: 5f0c6a8e-1b2d-4c3e-9f4a-7b8c9d0e1f2a`

```json
{
  "status": "success",
  "target": "deepinfo.com",
  "target_ip": "104.26.11.21",
  "check_date": "2026-09-22T16:06:23Z",
  "port_data": {
    "tcp": [
      {
        "port_number": 80,
        "service_name": "http",
        "service_product": null,
        "service_version": null,
        "state": "open",
        "extra_data": {}
      },
      {
        "port_number": 443,
        "service_name": "https",
        "service_product": null,
        "service_version": null,
        "state": "open",
        "extra_data": {}
      }
    ],
    "udp": []
  },
  "os": []
}
```

### 200 · TCP Range 440-445

```bash
curl -X POST 'https://api.deepinfo.com/v1/lookup/port-scan?target=deepinfo.com' \
  -H 'apikey: YOUR_API_KEY' \
  -H 'Accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "tcp_ports": "440-445",
  "mode": "light"
}'
```

`Content-Type: application/json` · `deepinfo-request-id: 5f0c6a8e-1b2d-4c3e-9f4a-7b8c9d0e1f2a`

```json
{
  "status": "success",
  "target": "deepinfo.com",
  "target_ip": "104.26.11.21",
  "check_date": "2026-09-22T16:06:26Z",
  "port_data": {
    "tcp": [
      {
        "port_number": 440,
        "service_name": "sgcp",
        "service_product": null,
        "service_version": null,
        "state": "filtered",
        "extra_data": {}
      },
      {
        "port_number": 441,
        "service_name": "decvms-sysmgt",
        "service_product": null,
        "service_version": null,
        "state": "filtered",
        "extra_data": {}
      },
      {
        "port_number": 442,
        "service_name": "cvc_hostd",
        "service_product": null,
        "service_version": null,
        "state": "filtered",
        "extra_data": {}
      }
    ],
    "udp": []
  },
  "os": []
}
```
