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

# Export Sitemap Pages

`GET /{brand_id}/sitemap/export`

Download every page in the brand's sitemap as CSV or XLSX. Same filters as the listing endpoint, no pagination. With include_metrics (default true), each row also includes totals over the selected date range for agent_traffic, citations, and ai_referrals, plus percent change from the first bucket to the last bucket — matching the totals and trend % shown in the sitemap UI.

## Path parameters

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

## Query parameters

- `format` 'csv' | 'xlsx' — Output format: csv or xlsx
- `mapped_site_id` integer, nullable — Explicit sitemap (mapped_site_id) to export. The FE passes this so the export operates on the sitemap the user is currently viewing, even if it isn't the latest finished crawl for the domain. Defaults to the latest finished crawl for the brand (and optionally the supplied domain).
- `domain` string, nullable — Filter by domain (for brands with multiple sites)
- `max_depth` integer, nullable — Maximum URL path depth to include (0 = root only)
- `path_prefix` string, nullable — Filter by URL path prefix (e.g. /blog)
- `is_priority` boolean, nullable — Filter to (or exclude) pages flagged as priority
- `has_optimized_content` boolean, nullable — Filter to (or exclude) pages with active AXP content
- `search` string, nullable — Case-insensitive substring match on the page URL or title — mirrors the 'Find pages...' input in the UI.
- `include_metrics` boolean — Include per-page totals for agent_traffic, citations, ai_referrals (summed over the selected date range), plus percent-change from the first bucket to the last bucket of the same series — matching the trend % shown next to each metric in the sitemap UI.
- `start_date` string, nullable — Metrics start date (YYYY-MM-DD). Defaults to 30 days ago.
- `end_date` string, nullable — Metrics end date (YYYY-MM-DD). Defaults to today.
- `tz` string, nullable — User's IANA timezone (e.g. 'America/Denver'). When provided, the export drops the trailing weekly bucket that falls on today in that timezone — matching the sitemap UI's chart filter so totals and change_pct line up with what the user sees on screen. Omit for external API consumers who want the raw date range.

## Response `200`

Successful Response

- unknown

## Other responses

- `422` — Validation Error

---

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