### Set Up Webmole CLI Monitoring Source: https://github.com/webmoleai/webmole-docs/blob/main/docs/quickstart.md This section details how to set up continuous monitoring of a website's AI readiness using the Webmole CLI. It includes installation, API key configuration, and initiating a watch command with a specified interval. ```bash npm install -g @webmole/cli webmole config set key wbm_your_api_key webmole watch https://your-site.com --interval 6h ``` -------------------------------- ### Apply Fixes with Code Block Source: https://github.com/webmoleai/webmole-docs/blob/main/docs/quickstart.md This example shows the structure of a fix suggestion returned by the API. It includes an 'instruction' detailing the necessary action and a 'codeBlock' containing the actual code snippet to be implemented, such as adding schema markup. ```json { "instruction": "Add FAQ schema to your page", "codeBlock": "" ``` -------------------------------- ### Start WebMole MCP Server (Bash) Source: https://github.com/webmoleai/webmole-docs/blob/main/llms-full.txt This command uses npx to execute the webmole-mcp package, starting a server that wraps the WebMole API for use in MCP clients. It exposes various tools for auditing and comparison. ```bash npx -y webmole-mcp ``` -------------------------------- ### Bash: WebMole CLI Installation and Usage Source: https://context7.com/webmoleai/webmole-docs/llms.txt Commands for installing and using the WebMole CLI. Includes instructions for global installation, API key configuration, running basic audits, setting CI/CD thresholds, and continuous monitoring with watch mode. ```bash # Install the CLI globally npm install -g @webmole/cli # Configure your API key webmole config set key wbm_your_api_key # Run a basic audit webmole audit https://your-site.com # CI/CD gate — exit code 1 if score below threshold webmole audit https://your-site.com --threshold 70 # Continuous monitoring with 6-hour intervals webmole watch https://your-site.com --interval 6h # Watch mode with JSON output for parsing webmole watch https://your-site.com --interval 6h --json ``` -------------------------------- ### POST /api/v1/audit Source: https://github.com/webmoleai/webmole-docs/blob/main/docs/quickstart.md Triggers an AI citation readiness audit for a specified URL and returns a score along with actionable optimization suggestions. ```APIDOC ## POST /api/v1/audit ### Description Initiates an automated audit of a website to determine its AI citation readiness. The response includes an overall score, detailed factor checks, and specific code-based fix suggestions. ### Method POST ### Endpoint https://webmole.ai/api/v1/audit ### Parameters #### Request Body - **url** (string) - Required - The fully qualified URL of the website to audit. ### Request Example { "url": "https://your-site.com" } ### Response #### Success Response (200) - **score** (integer) - Overall AI citation readiness score (0-100). - **factors** (array) - List of 12 individual checks with pass/fail status. - **fixSuggestions** (array) - List of prioritized fixes containing instructions and code blocks. #### Response Example { "score": 75, "factors": [{"name": "schema_markup", "status": "pass"}], "fixSuggestions": [ { "instruction": "Add FAQ schema to your page", "codeBlock": "" } ] } ``` -------------------------------- ### CI/CD Gate with Webmole CLI Source: https://github.com/webmoleai/webmole-docs/blob/main/docs/quickstart.md This snippet illustrates how to integrate Webmole AI audits into a CI/CD pipeline as a gate. It shows a command that performs an audit and exits with a non-zero status code if the website's score falls below a defined threshold, preventing deployment of non-compliant code. ```bash webmole audit https://your-site.com --threshold 70 # Exits with code 1 if score drops below 70 ``` -------------------------------- ### Create llms.txt for AI Discoverability Source: https://github.com/webmoleai/webmole-docs/blob/main/guides/aeo-for-nextjs.md This markdown snippet shows the content for a `public/llms.txt` file. This file helps AI models discover information about your product, including a one-line description, links to documentation, and guides. Customize the product name, description, and URLs to match your project. ```markdown # Your Product Name > One-line description of what you do. ## Docs - [API Reference](https://yoursite.com/docs) ## Guides - [Getting Started](https://yoursite.com/docs/quickstart) ``` -------------------------------- ### Bash: WebMole API Error Handling Examples Source: https://context7.com/webmoleai/webmole-docs/llms.txt Examples of structured error responses from the WebMole API, illustrating common error codes such as unauthorized access, invalid requests, rate limiting, and internal server errors. Also shows rate limit headers. ```bash # Error response format # HTTP 401 - Missing or invalid API key # { "error": { "code": "unauthorized", "message": "Invalid or missing API key." } } # HTTP 400 - Invalid URL # { "error": { "code": "invalid_url", "message": "\"url\" must be a valid URL (e.g., https://example.com)." } } # HTTP 429 - Rate limited # { "error": { "code": "rate_limited", "message": "Daily limit of 100 requests reached. Resets at 2026-03-18T00:00:00.000Z." } } # HTTP 500 - Internal error # { "error": { "code": "score_failed", "message": "Failed to analyze the page. Please try again." } } # Rate limit headers on all responses: # X-RateLimit-Limit: 100 # X-RateLimit-Remaining: 99 # X-RateLimit-Reset: 2026-03-18T00:00:00.000Z ``` -------------------------------- ### Implement Meta Tag Fix Source: https://github.com/webmoleai/webmole-docs/blob/main/docs/api-reference.md Example HTML meta tag implementation suggested by the API to resolve missing meta description issues. ```HTML ``` -------------------------------- ### Integrate WebMole API with Python Source: https://context7.com/webmoleai/webmole-docs/llms.txt This Python example uses the `requests` library to interact with the WebMole API. It demonstrates how to authenticate using an environment variable for the API key, retrieve audit results, print the score, and display prioritized fix suggestions. It also shows how to access the `codeBlock` for suggested fixes. ```python import os import requests API_KEY = os.environ.get("WEBMOLE_API_KEY", "wbm_your_api_key") def audit_url(url: str) -> dict: """Run an AEO audit on a URL. Returns score, factors, and fix suggestions.""" response = requests.post( "https://webmole.ai/api/v1/audit", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json", }, json={"url": url}, ) response.raise_for_status() return response.json() # Basic usage result = audit_url("https://example.com") print(f"Score: {result['score']}/100") # Print fix suggestions for fix in result["fixSuggestions"]: print(f"[{fix['impact']}] {fix['instruction']}") if fix.get("codeBlock"): print(f" Code: {fix['codeBlock'][:80]}...") ``` -------------------------------- ### TypeScript/React: Next.js JSON-LD Schema Integration Source: https://context7.com/webmoleai/webmole-docs/llms.txt Example code for integrating Organization and FAQPage JSON-LD schema markup into a Next.js application. This structured data enhances AI citation readiness by providing machine-readable information. ```tsx // src/app/layout.tsx — Add Organization schema const orgSchema = { '@context': 'https://schema.org', '@type': 'Organization', name: 'Your Company', url: 'https://yoursite.com', logo: 'https://yoursite.com/logo.png', } export default function RootLayout({ children }) { return (