---
title: "Export Sitemap Pages"
method: GET
path: "/{brand_id}/sitemap/export"
tags: ["sitemap"]
---

# Export Sitemap Pages

`GET /{brand_id}/sitemap/export`

Download every page matching the supplied filters as CSV or XLSX. Uses the same filters as the list endpoint but skips pagination.

With `include_metrics=true` (the default), each row also includes totals over the selected date range for `agent_traffic`, `citations`, and `ai_referrals`, plus a percent-change column comparing the first and last buckets of the range — matching the totals and trend percentages shown in the sitemap UI.

Limits:
- Maximum 10,000 rows per export.
- Maximum 366-day window for `start_date`/`end_date`.

The response sets `Content-Disposition` with a `sitemap-{brand_id}-{YYYY-MM-DD}.{csv|xlsx}` filename.

## Path parameters

- `brand_id` integer, required — The unique identifier for the brand.

## Query parameters

- `format` 'csv' | 'xlsx' — Output format. `csv` returns a UTF-8 (BOM) CSV stream. `xlsx` returns a binary Excel workbook.
- `mapped_site_id` integer, nullable — Explicit sitemap (mapped site) identifier to export. Defaults to the latest finished crawl for the brand and optional `domain`.
- `domain` string, nullable — Filter to a specific domain when the brand has multiple registered sites.
- `max_depth` integer, nullable — Maximum URL path depth to include. `0` returns root pages only.
- `path_prefix` string, nullable — Filter by segment-aligned URL path prefix.
- `is_priority` boolean, nullable — Filter to (or exclude) priority pages.
- `has_optimized_content` boolean, nullable — Filter to (or exclude) pages with active AXP optimized content.
- `search` string, nullable — Case-insensitive substring match against the page URL or title.
- `include_metrics` boolean — Include per-page totals and percent-change columns for `agent_traffic`, `citations`, and `ai_referrals` over the selected date range.
- `start_date` string, date, nullable — Metrics start date (YYYY-MM-DD). Defaults to 30 days ago.
- `end_date` string, date, nullable — Metrics end date (YYYY-MM-DD). Defaults to today.

## Response `200`

Streamed export file.

## Other responses

- `400` — Invalid date range, or export would exceed the 10,000-row cap.
- `404` — No matching sitemap crawl found for this brand.
- `422` — Validation Error

---

[API](https://skmtc.net/scrunch/apis/scrunch-data-api.md) · [All operations](https://skmtc.net/scrunch/apis/scrunch-data-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/scrunch/scrunch-data-api/revisions/3e09c2a06458/schema)
