Skip to main content
GuidesNovember 24, 2026 · 12 min read

Sitemap vs website mapping vs crawling: which to use?

Compare sitemap.xml, website mapping, and crawling with real examples. Learn when to parse a sitemap, use Spidra Map, or run a Crawl.

Sitemap vs website mapping vs crawling: which to use?

You need to collect pages from a website, but you don't know all the URLs. Should you read its sitemap.xml, map the website, or crawl through its pages?

All three approaches help with website discovery, but they solve different problems. A sitemap gives you URLs published by the site. Website mapping finds URLs through sitemaps and internal links. Crawling goes further by following navigation and retrieving page content.

This guide compares sitemap parsing, website mapping, and crawling using real websites and Spidra Map and Crawl. You'll see when each approach is useful, what it can miss, and how to choose without processing more pages than necessary.

Sitemap, Map, and Crawl: what's the difference?

Before choosing a method, decide whether your application needs a list of URLs or the actual content of those pages.

Method

What it does

Best for

XML sitemap

Reads URLs published in sitemap files

Getting a known list of site URLs without following links

Website Map

Finds URLs through sitemaps, internal links, or both

Discovering and filtering URLs before extraction

Website Crawl

Follows navigation and retrieves content from matching pages

Collecting content when the target URLs are unknown

Consider a documentation website with hundreds of pages.

If it publishes a reliable sitemap, you can read that file and filter its URLs locally. If the sitemap is incomplete, Map can look for pages linked from the website. If you want the contents of a particular documentation section, Crawl can follow relevant links and return those pages.

You don't always need the most involved approach.

Read sitemap.xml when the site publishes the URLs you need

An XML sitemap is a document containing URLs that a website makes available for discovery.

You'll often find it at:

https://example.com/sitemap.xml

Some websites use a sitemap index that points to several smaller files. Others declare their sitemap locations in robots.txt.

A typical entry looks like this:

<url>
  <loc>https://example.com/docs/getting-started</loc>
  <lastmod>2026-10-20</lastmod>
</url>

This is an illustrative sitemap entry.

The loc element identifies the page. The optional lastmod element describes when the website reports that the page was last meaningfully updated.

Sitemaps are useful because they save you from discovering URLs one link at a time.

But the files aren't necessarily complete. A site can have accessible pages that aren't included in its sitemap. Likewise, a sitemap can contain URLs that have changed, redirect elsewhere, or no longer serve useful content.

As Google's sitemap documentation explains, sitemaps help with discovery but don't guarantee that every listed page will be crawled or indexed.

Parse sitemap URLs with Python

You don't need a scraping API just to read an ordinary XML sitemap.

Python's requests and xml.etree.ElementTree libraries can retrieve the file and extract its URLs.

The companion comparison project provides a sitemap_inventory() function that also handles sitemap indexes, compressed XML, and sitemap locations declared in robots.txt.

Install Requests:

pip install requests

Then use the function:

# read_sitemap.py
from compare_discovery import sitemap_inventory

site = "https://fastapi.tiangolo.com/"
inventory = sitemap_inventory(site)

urls = inventory["urls"]

for url in urls[:10]:
    print(url)

Here, compare_discovery.py is included in the companion project. The function keeps the comparison within the target host, limits the number of sitemap files it reads, and reports files it couldn't process.

It doesn't guarantee a complete inventory. For example, its bounded implementation doesn't follow sitemap redirects automatically, and a site may publish more sitemap files than the configured limit.

For a well-maintained sitemap with the URLs you need, local parsing is a good choice. It requires no Spidra API credits and gives you direct control over how the URLs are filtered and saved.

If the sitemap is missing or doesn't contain the pages you're looking for, move to link-based discovery.

Use Map when sitemap discovery isn't enough

Spidra Map discovers URLs using the site's published sitemap and links found on its pages.

Unlike Crawl, Map doesn't return the extracted content of every discovered page. It returns URLs you can inspect before deciding what to retrieve.

Map supports three sitemap settings:

  • sitemap="only" reads sitemap data.

  • sitemap="skip" discovers URLs through page links.

  • sitemap="include" combines sitemap and link discovery.

The combined option is the default.

Example: discovering Python documentation pages

Suppose you're building a reference application about Python's asyncio library.

The documentation contains many unrelated sections. You need URLs relevant to asynchronous programming, not every page.

Install the Spidra Python SDK:

pip install spidra

Create an API key and save it in the SPIDRA_API_KEY environment variable.

Now request the relevant URLs:

# map_docs.py
import os
from spidra import Spidra

client = Spidra(
    api_key=os.environ["SPIDRA_API_KEY"]
)

result = client.map(
    "https://docs.python.org/3/",
    search="asyncio",
    limit=20,
)

The request searches the discovered URLs and associated link text for pages related to asyncio.

In Spidra's documented execution, Map scanned 594 URLs and found 21 matching the search.

The response included:

https://docs.python.org/3/library/asyncio.html
https://docs.python.org/3/library/asyncio-threading.html
https://docs.python.org/3/howto/a-conceptual-overview-of-asyncio.html

