{
  "openapi": "3.0.3",
  "info": {
    "title": "WebPulse AI & SEO Suite API (All-in-One)",
    "version": "1.0.0",
    "description": "The ultimate 5-in-1 Web Extraction & Intelligence API for AI Agents (RAG/LLMs), n8n/Make/Zapier automations, SEO Agencies, and B2B Lead Generation. Convert any URL into clean AI-ready Markdown with token savings metrics, extract deep metadata & tech stack, run a 25-point Technical SEO Audit (0-100 score), and extract verified public emails, phones & social profiles."
  },
  "servers": [
    {
      "url": "https://webpulseapi.vercel.app",
      "description": "Production API Server (Vercel Global Edge)"
    }
  ],
  "paths": {
    "/api/v1/markdown": {
      "get": {
        "summary": "1. Convert URL to Clean AI-Ready Markdown & RAG Chunks",
        "description": "Strips ads, navigation, scripts, and clutter from any webpage and returns clean GitHub-Flavored Markdown, plain text, LLM token savings metrics, and semantic RAG chunks.",
        "operationId": "getMarkdown",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Target webpage URL to extract (e.g. https://example.com)",
            "schema": { "type": "string", "example": "https://en.wikipedia.org/wiki/Artificial_intelligence" }
          },
          {
            "name": "include_links",
            "in": "query",
            "required": false,
            "description": "Keep hyperlinks in the generated Markdown (default: true)",
            "schema": { "type": "boolean", "default": true }
          },
          {
            "name": "include_images",
            "in": "query",
            "required": false,
            "description": "Keep images in the generated Markdown (default: true)",
            "schema": { "type": "boolean", "default": true }
          },
          {
            "name": "include_chunks",
            "in": "query",
            "required": false,
            "description": "Include semantic chunks ready for RAG / Vector Databases (default: true)",
            "schema": { "type": "boolean", "default": true }
          },
          {
            "name": "chunk_size",
            "in": "query",
            "required": false,
            "description": "Maximum character size per RAG chunk (300 - 8000, default: 1500)",
            "schema": { "type": "integer", "default": 1500 }
          }
        ],
        "responses": {
          "200": {
            "description": "Clean Markdown, token savings metrics, and RAG chunks returned successfully."
          }
        }
      },
      "post": {
        "summary": "1. Convert URL to Clean AI-Ready Markdown (POST)",
        "description": "POST version accepting JSON body with url and extraction preferences.",
        "operationId": "postMarkdown",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": { "type": "string", "example": "https://example.com" },
                  "include_links": { "type": "boolean", "default": true },
                  "include_images": { "type": "boolean", "default": true },
                  "include_chunks": { "type": "boolean", "default": true },
                  "chunk_size": { "type": "integer", "default": 1500 }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Clean Markdown returned successfully."
          }
        }
      }
    },
    "/api/v1/metadata": {
      "get": {
        "summary": "2. Extract Deep Metadata, OpenGraph, Schema JSON-LD & Tech Stack",
        "description": "Extracts page title, meta description, canonical URL, author, dates, favicons, OpenGraph tags, Twitter Cards, Schema.org JSON-LD objects, RSS feeds, and detected CMS/technologies.",
        "operationId": "getMetadata",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Target webpage URL to inspect",
            "schema": { "type": "string", "example": "https://stripe.com" }
          }
        ],
        "responses": {
          "200": {
            "description": "Deep metadata and technology stack extracted successfully."
          }
        }
      },
      "post": {
        "summary": "2. Extract Deep Metadata & Tech Stack (POST)",
        "operationId": "postMetadata",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": { "type": "string", "example": "https://stripe.com" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Deep metadata extracted successfully."
          }
        }
      }
    },
    "/api/v1/seo-audit": {
      "get": {
        "summary": "3. Instant 25-Point Technical SEO Audit & Score (0-100)",
        "description": "Performs a real-time technical SEO audit checking Title, Meta Description, H1-H6 hierarchy, missing image alt tags, internal/external links, canonicals, indexability, OpenGraph, Schema.org, and response speed. Returns a 0-100 SEO Score, Grade, and prioritized recommendations.",
        "operationId": "getSeoAudit",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Target webpage URL to audit",
            "schema": { "type": "string", "example": "https://example.com" }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete SEO Audit report with 0-100 score and actionable recommendations."
          }
        }
      },
      "post": {
        "summary": "3. Instant 25-Point Technical SEO Audit (POST)",
        "operationId": "postSeoAudit",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": { "type": "string", "example": "https://example.com" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Complete SEO Audit report returned successfully."
          }
        }
      }
    },
    "/api/v1/contacts": {
      "get": {
        "summary": "4. Extract Public Emails, Phone Numbers, Social Profiles & Company Pages",
        "description": "Scans the target page for public business email addresses (classified into role-based vs direct), phone numbers, social media profiles (LinkedIn, X/Twitter, Instagram, Facebook, YouTube, TikTok, GitHub, WhatsApp, Telegram, Discord), and key corporate links (Contact, About, Pricing, Careers, Privacy).",
        "operationId": "getContacts",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Target company or website URL",
            "schema": { "type": "string", "example": "https://iana.org" }
          }
        ],
        "responses": {
          "200": {
            "description": "Extracted emails, phones, social profiles, and company links."
          }
        }
      },
      "post": {
        "summary": "4. Extract Public Emails, Phones & Social Profiles (POST)",
        "operationId": "postContacts",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": { "type": "string", "example": "https://iana.org" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Extracted contact intelligence returned successfully."
          }
        }
      }
    },
    "/api/v1/extract-all": {
      "get": {
        "summary": "5. All-in-One Super Endpoint (Markdown + Metadata + SEO Audit + Contacts)",
        "description": "Fetches the target URL once and runs all 4 extraction engines in parallel: Clean AI Markdown, Deep Metadata & Tech Stack, 25-Point SEO Audit, and B2B Contact Intelligence.",
        "operationId": "getExtractAll",
        "parameters": [
          {
            "name": "url",
            "in": "query",
            "required": true,
            "description": "Target webpage URL",
            "schema": { "type": "string", "example": "https://example.com" }
          }
        ],
        "responses": {
          "200": {
            "description": "Complete 4-in-1 intelligence bundle returned in a single call."
          }
        }
      },
      "post": {
        "summary": "5. All-in-One Super Endpoint (POST)",
        "operationId": "postExtractAll",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": ["url"],
                "properties": {
                  "url": { "type": "string", "example": "https://example.com" }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Complete 4-in-1 intelligence bundle returned successfully."
          }
        }
      }
    },
    "/api/v1/health": {
      "get": {
        "summary": "Health Check & Server Status",
        "description": "Returns uptime, status, and cache statistics.",
        "operationId": "getHealth",
        "responses": {
          "200": {
            "description": "API is healthy and online."
          }
        }
      }
    }
  }
}
