# 402utils Sitemap to JSON

> 402utils Sitemap to JSON is a paid API for AI agents from 402utils.com, paid per call via x402, $0.003/call, status unknown (last checked 2026-10-12).

Fetches a sitemap.xml (including gzipped and indexed sitemaps) and returns a structured JSON list of URL entries with loc, lastmod, and priority fields

## Facts

- Endpoint: GET https://402utils.com/v1/sitemap-to-json?utm_source=zero.xyz
- Price: $0.003/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-12
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/402utils-sitemap-to-json-598b8d19
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_XbB5Wm6-rHbnU2Cz6j7lH

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability 402utils-sitemap-to-json-598b8d19
```

Example prompt: Can you fetch the sitemap at https://example.com/sitemap.xml and give me a clean JSON list of all the URLs in it, including their lastmod dates and priorities? Also expand any child sitemaps if it turns out to be a sitemap index.

## When to prefer this

Use this endpoint when you need to programmatically parse any sitemap.xml (plain, gzipped, or sitemap index) into structured JSON without running your own XML parser. Especially useful when you want to enumerate all pages of a site, check lastmod timestamps for freshness monitoring, or expand a multi-level sitemap index in a single API call. Prefer it over general-purpose web scraping when the site already publishes a sitemap.

## Known failure modes

- Invalid or unreachable sitemap URL returns an error response
- SSRF-blocked private/internal IP URLs are rejected
- Documents exceeding 10 MB per file are refused
- More than 50,000 URLs causes truncation with truncated=true flag
- Malformed XML or non-sitemap content causes parse failure
- Gzip bombs or malformed .gz files are rejected by magic-byte guard
- Child sitemaps that fail to fetch when follow=1 increment childErrors and are skipped

## How this service works

Turn any sitemap.xml into clean JSON: URL entries with loc, lastmod and priority, plus sitemap-index detection with the child sitemap list. Handles gzipped .gz sitemaps (magic-byte detection, zip-bomb guarded) and namespaced XML; pass follow=1 to also expand up to 3 child sitemaps of an index in one call. SSRF-checked fetches, 10 MB per document, up to 50,000 URLs with a truncated flag.

## Output

Returns a JSON object with the requested sitemap URL, an array of URL entries (each with loc, optional lastmod, and optional priority), a truncated boolean flag (true if the 50,000-URL cap was hit), a childSitemaps array if the target was a sitemap index, and a childErrors count when follow=1 was used.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "url"
     ],
     "properties": {
      "url": {
       "type": "string",
       "format": "uri",
       "description": "Public http(s) URL of a sitemap.xml, sitemap index, or gzipped .gz sitemap (required)."
      },
      "follow": {
       "enum": [
        "0",
        "1"
       ],
       "type": "string",
       "default": "0",
       "description": "\"1\" → when the target is a sitemap index, also fetch its first 3 child sitemaps and aggregate their URLs."
      }
     },
     "description": "Query string only."
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "url",
      "urls",
      "truncated"
     ],
     "properties": {
      "url": {
       "type": "string",
       "description": "The requested sitemap URL."
      },
      "urls": {
       "type": "array",
       "items": {
        "type": "object",
        "required": [
         "loc"
        ],
        "properties": {
         "loc": {
          "type": "string"
         },
         "lastmod": {
          "type": "string",
          "description": "Raw <lastmod> value (not normalised)."
         },
         "priority": {
          "type": "number"
         }
        }
       }
      },
      "truncated": {
       "type": "boolean",
       "description": "True when the 50,000-URL cap was hit."
      },
      "childErrors": {
       "type": "integer",
       "description": "With follow=1: number of child sitemaps that failed to fetch or parse (skipped)."
      },
      "childSitemaps": {
       "type": "array",
       "items": {
        "type": "string"
       },
       "description": "Present when the target is a sitemap index: ALL child sitemap URLs (fetched or not)."
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "url": "https://example.com/sitemap.xml",
  "urls": [
   {
    "loc": "https://example.com/",
    "lastmod": "2026-07-01",
    "priority": 1
   }
  ],
  "truncated": false
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/402utils-sitemap-to-json-598b8d19/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from 402utils.com](https://www.zero.xyz/host/402utils.com/llms.txt)