The recorded response also contained this discovery breakdown:

{
  "total": 21,
  "scanned": 594,
  "sources": {
    "sitemap": 7,
    "pages": 587
  },
  "creditsUsed": 1
}

These values reveal something useful about discovery.

Only seven URLs were attributed to the sitemap source in that Map response, while 587 were attributed to page links.

The sources fields are Spidra's reported discovery categories, not an independently calculated sitemap-versus-Map intersection.

Still, the result demonstrates why relying on sitemap discovery alone may give you a different view of a website.

Map also lets you narrow the inventory before fetching any page content. In this example, it identified the asyncio pages without returning the Markdown of all 594 discovered URLs.

Check whether Map found the right pages

Finding more URLs isn't always better.

A useful website inventory should contain the pages relevant to your application, without unnecessary versions, translations, or unrelated sections.

FastAPI's documentation illustrates this problem.

A Spidra Map request searched the site for dependencies. It found 36 matching URLs among 619 discovered URLs.

The returned pages included:

https://fastapi.tiangolo.com/tutorial/dependencies/
https://fastapi.tiangolo.com/reference/dependencies/
https://fastapi.tiangolo.com/de/reference/dependencies/
https://fastapi.tiangolo.com/es/reference/dependencies/
https://fastapi.tiangolo.com/fr/reference/dependencies/

These URLs relate to the same general subject, but some are translated versions.

If you're building an English-language knowledge base, collecting all of them creates unnecessary work.

You could filter the URLs by language and path before scraping them. You might also prefer tutorial pages over reference pages, depending on your application's purpose.

Map gives you the opportunity to make those decisions while you're still working with URLs rather than full page content.

For a detailed implementation, our guide to mapping a website and scraping only selected pages shows how to filter Map results and send the selected URLs to Batch Scrape.

This is one of the main reasons to choose Map over immediately crawling a site: you retain control over exactly which URLs are processed next.

Use Crawl when you need the pages themselves

A sitemap or website map can tell you where pages are located. But your application may need the information inside them.

That's where Spidra Crawl becomes useful.

Crawl starts from a URL, follows links toward the kind of pages you describe, and returns content from matching pages.

It can also use sitemap data during discovery, so sitemap reading and crawling aren't mutually exclusive.

Example: extracting product pages from Books to Scrape

Consider Books to Scrape, a demonstration ecommerce website.

A recorded Spidra Map request using sitemap="only" returned no URLs.

The result reported:

0 URLs found
0 credits used

Spidra couldn't read a sitemap for that request. This doesn't mean the site has no accessible product pages.

Its category pages contain links to individual books.

A separate completed Crawl started from the Mystery category and requested individual book pages.

# crawl_books.py
job = client.crawl(
    "https://books.toscrape.com/catalogue/category/books/mystery_3/index.html",
    crawl_instruction="Individual book pages",
    schema={
        "type": "object",
        "properties": {
            "title": {"type": "string"},
            "price": {"type": "number"},
        },
    },
    max_pages=3,
)

The SDK waits for the crawl result.

The documented execution returned three individual book pages, including:

https://books.toscrape.com/catalogue/sharp-objects_997/index.html

That page's structured result included:

{
  "title": "Sharp Objects",
  "price": 47.82
}

The category page helped the crawler find the books, but it wasn't included among the returned content pages.

Spidra treats pages visited only for discovery as navigation pages. They don't count toward the requested number of returned pages and aren't charged as crawl results.

This matters for websites where target content sits behind categories, pagination, or other navigation pages.

You can describe what you need, let Crawl follow the relevant links, and receive the matching page content without first building a complete URL inventory.

Keep the Crawl scope narrow

A crawl beginning inside one documentation section or product category normally stays within that starting path.

You can adjust the scope using path filters or allow traversal across the domain when necessary.

For the Books to Scrape example, the instruction Individual book pages limits the desired results to product details rather than category pages.

Without a specific instruction, a broader crawl may return pages you don't need.

Crawl also provides a report explaining how it interpreted your instruction and why particular links weren't followed.

That report is useful when you expected a page to be returned but can't find it in the results.

What the three website examples reveal

The Python documentation, FastAPI documentation, and Books to Scrape examples demonstrate three different discovery problems.

Website

Recorded observation

Practical lesson

Python documentation

21 asyncio matches from 594 discovered URLs; 7 sitemap-attributed and 587 link-attributed URLs

Link-based mapping can reveal URLs beyond the sitemap source

FastAPI documentation

36 dependency-related matches from 619 discovered URLs, including translations

Discovery still needs relevance and language filtering

Books to Scrape

Sitemap-only Map returned no URLs; a separate Crawl returned three book pages

A missing readable sitemap doesn't prevent navigation-based content retrieval

These were separate Spidra executions, not one controlled benchmark. Their starting URLs, result limits, and settings differed.

The results show cases where each method can be useful, but they don't establish exact overlap or a universal speed ranking.

To measure those properly, run sitemap parsing, sitemap-only Map, link-only Map, combined Map, and a bounded Crawl against the same site under documented settings.

Compare the URLs each method found

