About the Security Tools API

API Version: 1.9

The Security Tools API reads the TLS/SSL certificate a host is actually serving and hands it back as JSON. One HTTPS GET returns who the certificate was issued to and by, the validity window, the Subject Alternative Names it covers, its serial number and SHA-1 fingerprint, and the raw PEM - enough to check an expiry date, confirm a renewal reached production, or verify that the hostname you are calling is genuinely covered by the certificate answering for it.

Certificates are read from the host at request time rather than from a cache, so the response reflects what a client connecting right now would be presented with. Lookups need no API key. Any TCP port can be checked with the port parameter, so services that terminate TLS somewhere other than 443 - mail submission, staging listeners, internal load balancers - are inspected the same way as a public website.

This is the API for the Security Tools.

Endpoints

https://networkcalc.com/api/security/certificate/{hostname}

Retrieve the TLS/SSL certificate presented by a host. Returns the issuing chain details, validity window, alternate names, serial number, fingerprint and raw PEM for the certificate found on the given hostname and port.

Parameters

{hostname}

(Required) The hostname, domain name, or IP address to look up.

Example: https://networkcalc.com/api/security/certificate/example.com

port

(Optional) Specify the TCP port to use on the remote host.

Values: 0-65535

Example: https://networkcalc.com/api/security/certificate/example.com?port=8080

Response Codes

200
OK - Success.
400
NO_HOST_SPECIFIED - The {hostname} parameter was not specified.
400
INVALID_PORT - The port you specified is invalid or out of range.
400
TIMEOUT - The network connection timed out or no certificate exists.
400
UNSPECIFIED_ERROR - An unknown error occurred. Check all parameters and try again.

Response Formats

{
  "status": "[string] The status of the request.",
  "certificate": {
    "issued_to": "[string] The host for which the certificate was issued.",
    "valid_from": "[date] The date on which the certificate became valid. Date format is ISO 8601.",
    "valid_to": "[date] The date on which the certificate expires. Date format is ISO 8601.",
    "alternate_names": "[array] Subnet Alternative Names (SANs), i.e., alternate hostnames.",
    "serial_number": "[string] The certificate's serial number, a unique identifier.",
    "fingerprint": "[string] The certificate's fingerprint, a computed has of the entire certificate",
    "raw": "[string] The certificate in its raw format. Includes newlines as '\n'"
  }
}