{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/karma-domains/main/json-schema/karma-domains-website-page-counter-response-schema-schema.json",
  "title": "WebsitePageCounterResponseSchema",
  "description": "Website Page Counter response schema",
  "x-generated": "2026-10-06",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/karma-domains-openapi.json#/components/schemas/WebsitePageCounterResponseSchema",
  "properties": {
    "domain": {
      "type": "string",
      "title": "Domain",
      "description": "Normalized domain"
    },
    "root_sitemap_url": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Root Sitemap Url",
      "description": "Root sitemap URL that was scanned"
    },
    "total_pages": {
      "type": "integer",
      "title": "Total Pages",
      "description": "Total unique page URLs found",
      "default": 0
    },
    "truncated": {
      "type": "boolean",
      "title": "Truncated",
      "description": "True when the 5000 URL limit was hit",
      "default": false
    },
    "sitemaps": {
      "items": {
        "$ref": "#/$defs/WebsitePageCounterSitemapSchema"
      },
      "type": "array",
      "title": "Sitemaps",
      "description": "Flat list of scanned sitemap files"
    },
    "urls": {
      "items": {
        "$ref": "#/$defs/WebsitePageCounterUrlSchema"
      },
      "type": "array",
      "title": "Urls",
      "description": "Collected page URLs (max 5000)"
    }
  },
  "type": "object",
  "required": [
    "domain"
  ],
  "$defs": {
    "WebsitePageCounterSitemapSchema": {
      "properties": {
        "url": {
          "type": "string",
          "title": "Url",
          "description": "Sitemap file URL"
        },
        "parent_url": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Parent Url",
          "description": "Parent sitemap index URL, if nested"
        },
        "kind": {
          "type": "string",
          "enum": [
            "index",
            "urlset"
          ],
          "title": "Kind",
          "description": "sitemapindex or urlset"
        },
        "page_count": {
          "type": "integer",
          "title": "Page Count",
          "description": "Number of page URLs in this file",
          "default": 0
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error",
          "description": "Fetch/parse error if any"
        }
      },
      "type": "object",
      "required": [
        "url",
        "kind"
      ],
      "title": "WebsitePageCounterSitemapSchema",
      "description": "One sitemap file in the scan tree"
    },
    "WebsitePageCounterUrlSchema": {
      "properties": {
        "loc": {
          "type": "string",
          "title": "Loc",
          "description": "Page URL from <loc>"
        },
        "lastmod": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Lastmod",
          "description": "lastmod value if present"
        },
        "sitemap_url": {
          "type": "string",
          "title": "Sitemap Url",
          "description": "Sitemap file this URL came from"
        }
      },
      "type": "object",
      "required": [
        "loc",
        "sitemap_url"
      ],
      "title": "WebsitePageCounterUrlSchema",
      "description": "Single page URL collected from a sitemap"
    }
  }
}