
Overview
Sitemap is our service that extracts all URLs from a website’s sitemap.xml file automatically. The API discovers the sitemap from robots.txt, common locations like /sitemap.xml, or sitemap index files—perfect for discovering pages for bulk scraping, content inventory, or combining with other endpoints.Try Sitemap instantly in our interactive playground - no coding required!
Getting Started
Quick Start
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| apiKey | string | Yes | The ScrapeGraph API Key. |
| websiteUrl | string | Yes | The URL of the website to extract the sitemap from. The API will automatically locate the sitemap.xml file. |
| headers | object | No | Optional headers (user agent, cookies, etc.). |
| mock | boolean | No | Enable mock mode for testing. Default: false |
| stealth | boolean | No | Enable stealth mode for anti-bot protection. Adds +4 credits. Default: false |
Get your API key from the dashboard
Example Response
Example Response
request_id: Unique identifier for tracking your requeststatus: Current status of the extractionwebsite_url: The website that was processedurls: Array of all URLs found in the sitemaperror: Error message (if any)
Key Features
Automatic Discovery
Finds sitemap from robots.txt or common locations
Sitemap Index Support
Handles sitemap index files with multiple sitemaps
Fast Extraction
Retrieves all URLs without scraping each page
Integration Ready
Combine with SmartScraper for bulk operations
Use Cases
- Discover all pages on a website for bulk scraping
- Build content inventory from a website
- Monitor website structure changes
- Combine with SmartScraper to scrape multiple pages
- Create site maps for SEO analysis