{
  "openapi": "3.1.0",
  "info": {
    "title": "Robauto API",
    "description": "Public APIs for AI search traffic data and website AI-readiness scoring. No authentication required.",
    "version": "1.0.0",
    "contact": {
      "name": "Robauto Support",
      "email": "support@robauto.ai",
      "url": "https://robauto.ai/support"
    },
    "license": {
      "name": "Public",
      "url": "https://robauto.ai/privacy"
    }
  },
  "servers": [
    {
      "url": "https://hkeytqaukllckucnhzey.supabase.co/functions/v1",
      "description": "Production"
    }
  ],
  "paths": {
    "/ai-search-data": {
      "get": {
        "operationId": "getAISearchData",
        "summary": "Live AI search traffic data",
        "description": "Returns real-time aggregated AI crawler traffic across the Robauto network, updated hourly.\nIncludes engine breakdown (ChatGPT, Claude, Gemini, Perplexity, etc.), weekly trends,\nand direct traffic data. Send Accept: text/plain for plain-text output.\n",
        "responses": {
          "200": {
            "description": "AI search traffic summary",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "meta": {
                      "type": "object",
                      "properties": {
                        "source": { "type": "string" },
                        "updated": { "type": "string", "format": "date-time" },
                        "methodology": { "type": "string" }
                      }
                    },
                    "summary": {
                      "type": "object",
                      "properties": {
                        "total_views": { "type": "integer" },
                        "ai_views": { "type": "integer" },
                        "ai_pct": { "type": "number" }
                      }
                    },
                    "engine_breakdown": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "engine": { "type": "string" },
                          "pct": { "type": "number" },
                          "views": { "type": "integer" }
                        }
                      }
                    },
                    "weekly_trend": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "week": { "type": "string" },
                          "views": { "type": "integer" }
                        }
                      }
                    }
                  }
                }
              },
              "text/plain": {
                "schema": { "type": "string" }
              }
            }
          },
          "429": {
            "description": "Rate limited (30 requests per minute per IP)"
          }
        }
      }
    },
    "/scan-score": {
      "get": {
        "operationId": "getScanScore",
        "summary": "AI readiness score for any domain",
        "description": "Returns a 0-100 AI readiness baseline score for any domain. Checks robots.txt,\nsitemap.xml, llms.txt, llms-full.txt, security.txt, ai-plugin.json, structured data,\nmeta tags, and page load time.\n",
        "parameters": [
          {
            "name": "domain",
            "in": "query",
            "required": true,
            "schema": { "type": "string" },
            "description": "The domain to scan (e.g. example.com)",
            "example": "robauto.ai"
          }
        ],
        "responses": {
          "200": {
            "description": "Scan score result",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "domain": { "type": "string" },
                    "score": { "type": "integer", "minimum": 0, "maximum": 100 },
                    "checks": {
                      "type": "object",
                      "properties": {
                        "title": {
                          "type": "object",
                          "properties": {
                            "value": { "type": "string" },
                            "length": { "type": "integer" },
                            "optimal": { "type": "boolean" }
                          }
                        },
                        "description": {
                          "type": "object",
                          "properties": {
                            "value": { "type": "string" },
                            "length": { "type": "integer" },
                            "optimal": { "type": "boolean" }
                          }
                        },
                        "structured_data": { "type": "boolean" },
                        "page_load_ms": { "type": "integer" },
                        "files": {
                          "type": "object",
                          "additionalProperties": { "type": "boolean" }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": { "description": "Missing domain parameter" },
          "429": { "description": "Rate limited (10 requests per minute per IP)" }
        }
      }
    }
  }
}
