Request demo

Port Scan API

Scan for Open Ports and Their Services on Demand.

POST a target and the ports you care about. The API scans the host in real time and returns each TCP and UDP port it found with its state and service, plus versions and the operating system when you ask for them.

Request

POST /lookup/port-scan?target=deepinfo.com

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

Response · 200 OK

  1. target_ip

    104.26.11.21

  2. tcp

    • 80open · http
    • 443open · https

    service_product and service_version null when the service does not reveal them

  3. udp

    []

Only scan hosts you own or are authorized to test.

check_date 2026-09-22T16:06:23Z

Pass a Target and a Port List to Start a Scan.

The target goes in the query string and the scan options in a JSON body. Only scan hosts you own or are authorized to test.

POST https://api.deepinfo.com/v1/lookup/port-scan Reference
ParameterInTypeDescription
targetquerystringRequiredA domain name or IP address to scan.
timeoutqueryintegerOptionalScan timeout in seconds. Maximum and default 85.
tcp_portsbodystringOptionalA list ("80,443"), a range ("440-445") or both. Leave it out to scan the default set for mode.
udp_portsbodystringOptionalUDP ports to scan, in the same form.
modebodystringOptionallight or full. Default light.
versionbodybooleanOptionalDetect service versions. Default false.
osbodybooleanOptionalDetect the operating system. Default false.
scriptsbodybooleanOptionalRun service detection scripts. Default false.

Request

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

Response

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

Scan what you own, or what you are authorized to test.

The API scans whatever target you pass, so the authorization has to come from you. The reference says so on the endpoint itself.

For your inventory there is a simpler route: External Attack Surface Management runs TCP and UDP scans on all approved assets, keeps each scan’s history and can notify your team when a new port opens.

What Each Field Tells You.

Each port carries one set of fields, so TCP and UDP results read alike.

FieldMeaning
statussuccess, or host_down when the host did not respond.
target_ipThe address the target resolved to, which is the address that was scanned.
port_data.tcp[], port_data.udp[]One entry per port: port_number, state, service_name, service_product, service_version, extra_data.
osOperating system matches, when os is true.
check_dateWhen the scan ran, in UTC.

service_product and service_version can stay null, as in this sample, when a service does not reveal them. Plan-dependent rate limits apply, one request per second by default.

Questions About Port Scan API

Can we scan a list of hosts?

Each request scans one target, so a list means one call per host within your rate limit. To cover an inventory you own, let Continuous Scanning run the scans instead.

How do we get the product and version behind each port?

Set version to true in the request body; it is off by default. With a product and version in hand, Vulnerability Search can filter CVEs on enrichment.cpe.vendor and enrichment.cpe.product.

What does an invalid request return?

A 400 when target is missing or the JSON body is invalid, with the rejected field named in parameters.

How is the Port Scan API priced?

As part of an API services plan, by volume and frequency. Like the other lookups, each request counts against your plan’s quota at one unit. See Data & API pricing.

Can analysts run a scan without writing code?

Yes. Instant Lookups runs Port Scan in the Deepinfo Platform. The same rule applies there: scan only hosts you own or are authorized to test.

Start With Your Hosts.

Scan a few of your own services to see the response shape, or let External Attack Surface Management scan the whole inventory for you. We can walk through both on a short call.