{
  "openapi": "3.0.3",
  "info": {
    "title": "The Network Tools API",
    "version": "1",
    "description": "Authenticate with Authorization: Bearer ntk_... or X-API-Key. Rate limits depend on your plan and come back in X-RateLimit-* headers."
  },
  "servers": [
    {
      "url": "https://thenetworktools.com"
    }
  ],
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Key from Dashboard > API"
      }
    }
  },
  "paths": {
    "/api/v1/records": {
      "get": {
        "summary": "Mail records: SPF, DKIM, DMARC and MX in one call",
        "operationId": "records",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/mx": {
      "get": {
        "summary": "Mail servers and priorities",
        "operationId": "mx",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/dmarc": {
      "get": {
        "summary": "DMARC policy lookup and validation",
        "operationId": "dmarc",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/deliverability": {
      "get": {
        "summary": "SPF, DKIM and DMARC readiness",
        "operationId": "deliverability",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/bimi": {
      "get": {
        "summary": "BIMI record and logo checks",
        "operationId": "bimi",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/spf-flatten": {
      "get": {
        "summary": "Flatten SPF includes under the 10-lookup limit",
        "operationId": "spf_flatten",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/whois": {
      "get": {
        "summary": "Registrar, dates and name servers",
        "operationId": "whois",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/subdomains": {
      "get": {
        "summary": "Subdomains found for a domain",
        "operationId": "subdomains",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/ssl": {
      "get": {
        "summary": "Certificate chain, expiry and issuer",
        "operationId": "ssl",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/headers": {
      "get": {
        "summary": "HTTP security headers",
        "operationId": "headers",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "https://example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/tech": {
      "get": {
        "summary": "Technology stack detection",
        "operationId": "tech",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/redirects": {
      "get": {
        "summary": "Redirect chain",
        "operationId": "redirects",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "http://example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/ports": {
      "get": {
        "summary": "Common web ports, open or filtered",
        "operationId": "ports",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/latency": {
      "get": {
        "summary": "TCP connect time, 5 handshakes from our edge",
        "operationId": "latency",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          },
          {
            "name": "port",
            "in": "query",
            "required": false,
            "description": "One of 21, 22, 25, 53, 80, 110, 143, 443, 465, 587, 993, 995, 3306, 5432, 8080, 8443. Default 443.",
            "schema": {
              "type": "string"
            },
            "example": "443"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/blacklist": {
      "get": {
        "summary": "IP or domain on DNS blocklists",
        "operationId": "blacklist",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8.8.8.8"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/ip": {
      "get": {
        "summary": "IP details and reverse DNS",
        "operationId": "ip",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "8.8.8.8"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/asn": {
      "get": {
        "summary": "Autonomous system and ISP",
        "operationId": "asn",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "AS15169"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/mac": {
      "get": {
        "summary": "Vendor lookup for a MAC address",
        "operationId": "mac",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "00:1A:2B:3C:4D:5E"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/phishing": {
      "get": {
        "summary": "Phishing signals for a URL",
        "operationId": "phishing",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "https://example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/breach": {
      "get": {
        "summary": "Known breaches for a domain or email (query also works)",
        "operationId": "breach",
        "tags": [
          "Lookups"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          }
        ],
        "responses": {
          "200": {
            "description": "Result. The shape depends on the tool.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Missing, malformed or revoked key"
          },
          "429": {
            "description": "Rate limit. See Retry-After."
          }
        }
      }
    },
    "/api/v1/ci": {
      "get": {
        "summary": "CI gate: 200 if the domain passes, 422 if a check fails",
        "tags": [
          "CI"
        ],
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "description": "Required.",
            "schema": {
              "type": "string"
            },
            "example": "example.com"
          },
          {
            "name": "min_ssl_days",
            "in": "query",
            "required": false,
            "description": "Fail if the certificate expires sooner. 0 to 365, default 14.",
            "schema": {
              "type": "string"
            },
            "example": "14"
          },
          {
            "name": "require",
            "in": "query",
            "required": false,
            "description": "Comma list of record types that must exist. Default A,MX.",
            "schema": {
              "type": "string"
            },
            "example": "A,MX"
          },
          {
            "name": "unknown",
            "in": "query",
            "required": false,
            "description": "Set to fail to treat inconclusive checks as failures.",
            "schema": {
              "type": "string"
            },
            "example": "fail"
          }
        ],
        "responses": {
          "200": {
            "description": "Passed"
          },
          "400": {
            "description": "Bad input"
          },
          "401": {
            "description": "Bad key"
          },
          "422": {
            "description": "A check failed"
          }
        }
      }
    },
    "/api/v1/tools": {
      "get": {
        "summary": "List the available tools (no key needed)",
        "tags": [
          "Meta"
        ],
        "responses": {
          "200": {
            "description": "Tool list"
          }
        }
      }
    }
  }
}