Before you can collect a catalog, you need its URLs. Paginating through category pages is slow, often capped, and repeats the same products under many categories. A site’s sitemap, when it has one, lists product URLs directly, in a handful of requests. It is the cheapest seed for a crawl. It is also incomplete in predictable ways, and the useful skill is knowing where.
Key takeaways
- Start from the
Sitemap:lines in robots.txt; they usually point to an index of child sitemaps split by type. - Classify URLs by pattern before fetching anything: products, categories, stores and content need different handling.
- Diff sitemap snapshots between runs. New URLs are candidate new products; vanished URLs are candidate removals to confirm.
- Check coverage against a category crawl. Sitemaps lag behind the live site and often omit variants and unlisted items.
Why seed from a sitemap
Category pages were built for shoppers, not for enumeration. Many retailers cap how deep pagination goes, which we covered in pagination limits on major retailers. The same product appears in several categories, so a category crawl fetches duplicates. And every listing page is a full HTML page with filters, banners and recommendations.
A sitemap is the opposite: one XML file lists up to 50,000 URLs, and a few requests can enumerate a catalog of hundreds of thousands. For the site it is also the politest discovery method, since the site generated the list for crawlers in the first place.
Step 1: find the sitemaps
- Read the site’s robots.txt and collect every
Sitemap:line. A site may list several. - If there are none, try
/sitemap.xmland/sitemap_index.xmlat the root. - Expand any sitemap index into its child sitemaps. Large retailers usually split by type (products, categories, stores, content) and often by ID range or locale.
The child file names are a map of the site. A list like products-1.xml to products-37.xml tells you the catalog is somewhere under 1.85 million URLs before you have fetched a single product page.
Step 2: classify URLs by pattern
Product URLs almost always carry an identifier: a SKU, an article number or a numeric product ID. Write a pattern per site, classify every URL, and count the classes before collecting anything. If 80% of a “products” sitemap turns out to be category or content pages, you want to know now.
Patterns also reveal product types. In our July 2026 IKEA US catalog, combination products (sets assembled from several articles) used an article number with an “s” prefix, while single articles used the plain number format. That one character separated almost a third of the catalog.
One catalog, two URL patterns
Products in our IKEA US catalog by article-number pattern
Data behind the chart
| Pattern | Products | Share |
|---|---|---|
| Single article number | 6,249 | 70.6% |
| s-prefixed combination | 2,606 | 29.4% |
| Total | 8,855 | 100% |
A split like this matters downstream. Combination products have component lists and prices that depend on their parts, so they need their own parsing rules and their own checks.
Step 3: normalize before you count
- Strip tracking parameters such as
utm_*, and sort the remaining query parameters. - Pick one form of trailing slash, host (
wwwor not) and scheme. - Collapse locales if the sitemap lists the same product under several language paths and you only need one market.
- Key products by identifier, not by URL. Slugs change when titles change; IDs usually don’t.
Step 4: diff runs to detect change
Store each run’s set of product identifiers with the sitemap’s lastmod, if any. Comparing two runs gives three lists: identifiers that appeared, identifiers that disappeared, and identifiers whose lastmod moved. Each is a candidate, not a fact.
import re
PRODUCT = re.compile(r"/p/[^/]+-(s?\d{8})/?$") # site-specific pattern
def product_ids(urls_with_lastmod):
out = {}
for loc, lastmod in urls_with_lastmod:
m = PRODUCT.search(loc.split("?", 1)[0])
if m:
out[m.group(1)] = lastmod
return out
def diff(previous, current):
"""previous, current: {product_id: lastmod}"""
added = current.keys() - previous.keys()
removed = previous.keys() - current.keys()
touched = {k for k in current.keys() & previous.keys()
if current[k] and current[k] != previous[k]}
return added, removed, touched Then confirm. Fetch the added URLs to collect the new products. Fetch the removed ones too: a 404 or 410 confirms a delisting, while a 200 means the product still exists and simply fell out of the sitemap. We record both outcomes, because “removed from the sitemap” and “removed from the store” are different events.
Step 5: check coverage against categories
A sitemap is generated by a job that runs on the site’s schedule, not yours. Products added after the last run are missing; products removed since may still be listed. Some sites leave out variants, out-of-stock items or products only reachable through search.
What each discovery method misses
Sitemap URLs and category-crawl URLs overlap, but neither is complete on its own
The fix is a periodic coverage check. Crawl a sample of category pages, collect the product identifiers they show, and measure how many are absent from the sitemap. If the gap is a few percent, the sitemap is a good seed and the category crawl can run weekly as a safety net. If it is large, the category crawl becomes the primary source and the sitemap the supplement.
What sitemaps don’t give you
A sitemap gives URLs and, sometimes, a modification date. It does not give prices, stock or attributes, and it says nothing about whether you may collect the pages it lists: robots.txt and the site’s terms still apply to every product URL. Treat the sitemap as an index to the catalog, then fetch product pages at a polite, steady rate. For the field-level detail of what lastmod and the other tags mean, Google’s sitemap documentation and the sitemaps.org protocol are the references.
Quick answers
How do I find a website’s sitemap?
Check the Sitemap: lines in the site’s robots.txt first. If none are listed, try /sitemap.xml and /sitemap_index.xml at the root of the site.
Is scraping a sitemap enough to get a full product catalog?
Usually not. Sitemaps lag behind the live site and often omit variants, out-of-stock items or unlisted products. Combine them with a periodic category crawl to measure the gap.
How can I detect new products from a sitemap?
Store the product identifiers from each run and compare runs. Identifiers that appear for the first time are candidate new products; confirm them by fetching the pages.
Does a URL missing from the sitemap mean the product was removed?
Not necessarily. Fetch the page: a 404 or 410 confirms removal, while a 200 means the product still exists and only dropped out of the sitemap.
Want new and delisted products flagged for you?
Our assortment tracking combines sitemap diffs with category coverage checks and confirms every change. See assortment tracking.
