# Extract URLs from XML and gzip sitemaps

**Use case:** 

Discovers sitemaps from robots.txt and standard paths, recursively traverses nested sitemapindex trees, and decompresses .xml.gz sitemaps under strict memory ceilings at 256MB RAM.

## Input

```json
{
  "startUrls": [
    "https://docs.apify.com"
  ],
  "maxPages": 5,
  "discoverFromSitemap": true,
  "discoverFromLinks": false,
  "includeAiReadiness": false,
  "maxSitemapUrls": 500,
  "checkBrokenLinks": false,
  "concurrency": 5,
  "requestTimeoutMs": 8000
}
```

## Output

```json
{
  "url": {
    "label": "URL",
    "format": "string"
  },
  "status": {
    "label": "Status",
    "format": "string"
  },
  "httpStatus": {
    "label": "HTTP",
    "format": "integer"
  },
  "seoScore": {
    "label": "SEO Score",
    "format": "integer"
  },
  "issueCounts": {
    "label": "Issues",
    "format": "object"
  },
  "title": {
    "label": "Title",
    "format": "object"
  },
  "canonical": {
    "label": "Canonical",
    "format": "object"
  },
  "headings": {
    "label": "Headings",
    "format": "object"
  },
  "images": {
    "label": "Images",
    "format": "object"
  },
  "structuredData": {
    "label": "JSON-LD",
    "format": "object"
  },
  "redirectCount": {
    "label": "Redirects",
    "format": "integer"
  },
  "ttfbMs": {
    "label": "TTFB (ms)",
    "format": "integer"
  },
  "error": {
    "label": "Error",
    "format": "string"
  }
}
```

## How it works

### 1. Sign up on Apify or log in

The Technical SEO, Sitemap & llms.txt AI Auditor (MCP) Actor is ready to run with the inputs already set for "Extract URLs from XML and gzip sitemaps". [Sign up or log in](https://console.apify.com/create-task-from-example/EQurkembAT6ibC7Dk) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Extract URLs from XML and gzip sitemaps" task

The Technical SEO, Sitemap & llms.txt AI Auditor (MCP) Actor will start running based on the input automatically. You can also change all the input fields, like start urls, max pages, and more, to match your specific use case.

### 3. Receive the "Extract URLs from XML and gzip sitemaps" output

Monitor the progress in real time. You will be notified as soon as your dataset is complete and ready for review. Each result includes data such as URL, status, HTTP, and more.

### 4. Integrate into your workflow

The final output is delivered in JSON, CSV, or Excel format, ready to be plugged into your workflow. You can also [run the "Extract URLs from XML and gzip sitemaps" task via API](https://apify.com/salmon_chaparral/seo-llms-auditor.md).

## FAQ

### Does the XML sitemap extractor handle gzipped .xml.gz files?

Yes. The XML sitemap URL extractor decompresses .xml.gz sitemaps with node:zlib under a 15 MiB ceiling and handles nested sitemapindex trees automatically.

### How does the extractor find sitemaps automatically?

The XML sitemap URL extractor reads Sitemap directives from /robots.txt and checks /sitemap.xml and /sitemap_index.xml without requiring exact sitemap URLs.

### What happens if a site has malformed XML or plain-text sitemaps?

The XML sitemap URL extractor tolerates namespaces, CDATA, plain-text URL lists, and RSS/Atom feeds while rejecting HTML soft-404 responses cleanly.

## About this Actor

This example demonstrates how to use [Technical SEO, Sitemap & llms.txt AI Auditor (MCP)](https://apify.com/salmon_chaparral/seo-llms-auditor.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/salmon_chaparral/seo-llms-auditor.md) to learn more, explore other use cases, and run it yourself.


## How to integrate an Actor?

This Task's input is already configured above. Use it as-is rather than inventing a new one.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For full API examples (JavaScript, Python, CLI, MCP, OpenAPI), see this Task's Actor page: https://apify.com/salmon_chaparral/seo-llms-auditor.md

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).
