{
 "openapi": "3.1.0",
 "info": {
  "title": "AI visibility checker API",
  "version": "1.0.0",
  "description": "Free, no-auth, CORS-open (access-control-allow-origin: *) endpoints that check a site's AI-crawler access, generate or validate an llms.txt, and lint a robots.txt for AI-crawler-specific mistakes. No API key and no rate limit enforced today; be a good citizen. A paid bulk/webhook tier is planned but not built - see /for-agents and GET /api/monitor.",
  "contact": {
   "name": "Reese Calder",
   "url": "https://lastminutedealshq.com/about"
  },
  "license": {
   "name": "API endpoints: no separate license, use them. /data/census.json: CC BY 4.0."
  }
 },
 "servers": [
  {
   "url": "https://ai-visibility.lastminutedealshq.com"
  }
 ],
 "paths": {
  "/check": {
   "get": {
    "summary": "Check a site's AI search visibility",
    "description": "Fetches the site's robots.txt, homepage and llms.txt live and reports which AI crawlers (OAI-SearchBot, PerplexityBot, GPTBot, ClaudeBot and 16 more) are allowed, whether the homepage ships readable text without JavaScript, and whether an llms.txt exists.",
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      },
      "description": "A site to check, e.g. example.com or https://example.com"
     }
    ],
    "responses": {
     "200": {
      "description": "Check result",
      "content": {
       "application/json": {
        "example": {
         "site": "https://example.com",
         "verdict": "Solid. AI search crawlers can reach you and your homepage is readable.",
         "problems": [],
         "checks": {
          "crawler_access": {
           "robots_status": 200,
           "robots_readable": true,
           "blocked_search_count": 0
          },
          "readable_content": {
           "readable": true,
           "text_chars": 4200
          },
          "llms_txt": {
           "present": false
          }
         }
        }
       }
      }
     },
     "400": {
      "description": "Missing ?url="
     }
    }
   }
  },
  "/api/llms-txt/generate": {
   "get": {
    "summary": "Generate an llms.txt from a site's real pages and sitemap",
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     },
     {
      "name": "credit",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "0"
       ]
      },
      "description": "credit=0 omits the one-line attribution back to this tool that is included by default."
     },
     {
      "name": "format",
      "in": "query",
      "schema": {
       "type": "string",
       "enum": [
        "txt"
       ]
      },
      "description": "format=txt returns the raw llms.txt file instead of a JSON wrapper."
     }
    ],
    "responses": {
     "200": {
      "description": "Generated file plus notes",
      "content": {
       "application/json": {
        "example": {
         "site": "https://example.com",
         "title": "Example",
         "links": 12,
         "llms_txt": "# Example\n\n> ...\n"
        }
       }
      }
     }
    }
   }
  },
  "/api/llms-txt/validate": {
   "get": {
    "summary": "Validate an existing llms.txt against the spec",
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Pass/warn/fail checks",
      "content": {
       "application/json": {
        "example": {
         "site": "https://example.com",
         "present": true,
         "fails": 0,
         "warns": 1
        }
       }
      }
     }
    }
   }
  },
  "/api/robots-lint": {
   "get": {
    "summary": "Lint a site's robots.txt for AI-crawler-specific mistakes",
    "parameters": [
     {
      "name": "url",
      "in": "query",
      "required": true,
      "schema": {
       "type": "string"
      }
     }
    ],
    "responses": {
     "200": {
      "description": "Lint result"
     }
    }
   },
   "post": {
    "summary": "Lint a pasted robots.txt without fetching a site",
    "requestBody": {
     "required": true,
     "content": {
      "text/plain": {
       "schema": {
        "type": "string"
       }
      }
     }
    },
    "responses": {
     "200": {
      "description": "Lint result"
     }
    }
   }
  },
  "/data/census.json": {
   "get": {
    "summary": "The full 5,000-site robots.txt AI-crawler-access census, CC BY 4.0",
    "responses": {
     "200": {
      "description": "Census JSON"
     }
    }
   }
  },
  "/api/monitor": {
   "get": {
    "summary": "Planned paid bulk/webhook monitoring tier - not built yet",
    "description": "Always returns 402 today. A hit here is logged and is the signal that unparks building this tier.",
    "responses": {
     "402": {
      "description": "Payment required - preview only, nothing to buy yet"
     }
    }
   }
  }
 }
}