> ## Documentation Index
> Fetch the complete documentation index at: https://docs.frontic.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch a Sitemap

Fetch a [Sitemap](https://docs.frontic.com/api-builder/pages.md#sitemaps) for your project. Frontic resolves the URL against your domain mappings to determine the scope, region, and locale, and returns a sitemap in the correct language.

Frontic will split up sitemaps, if they are over 50 MB or contain more than 50,000 URLs. The endpoint will then return a sitemap index with links to deeper sitemaps.

## Access Convention

Frontic expects your frontend to have a global route like `/sitemap{index}.xml` with an optional index (so both `/sitemap.xml` and `/sitemap23.xml` match), since Frontic links to nested sitemaps with your configured Frontic project domains (e.g. `demo-shop.com/uk/sitemap1.xml`). The [Nuxt module](https://docs.frontic.com/reference/nuxt-module.md#sitemap) registers this route for you.

You can of course include the Frontic sitemap in your global sitemap along with your other (non-Frontic) URLs.

## Path Parameters

**project-token** `string` *required*

Your project's Fetch token, embedded in the subdomain.

**index** `number`

The index of a nested sitemap (only if the sitemap was split up).

## Headers

See [Headers](https://docs.frontic.com/reference/fetch-api.md#headers) on the overview for the full set. The `fs-domain` header indicates the requested sitemap domain. The sitemap endpoint also uses `fs-context`, `fs-version`, and `fs-secret` (only when the project has fetch keys configured).

## Response

Returns the Sitemap XML, or 404 if there is no sitemap for your project.

```bash curl theme={"theme":"css-variables"}
curl 'https://fetch-<project-token>.frontic.com/sitemap.xml'
```

```xml 200 OK (full sitemap) theme={"theme":"css-variables"}
<?xml version="1.0" encoding="UTF-8"?>
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
    <url>
        <loc>https://demo-shop.com/uk/clothing</loc>
        <lastmod>2026-01-01T00:00:00Z</lastmod>
    </url>
    <url>
        <loc>https://demo-shop.com/uk/clothing/shorts</loc>
        <lastmod>2026-01-01T00:00:00Z</lastmod>
    </url>
</urlset>
```

```xml 200 OK (split sitemap) theme={"theme":"css-variables"}
<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>https://demo-shop.com/uk/sitemap1.xml</loc>
        <lastmod>2026-01-01T00:00:00Z</lastmod>
    </sitemap>
    <sitemap>
        <loc>https://demo-shop.com/uk/sitemap2.xml</loc>
        <lastmod>2026-01-01T00:00:00Z</lastmod>
    </sitemap>
</sitemapindex>
```

## Status codes

| Code | When |
| - | - |
| `200` | Your project's sitemap |
| `401` | `fs-secret` missing or wrong (only when the project has fetch keys configured) |
| `404` | `SITEMAP_NOT_FOUND` - your project has no sitemaps |
| `422` | `FETCH_API_LIMIT_EXCEEDED` - project's plan limit for Fetch API requests exceeded |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.