# Hreflang & Sitemap Audit

**Use case:** 

Audit the hreflang tags, canonicals and XML sitemap of a multilingual site (mozilla.org): invalid language codes, missing x-default and return links, sitemap URLs that error or redirect, and crawled pages missing from the sitemap. Replace the URL with your own site; the example checks up to 30 pages.

## Input

```json
{
  "urls": [
    "https://www.mozilla.org/en-US/"
  ],
  "crawlScope": "host",
  "maxPages": 30,
  "maxDepth": 3,
  "mode": "auto",
  "useSitemap": true,
  "respectRobotsTxt": false,
  "checkImages": false,
  "validateStructuredData": true,
  "maxConcurrency": 10,
  "pagespeed": false,
  "pagespeedStrategy": "mobile",
  "pagespeedSource": "auto",
  "pagespeedMaxPages": 5,
  "compareWithPrevious": false,
  "httpVia": "auto",
  "pageTimeoutSecs": 120
}
```

## Output

```json
{
  "url": {
    "label": "URL",
    "format": "link"
  },
  "httpStatus": {
    "label": "Http status"
  },
  "finalUrl": {
    "label": "Final URL",
    "format": "link"
  },
  "redirects": {
    "label": "Redirects"
  },
  "responseMs": {
    "label": "Response ms"
  },
  "canonical": {
    "label": "Canonical",
    "format": "link"
  },
  "metaRobots": {
    "label": "Meta robots"
  },
  "xRobotsTag": {
    "label": "X robots tag"
  },
  "blockedByRobotsTxt": {
    "label": "Blocked by robots txt"
  },
  "inSitemap": {
    "label": "In sitemap"
  },
  "viewport": {
    "label": "Viewport"
  },
  "lang": {
    "label": "Lang"
  },
  "bytes": {
    "label": "Bytes"
  },
  "depth": {
    "label": "Depth"
  },
  "via": {
    "label": "Via"
  }
}
```

## How it works

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

The SEO Audit Tool - SEO Checker, Site Audit & Core Web Vitals Actor is ready to run with the inputs already set for "Hreflang & Sitemap Audit". [Sign up or log in](https://console.apify.com/create-task-from-example/gblgVmnBt9VTDae4S) and you'll land in Apify Console with a copy of this exact task.

### 2. Start the "Hreflang & Sitemap Audit" task

The SEO Audit Tool - SEO Checker, Site Audit & Core Web Vitals Actor will start running based on the input automatically. You can also change all the input fields, like URLs or domains, crawl scope, and more, to match your specific use case.

### 3. Receive the "Hreflang & Sitemap Audit" 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, http status, final url, 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 "Hreflang & Sitemap Audit" task via API](https://apify.com/tidytools/seo-audit-crawler.md).

## About this Actor

This example demonstrates how to use [SEO Audit Tool - SEO Checker, Site Audit & Core Web Vitals](https://apify.com/tidytools/seo-audit-crawler.md) with a specific input configuration. Visit the [Actor detail page](https://apify.com/tidytools/seo-audit-crawler.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/tidytools/seo-audit-crawler.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`).
