{"uid":"cap_XbB5Wm6-rHbnU2Cz6j7lH","slug":"402utils-sitemap-to-json-598b8d19","name":"402utils Sitemap to JSON","description":"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.","url":"https://402utils.com/v1/sitemap-to-json?utm_source=zero.xyz","method":"GET","headers":{},"bodySchema":{"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)."}}}}}}},"responseSchema":{"type":"json","example":{"url":"https://example.com/sitemap.xml","urls":[{"loc":"https://example.com/","lastmod":"2026-07-01","priority":1}],"truncated":false}},"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.003","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":{"p10Cents":"0.3000","medianCents":"0.3000","p90Cents":"0.3000","minCents":"0.3000","maxCents":"0.3000","p95Cents":"0.3000","sampleCount":1,"varies":false,"failureChargeRate":1},"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.003/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.003","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_HNKmrLSk1DNtn28KHcsUb","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.003","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"Fetches a sitemap.xml (including gzipped and indexed sitemaps) and returns a structured JSON list of URL entries with loc, lastmod, and priority fields","exampleAgentPrompt":"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.","exampleUseCases":null,"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-10-12T12:39:15.355Z","isFirstParty":false,"canonicalSlug":"402utils-sitemap-to-json-598b8d19"}