> ## 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](/api-builder/pages#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`).

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

## Path Parameters

<ParamField path="project-token" type="string" required>
  Your project's Fetch token, embedded in the subdomain.
</ParamField>

<ParamField path="index" type="number">
  The index of a nested sitemap (only if the sitemap was split up).
</ParamField>

## Headers

See [Headers](/reference/fetch-api#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.

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

<ResponseExample>
  ```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>
  ```
</ResponseExample>

## Status codes

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