🚀 Experience the new and improved APIVoid! Check out what's new

Port Scan API: Detect Open TCP Ports

A JSON API to check open TCP ports on both IPv4 and IPv6 addresses. Use this API to scan your server IPs for open ports, perform network probing, and support vulnerability assessments in your security workflows.

Available from Growth Plan and up

Consumes 5 credits per API call

# Example Curl request from the command line:
                          
curl -X POST "https://api.apivoid.com/v2/port-scan" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: YOUR_API_KEY_HERE" \
     -d '{"ip": "1.2.3.4"}'

# Example JSON output for a 200 HTTP status code:

{
    "ip": "1.2.3.4",
    "open_ports": 4,
    "scanned_ports": 20,
    "ports": [
        {
            "port": 21,
            "proto": "tcp",
            "status": "open",
            "service": "ftp"
        },
        {
            "port": 22,
            "proto": "tcp",
            "status": "open",
            "service": "ssh"
        },
        {
            "port": 23,
            "proto": "tcp",
            "status": "closed",
            "service": "telnet"
        },
        {
            "port": 25,
            "proto": "tcp",
            "status": "closed",
            "service": "smtp"
        },
        {
            "port": 53,
            "proto": "tcp",
            "status": "closed",
            "service": "domain"
        },
        {
            "port": 80,
            "proto": "tcp",
            "status": "open",
            "service": "http"
        },
        {
            "port": 110,
            "proto": "tcp",
            "status": "closed",
            "service": "pop3"
        },
        {
            "port": 111,
            "proto": "tcp",
            "status": "closed",
            "service": "rpcbind"
        },
        {
            "port": 135,
            "proto": "tcp",
            "status": "closed",
            "service": "msrpc"
        },
        {
            "port": 139,
            "proto": "tcp",
            "status": "closed",
            "service": "netbios-ssn"
        },
        {
            "port": 143,
            "proto": "tcp",
            "status": "closed",
            "service": "imap"
        },
        {
            "port": 443,
            "proto": "tcp",
            "status": "open",
            "service": "https"
        },
        {
            "port": 445,
            "proto": "tcp",
            "status": "closed",
            "service": "microsoft-ds"
        },
        {
            "port": 993,
            "proto": "tcp",
            "status": "closed",
            "service": "imaps"
        },
        {
            "port": 995,
            "proto": "tcp",
            "status": "closed",
            "service": "pop3s"
        },
        {
            "port": 1723,
            "proto": "tcp",
            "status": "closed",
            "service": "pptp"
        },
        {
            "port": 3306,
            "proto": "tcp",
            "status": "closed",
            "service": "mysql"
        },
        {
            "port": 3389,
            "proto": "tcp",
            "status": "closed",
            "service": "ms-wbt-server"
        },
        {
            "port": 5900,
            "proto": "tcp",
            "status": "closed",
            "service": "vnc"
        },
        {
            "port": 8080,
            "proto": "tcp",
            "status": "closed",
            "service": "http-proxy"
        }
    ],
    "elapsed_ms": 185
}
Code analysis

Key Features

Easily identify open ports on your IP addresses with this API

Businesses and sysadmins use this Port Scan API to detect open ports on any IP addresses. Useful to audit server exposure and integrate port scanning into automated vulnerability assessment workflows.

Scan Top 20 & 100 Ports

By default, our API scans the top 20 ports, e.g 21 (FTP), 22 (SSH), 23 (Telnet), 80 (HTTP), 443 (HTTPS).

Scan Custom Ports

You can specify custom ports to be scanned (comma separated), such as 21,22,23,25,80,110,443.

Detailed Report

View the number of open ports as well as which specific ports are open or closed and the service name.

Fast Response

The submitted IP is scanned in real-time and the response is returned in 1-3 seconds on average.

Common Use Cases

Take a look at some real-world use cases of this API service

Our API can be used in many ways, from cybersecurity tasks to research-specific tasks. Here we showcase the most popular use cases according to our customers usage:

Vulnerability Assessment

Scan for exposed ports as part of automated security checks in vulnerability management workflows.

Audit Server Exposure

Quickly audit external-facing servers to identify which TCP ports are open to the Internet.

Port Scan Integration

Integrate fast and reliable port scanning into your security tools or internal auditing systems.

Firewall Testing

Verify if firewall rules are correctly configured to block or allow access to specific TCP ports.

Use cases

EVERYTHING YOU GET

Do it all with one port scan

One request scans the most commonly exposed TCP ports, or any custom port list you supply, and tells you which are open, which are closed and the service name.

Choose what to scan

  • Top 20 most common ports
  • Top 100 most common ports
  • Or your own custom port list
  • Any IPv4 address
  • Remote access: SSH, RDP, VNC, Telnet
  • Web, email, database ports

Per-port results

  • Port number and protocol
  • Open or closed status
  • Count of open and scanned ports
  • Service name per port
  • Every scanned port in the response
  • No parsing of scanner output

Built for developers

  • Plain JSON over HTTPS
  • Response usually in milliseconds
  • Feed results straight into alerting
  • Track exposed services over time
  • Five credits per scan
  • Simple integration

USAGE EXAMPLE

Learn how seamless it is to add and use Port Scan API anywhere you want

All it takes is a HTTPS POST request with JSON payload to our endpoint, and you’ll receive the response within seconds, usually within 1-3 seconds. Here are a few code examples to use the API:

$ip = '1.2.3.4';

$apiUrl = 'https://api.apivoid.com/v2/port-scan';
$apiKey = 'your_api_key_here';

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['ip' => $ip]));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode === 200) {
    $responseData = json_decode($response, true);
    
    print_r($responseData);
} else {
    print_r('An error occurred: '.$response);
}

Start using our API services in just a few minutes

Create your account, activate your free trial and make your first API call. No credit card and no commitment required.

Get started now