{
  "openapi": "3.0.3",
  "info": {
    "title": "EurekaNav API",
    "version": "1.0.0",
    "description": "AI Visibility OS — Query verified tool facts, compare SaaS products across 6 AI engines, and check GEO (Answer Engine Optimization) readiness. All endpoints support anonymous access with rate limiting.",
    "contact": {
      "name": "EurekaNav Support",
      "email": "support@eurekanav.com",
      "url": "https://www.eurekanav.com"
    },
    "license": {
      "name": "Proprietary"
    }
  },
  "servers": [
    {
      "url": "https://www.eurekanav.com",
      "description": "Production"
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKeyHeader": {
        "type": "apiKey",
        "in": "header",
        "name": "X-API-Key",
        "description": "Optional API key for higher rate limits (120 req/min). Anonymous access: 30 req/min."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Bearer token prefixed with \"eak_\". Example: Authorization: Bearer eak_xxx"
      }
    },
    "schemas": {
      "Tool": {
        "type": "object",
        "properties": {
          "slug": {
            "type": "string",
            "example": "chatgpt"
          },
          "name": {
            "type": "string",
            "example": "ChatGPT"
          },
          "tagline": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "example": "AI Assistant"
          },
          "website": {
            "type": "string",
            "format": "uri"
          },
          "displayScore": {
            "type": "number",
            "nullable": true,
            "description": "Visibility score 0-100"
          },
          "geoScore": {
            "type": "number",
            "nullable": true,
            "description": "Raw GEO score (internal 6-18 scale; use displayScore for the public 0-100 Visibility Score)"
          },
          "geoVisibility": {
            "type": "string",
            "nullable": true,
            "enum": [
              "Critical",
              "Low",
              "Moderate",
              "High"
            ]
          }
        }
      },
      "RateLimitHeaders": {
        "type": "object",
        "properties": {
          "X-RateLimit-Limit": {
            "type": "string",
            "description": "Max requests per window"
          },
          "X-RateLimit-Remaining": {
            "type": "string",
            "description": "Requests remaining in current window"
          },
          "X-RateLimit-Reset": {
            "type": "string",
            "description": "Unix timestamp when window resets"
          },
          "Retry-After": {
            "type": "string",
            "description": "Seconds until retry (only on 429)"
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        }
      },
      "ApiMeta": {
        "type": "object",
        "description": "Standard response metadata included in all API responses",
        "properties": {
          "apiVersion": {
            "type": "string",
            "example": "1.0"
          },
          "schemaVersion": {
            "type": "string",
            "example": "1.0"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "source": {
            "type": "string",
            "example": "eurekanav.com"
          },
          "total": {
            "type": "integer"
          }
        }
      }
    },
    "responses": {
      "RateLimited": {
        "description": "Rate limit exceeded",
        "headers": {
          "Retry-After": {
            "description": "Seconds until the rate limit window resets",
            "schema": {
              "type": "integer"
            }
          }
        },
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            },
            "example": {
              "error": "Rate limit exceeded. Anonymous: 30 req/min. Use X-API-Key header for 120 req/min."
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "ApiKeyHeader": []
    },
    {
      "BearerAuth": []
    },
    {}
  ],
  "paths": {
    "/api/v1/tools": {
      "get": {
        "summary": "List AI tools",
        "description": "Paginated list of all verified AI tools. Filter by category, visibility, or keyword search.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "category",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Filter by category name (e.g., AI Assistant)"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 50
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tool list with pagination metadata",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tool"
                      }
                    },
                    "meta": {
                      "type": "object",
                      "properties": {
                        "total": {
                          "type": "integer"
                        },
                        "limit": {
                          "type": "integer"
                        },
                        "offset": {
                          "type": "integer"
                        },
                        "hasMore": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/tools/{slug}": {
      "get": {
        "summary": "Get tool details",
        "description": "Full details for a single tool including features, FAQ, pricing, and comparison data.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "example": "chatgpt"
          }
        ],
        "responses": {
          "200": {
            "description": "Tool details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Tool"
                }
              }
            }
          },
          "404": {
            "description": "Tool not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/geo-scores": {
      "get": {
        "summary": "GEO visibility scores",
        "description": "AI visibility scores across 6 engines. Filter by slug, visibility level, or score range.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "visibility",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "critical",
                "low",
                "moderate",
                "high"
              ]
            }
          },
          {
            "name": "sort",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "score_asc",
                "score_desc"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "GEO scores list"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/a2a": {
      "post": {
        "summary": "A2A JSON-RPC endpoint",
        "description": "Agent-to-Agent protocol endpoint (JSON-RPC 2.0). Supports: tool_get_facts, tool_search, tool_compare. Rate limited: 30 req/min anonymous, 120 req/min authenticated.",
        "tags": [
          "A2A Protocol"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "jsonrpc",
                  "method"
                ],
                "properties": {
                  "jsonrpc": {
                    "type": "string",
                    "enum": [
                      "2.0"
                    ]
                  },
                  "id": {
                    "oneOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "integer"
                      }
                    ]
                  },
                  "method": {
                    "type": "string",
                    "enum": [
                      "tool_get_facts",
                      "tool_search",
                      "tool_compare",
                      "tasks/send"
                    ]
                  },
                  "params": {
                    "type": "object"
                  }
                }
              },
              "examples": {
                "tool_get_facts": {
                  "summary": "Get facts about ChatGPT",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 1,
                    "method": "tool_get_facts",
                    "params": {
                      "slug": "chatgpt"
                    }
                  }
                },
                "tool_search": {
                  "summary": "Search for AI writing tools",
                  "value": {
                    "jsonrpc": "2.0",
                    "id": 2,
                    "method": "tool_search",
                    "params": {
                      "q": "writing",
                      "limit": 5
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "JSON-RPC 2.0 response (success or application error)"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/.well-known/agent-card.json": {
      "get": {
        "summary": "A2A Agent Card discovery",
        "description": "RFC 8615 discovery endpoint. Declares agent identity, capabilities, and available skills.",
        "tags": [
          "A2A Protocol"
        ],
        "responses": {
          "200": {
            "description": "Agent Card JSON"
          }
        }
      }
    },
    "/api/v1/categories": {
      "get": {
        "summary": "List tool categories",
        "description": "Returns all categories with tool counts, derived from verified (Ready) tools.",
        "tags": [
          "REST API"
        ],
        "responses": {
          "200": {
            "description": "Category list with tool counts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "slug": {
                            "type": "string"
                          },
                          "toolCount": {
                            "type": "integer"
                          },
                          "tools": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "First 5 tool slugs as preview"
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ApiMeta"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/api/v1/changes": {
      "get": {
        "summary": "Recent data changes",
        "description": "Returns recently updated tools — score changes, status promotions, and data updates.",
        "tags": [
          "REST API"
        ],
        "parameters": [
          {
            "name": "days",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 7,
              "maximum": 30
            },
            "description": "Lookback period in days"
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "default": 20,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Recent changes list",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "data": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "slug": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "updatedAt": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "qualityStatus": {
                            "type": "string",
                            "nullable": true
                          },
                          "displayScore": {
                            "type": "number",
                            "nullable": true
                          }
                        }
                      }
                    },
                    "meta": {
                      "$ref": "#/components/schemas/ApiMeta"
                    }
                  }
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        }
      }
    },
    "/.well-known/security.txt": {
      "get": {
        "summary": "Security contact (RFC 9116)",
        "description": "Vulnerability reporting contact information.",
        "tags": [
          "Machine-Readable"
        ],
        "responses": {
          "200": {
            "description": "Security contact file",
            "content": {
              "text/plain": {}
            }
          }
        }
      }
    },
    "/llms.txt": {
      "get": {
        "summary": "LLMs context file",
        "description": "Machine-readable context file following the llms.txt spec. Helps LLMs understand EurekaNav's content and capabilities.",
        "tags": [
          "Machine-Readable"
        ],
        "responses": {
          "200": {
            "description": "Plain text context file",
            "content": {
              "text/plain": {}
            }
          }
        }
      }
    }
  }
}