# What is a sitemap?

A sitemap lists important URLs on a site, usually as XML, so crawlers can discover pages without guessing every link path.

A sitemap is a file (most often XML at /sitemap.xml or a sitemap index) that lists canonical URLs a site wants discovered. Entries can include lastmod hints and alternate locale links. Large sites split sitemaps into an index that points at multiple sitemap files so crawlers can fetch them in chunks.

Sitemaps solve a discovery problem. Not every important URL is one click from the homepage. Pagination, filtered views, and orphaned docs pages may never appear in a shallow link crawl. Publishing a sitemap gives search engines and polite crawlers a first-class URL list.

For agent and RAG pipelines, a sitemap (or a map API that returns a similar list) is often the cheapest first step. You learn which URLs exist before you spend scrape credits on bodies. You can filter to /docs, drop language duplicates, and only then scrape Markdown for the index.

Sitemaps are related to but distinct from robots.txt and llms.txt. robots.txt may advertise the sitemap location. llms.txt is a curated Markdown index for models, usually much smaller and editorial. Many teams generate llms.txt from a sitemap-derived shortlist plus hand edits.

Webcrawl’s POST /v1/map is the agent-facing discovery call when you want a URL list from a start page. The free website URL extractor tool exposes the same idea for quick trials. For documentation ingestion, map first, filter, then scrape or crawl. That sequence beats unbounded crawling when your goal is a clean Markdown corpus.

When you publish your own docs, keep the sitemap fresh, reference it from robots.txt, and consider llms.txt for agents that should not ingest every marketing URL. Discovery quality upstream determines RAG quality downstream.
XML sitemaps follow a simple schema: a urlset containing url entries with loc required and lastmod, changefreq, and priority optional. Sitemap indexes point to other sitemap files when a property has more URLs than a single file should hold. Image, video, and news extensions exist for specialized search surfaces. For agent ingestion, loc and lastmod are usually enough.

Operational excellence for sitemaps means freshness and honesty. If lastmod never changes, consumers stop trusting it. If the sitemap lists tens of thousands of near-duplicate facet URLs, crawlers waste budget. Prefer canonical article and docs URLs. Exclude infinite search-result spaces. Compress large sitemaps and ensure they are reachable quickly.

Agent builders should not assume every site has a perfect sitemap. Some sites rely only on HTML link graphs. That is why Webcrawl map starts from a URL you provide and returns discovered links even when XML sitemaps are incomplete. When a sitemap exists, combining it with map results gives better recall. When it does not, map plus search still unblocks documentation ingestion.

Downstream, treat sitemap-derived lists as candidates, not gospel. Deduplicate, apply allow/deny path filters, and sample-scrape before a full ingest. Store the URL list in git or object storage next to the Markdown corpus so you can explain why a page entered the index. That audit trail matters when legal or customer success asks where a paragraph came from.

## Minimal URL set idea

```
# Conceptual list you might derive from a sitemap or /v1/map
https://example.com/docs
https://example.com/docs/getting-started
https://example.com/docs/api
https://example.com/changelog
```


Related: [robots.txt](https://webcrawl.app/glossary/robots-txt), [Web crawling](https://webcrawl.app/glossary/web-crawling), [llms.txt](https://webcrawl.app/glossary/llms-txt), [URL extractor](https://webcrawl.app/tools/website-url-extractor), [Documentation ingestion](https://webcrawl.app/use-cases/documentation-ingestion).

HTML: https://webcrawl.app/glossary/sitemap
