{
  "openapi": "3.1.0",
  "info": {
    "title": "GeoFN API",
    "description": "Generative Engine Optimization (GEO) technical audit, crawler governance, and AI Search citation probing APIs.",
    "version": "1.0.0",
    "contact": {
      "name": "GeoFN Engineering",
      "url": "https://geofn.com",
      "email": "support@geofn.com"
    },
    "license": {
      "name": "MIT",
      "url": "https://github.com/geofn-com/geofn"
    }
  },
  "servers": [
    {
      "url": "https://geofn.com/api",
      "description": "Production Server"
    }
  ],
  "paths": {
    "/health": {
      "get": {
        "summary": "Service health check",
        "description": "Returns operational health and availability status of the GeoFN API.",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "Service is operational",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "string",
                      "example": "pass"
                    },
                    "service": {
                      "type": "string",
                      "example": "geofn-api"
                    },
                    "version": {
                      "type": "string",
                      "example": "0.1.0"
                    },
                    "timestamp": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "required": [
                    "status",
                    "service"
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/audit": {
      "post": {
        "summary": "Run fast deterministic GEO technical audit",
        "description": "Inspects target domain for AI retrieval crawlers (robots.txt), semantic manifest (/llms.txt), and Schema.org structured data.",
        "operationId": "runAudit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "domain": {
                    "type": "string",
                    "description": "Fully-qualified public domain name to audit",
                    "example": "example.com"
                  }
                },
                "required": [
                  "domain"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful audit report",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": {
                      "type": "string"
                    },
                    "healthScore": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 100
                    },
                    "robotsStatus": {
                      "type": "string",
                      "enum": [
                        "pass",
                        "warn",
                        "fail"
                      ]
                    },
                    "llmsTxtStatus": {
                      "type": "string",
                      "enum": [
                        "pass",
                        "warn",
                        "fail"
                      ]
                    },
                    "jsonLdDetected": {
                      "type": "boolean"
                    },
                    "summary": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid domain parameter or SSRF rejection"
          },
          "429": {
            "description": "Rate limit exceeded"
          },
          "500": {
            "description": "Internal audit execution error"
          }
        }
      }
    },
    "/probe": {
      "post": {
        "summary": "Run GEO AI search lens probe",
        "description": "Executes real-time multi-model search probing for citations, competitor win-rates, and brand visibility.",
        "operationId": "runProbe",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "targetDomain": {
                    "type": "string",
                    "example": "stripe.com"
                  },
                  "keyword": {
                    "type": "string",
                    "example": "best developer billing platform"
                  },
                  "countryCode": {
                    "type": "string",
                    "default": "us"
                  }
                },
                "required": [
                  "targetDomain",
                  "keyword"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Probe result or SSE stream"
          },
          "400": {
            "description": "Missing parameters"
          },
          "429": {
            "description": "Quota exhausted or rate limited"
          }
        }
      }
    }
  }
}