{
  "openapi": "3.1.0",
  "info": {
    "title": "cyber-tool.org API",
    "description": "Free, privacy-first cybersecurity and network diagnostics API for developers and autonomous AI agents. Supports IP geolocation, DNS resolution, SSL inspection, HTTP security headers auditing, and real-time webhook inspection.",
    "version": "1.0.0",
    "contact": {
      "name": "cyber-tool.org Support",
      "url": "https://cyber-tool.org"
    }
  },
  "servers": [
    {
      "url": "https://cyber-tool.org",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/api/v1/ip": {
      "get": {
        "summary": "IP & Geolocation Lookup",
        "operationId": "lookupIp",
        "description": "Look up IP address details, country, city, coordinates, ISP, ASN, and reverse DNS.",
        "parameters": [
          {
            "name": "ip",
            "in": "query",
            "description": "IPv4, IPv6 address or hostname. If omitted, uses the client IP.",
            "required": false,
            "schema": {
              "type": "string",
              "example": "1.1.1.1"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful IP lookup",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ip": { "type": "string" },
                    "queryHost": { "type": "string" },
                    "hostname": { "type": "string", "nullable": true },
                    "city": { "type": "string" },
                    "region": { "type": "string" },
                    "country": { "type": "string" },
                    "countryCode": { "type": "string" },
                    "isp": { "type": "string" },
                    "org": { "type": "string" },
                    "as": { "type": "string" },
                    "lat": { "type": "number" },
                    "lon": { "type": "number" },
                    "timezone": { "type": "string" }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/dns": {
      "get": {
        "summary": "DNS Records Lookup",
        "operationId": "resolveDns",
        "description": "Fetch live authoritative DNS records (A, AAAA, MX, TXT, SPF, NS, CNAME, SOA, CAA) for a domain.",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "description": "Domain name to resolve (e.g. example.com)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "google.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "DNS records retrieved successfully"
          }
        }
      }
    },
    "/api/v1/ssl": {
      "get": {
        "summary": "SSL/TLS Certificate Checker",
        "operationId": "checkSsl",
        "description": "Inspect SSL/TLS certificate validity, issuer, SANs, days remaining, cipher, and expiration.",
        "parameters": [
          {
            "name": "target",
            "in": "query",
            "description": "Hostname or domain name to check (e.g. github.com)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "github.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "SSL certificate information"
          }
        }
      }
    },
    "/api/v1/headers": {
      "get": {
        "summary": "Security Headers Auditor",
        "operationId": "auditSecurityHeaders",
        "description": "Audit HTTP security headers (HSTS, CSP, X-Frame-Options, Permissions-Policy) and score from A+ to F.",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "description": "Target website URL (e.g. https://example.com)",
            "required": true,
            "schema": {
              "type": "string",
              "example": "https://example.com"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Security headers audit result"
          }
        }
      }
    },
    "/api/v1/bin/create": {
      "post": {
        "summary": "Create Live Webhook Receiver",
        "operationId": "createWebhookBin",
        "description": "Create an ephemeral HTTP request bin URL to capture webhooks and SSRF payloads in real time.",
        "responses": {
          "200": {
            "description": "Webhook endpoint created"
          }
        }
      }
    }
  }
}
