🚀 Experience the new and improved APIVoid! Check out what's new
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
}
Key Features
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.
By default, our API scans the top 20 ports, e.g 21 (FTP), 22 (SSH), 23 (Telnet), 80 (HTTP), 443 (HTTPS).
You can specify custom ports to be scanned (comma separated), such as 21,22,23,25,80,110,443.
View the number of open ports as well as which specific ports are open or closed and the service name.
The submitted IP is scanned in real-time and the response is returned in 1-3 seconds on average.
Common Use Cases
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:
Scan for exposed ports as part of automated security checks in vulnerability management workflows.
Quickly audit external-facing servers to identify which TCP ports are open to the Internet.
Integrate fast and reliable port scanning into your security tools or internal auditing systems.
Verify if firewall rules are correctly configured to block or allow access to specific TCP ports.
USAGE EXAMPLE
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);
}
Create your account, pick a subscription plan, and make your first API call instantly with your API key—simple as that!
Get started now