Skip to main content
GET
/
{brand_id}
/
sitemap
/
export
Export Sitemap Pages
curl --request GET \
  --url https://api.scrunchai.com/v1/{brand_id}/sitemap/export \
  --header 'Authorization: Bearer <token>'
import requests

url = "https://api.scrunchai.com/v1/{brand_id}/sitemap/export"

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers)

print(response.text)
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

fetch('https://api.scrunchai.com/v1/{brand_id}/sitemap/export', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.scrunchai.com/v1/{brand_id}/sitemap/export",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.scrunchai.com/v1/{brand_id}/sitemap/export"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Authorization", "Bearer <token>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.scrunchai.com/v1/{brand_id}/sitemap/export")
.header("Authorization", "Bearer <token>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.scrunchai.com/v1/{brand_id}/sitemap/export")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
"<string>"
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

brand_id
integer
required

The unique identifier for the brand.

Query Parameters

format
enum<string>
default:csv

Output format. csv returns a UTF-8 (BOM) CSV stream. xlsx returns a binary Excel workbook.

Available options:
csv,
xlsx
mapped_site_id
integer | null

Explicit sitemap (mapped site) identifier to export. Defaults to the latest finished crawl for the brand and optional domain.

domain
string | null

Filter to a specific domain when the brand has multiple registered sites.

max_depth
integer | null

Maximum URL path depth to include. 0 returns root pages only.

Required range: x >= 0
path_prefix
string | null

Filter by segment-aligned URL path prefix.

is_priority
boolean | null

Filter to (or exclude) priority pages.

has_optimized_content
boolean | null

Filter to (or exclude) pages with active AXP optimized content.

search
string | null

Case-insensitive substring match against the page URL or title.

include_metrics
boolean
default:true

Include per-page totals and percent-change columns for agent_traffic, citations, and ai_referrals over the selected date range.

start_date
string<date> | null

Metrics start date (YYYY-MM-DD). Defaults to 30 days ago.

end_date
string<date> | null

Metrics end date (YYYY-MM-DD). Defaults to today.

Response

Streamed export file.

UTF-8 (BOM) CSV. First row is the column header.