After collecting the outputs, compare their URL sets in Python.

# compare_urls.py
sitemap_urls = set(sitemap_results)
map_urls = set(map_results)
crawl_urls = set(crawl_results)

overlap = sitemap_urls & map_urls
map_only = map_urls - sitemap_urls
sitemap_only = sitemap_urls - map_urls

print("Shared:", len(overlap))
print("Map only:", len(map_only))
print("Sitemap only:", len(sitemap_only))

Here, the three result variables represent URL lists obtained from the respective methods.

The intersection contains URLs found by both sitemap parsing and Map.

The differences identify URLs reported by only one method.

Before interpreting the results, check whether both inventories cover the same host and use compatible URL-normalization rules. Query parameters, redirects, trailing slashes, and HTTP versus HTTPS can otherwise create misleading differences.

Map also has discovery settings that affect coverage, including query-parameter handling and subdomain inclusion.

For a fair experiment, record these settings, use the same starting scope, and check whether either result was truncated.

Crawl needs a separate interpretation.

A Crawl limited to three matching book pages shouldn't be compared directly with a site-wide Map inventory as though both attempted to enumerate the whole website.

Instead, check whether the returned crawl pages appeared in the sitemap or Map inventory. That tells you whether those discovery methods could have identified the pages. It doesn't measure how effectively they would have extracted their content.

Compare processing time, cost, and effort

The right choice also depends on the work your application needs to perform.

Ordinary sitemap parsing uses local Python and HTTP requests. It's often the simplest approach when a complete enough sitemap is available.

Map handles URL discovery through a single API request. You still decide which pages to scrape.

Crawl discovers matching pages and retrieves their content, reducing the need to manage that discovery and extraction process yourself.

The historical Spidra examples provide these measurements:

Operation

Recorded result

Cost

Python documentation Map

4.9 seconds for the documented asyncio search

1 credit

FastAPI Map plus three subsequent scrapes

About 26 seconds for the combined workflow

4 credits total

Books to Scrape structured Crawl

Three returned book pages

5 credits, including AI extraction

These are different workloads. The FastAPI timing includes scraping after Map, while the Python documentation figure covers only Map. The Books example records credits but doesn't provide an equivalent timing measurement.

For ordinary sitemap parsing, no Spidra credits are required, but the actual elapsed time depends on the site and its sitemap files.

So which approach requires the least effort?

If the sitemap contains every URL you need, reading it directly is usually the simplest.

If you need to discover URLs and approve them before extraction, Map is useful.

If you need a system to follow navigation and return matching content, Crawl can combine both steps.

The choice should follow the output you need, not the assumption that every unfamiliar website requires crawling.

Decision tree: when to use sitemap, Map, or Crawl

Use this decision tree before building your extraction workflow.

Do you already know the exact URLs?
│
├── YES
│   └── Use Scrape or Batch Scrape.
│
└── NO
    │
    ├── Do you only need a URL list?
    │   │
    │   ├── Is the sitemap available
    │   │   and sufficient?
    │   │   └── YES → Parse sitemap.xml
    │   │
    │   └── NO / UNSURE → Use Map
    │
    └── Do you need page content?
        │
        ├── Can you discover and select
        │   the relevant URLs first?
        │   └── YES → Map, filter,
        │              then Batch Scrape
        │
        └── Must the system follow
            navigation to find the pages?
            └── YES → Use Crawl

You can also combine the methods.

For example, Map may help you find a relevant product category, while Crawl can start from that category and extract individual products.

Crawl is not automatically a replacement for sitemap parsing or Map. It serves a different stage of the collection workflow.

What can each method miss?

No discovery method guarantees a complete website inventory.

A sitemap can omit accessible pages or contain stale links.

Map can miss pages that aren't present in the sitemap or reachable through the internal links it examines. Dynamic navigation, authentication, and discovery limits may also affect the returned list.

Crawl can miss content when its instruction, starting path, filters, or returned-page limit excludes a page. Some websites also restrict automated access.

The absence of a URL from one result doesn't prove the page doesn't exist.

When completeness matters, compare methods, inspect unexpected gaps, and keep the discovered URL lists for later review.

Before collecting content from third-party sites, review their terms, access restrictions, and applicable rules. Spidra also supports respecting robots.txt during mapping and crawling. Our guide to web scraping legality covers the broader considerations.

Choose the smallest workflow that gets the data you need

You don't need to crawl every website just to discover its pages.

Start with sitemap.xml when it provides a useful URL list. Use Map when you need a broader inventory or want to select pages before scraping. Use Crawl when your application needs to follow navigation and retrieve matching content.

Each method solves a different part of website discovery and extraction.

Create a Spidra account and compare Map's sitemap-only and link-only modes on a website you're permitted to process. Inspect the URLs before deciding whether a targeted crawl is necessary.

Frequently asked questions

No. A sitemap contains URLs published by the website, while website mapping can also discover URLs through internal links. Spidra Map can use sitemap discovery, link discovery, or both, depending on the request settings.

Share this article

You build the product.
Spidra handles the data work.

Start with 300 free credits, about 300 pages. No credit card required.