---
title: "Fetch and parse an XML sitemap"
method: POST
path: "/sitemap-extract.php"
tags: ["data"]
---

# Fetch and parse an XML sitemap

`POST /sitemap-extract.php`

## Request

- Base URL: `https://mate.tools/api/v1`
- URL: `https://mate.tools/api/v1/sitemap-extract.php`
- Auth: none declared

Fetches and parses a sitemap or sitemap index from a public HTTPS URL, or accepts pasted XML. SSRF-protected: rejects private, loopback, link-local and cloud-metadata IPs (each redirect is re-validated). Optional recursive expansion of sub-sitemaps (capped at 50). Returns lastmod/changefreq/priority metadata when present.

## Request body

- object
  - `url` string
  - `xml` string
  - `recursive` boolean
  - `max_sub_sitemaps` integer
  - `include_metadata` boolean
  - `max_urls` integer

## Response `200`

Success

## Other responses

- `400`: Malformed request
- `422`: Invalid XML
- `429`: Rate limit exceeded (60/min, 600/hour per IP). Includes Retry-After header.
- `502`: Fetch failed (network, timeout, non-200 response)

---

[API](https://skmtc.dev/mate/apis/mate-tools-api.md) · [All operations](https://skmtc.dev/mate/apis/mate-tools-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mate/apis/mate-tools-api/revisions/874670b78962?raw)
