Sitemap Product Url Collector avatar

Sitemap Product Url Collector

Pricing

$2.00 / 1,000 results

Go to Apify Store
Sitemap Product Url Collector

Sitemap Product Url Collector

Pricing

$2.00 / 1,000 results

Rating

0.0

(0)

Developer

Eichan Jolly

Eichan Jolly

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

15 days ago

Last modified

Categories

Features

Limited permissions

Share

Find a small, bounded list of likely product-page URLs from exactly one public XML sitemap or a sitemap index. Returns one dataset item per matching URL, without opening product pages or visiting unrelated sites.

Who is it for?

E-commerce catalog teams, feed validators, and store owners who need a lightweight list of /product/ or /products/ paths for a site they are permitted to inspect. It does not verify that each URL resolves to a currently purchasable product.

Try the prefilled example

{
"sitemapUrl": "https://www.allbirds.com/sitemap.xml",
"maxUrls": 5
}

This is a real public Shopify sitemap index, independently retrieved on 2026-11-01. Its product child sitemap was also checked to contain URLs like https://www.allbirds.com/products/mens-wool-runners. No placeholder URLs are used. The external site may change its sitemap at any time and could restrict automated access.

Output example

Two items from the included local synthetic sitemap fixture (illustrative timestamps, not live crawl measurements):

[
{
"url": "https://www.allbirds.com/products/mens-wool-runners",
"lastmod": "2026-10-22T12:00:00+00:00",
"sourceSitemap": "https://www.allbirds.com/sitemap_products_1.xml?from=1878193471557&to=7369944137808"
},
{
"url": "https://www.allbirds.com/products/womens-wool-runners-natural-black",
"lastmod": null,
"sourceSitemap": "https://www.allbirds.com/sitemap_products_1.xml?from=1878193471557&to=7369944137808"
}
]

Each item always has exactly these three fields. lastmod is the raw XML <lastmod> string, or null if absent. sourceSitemap is the exact child sitemap that supplied the URL, or the starting URL for a plain urlset.

How it works

  1. Validates one public HTTPS sitemap URL and resolves its public IP; refuses private/non-public hosts, redirects, custom HTTPS ports, Amazon/eBay, and cross-host child sitemaps.
  2. Parses a standard <urlset> directly, or follows a single <sitemapindex> level, inspecting up to 20 same-host child sitemaps in document order.
  3. Supports public .xml, .xml.gz, and gzip-compressed responses. Compression is detected by extension, headers, or gzip magic bytes.
  4. Keeps only absolute same-host HTTPS entries with a path containing /product/ or /products/ followed by content (case-insensitive). Duplicates are removed and URLs are capped at maxUrls.
  5. Saves the resulting rows to the default Apify Dataset through REST, or to numbered local Dataset JSON files.

Honest limits

  • One sitemap URL per run. maxUrls defaults to 5; allowed 1–100. No site-wide discovery and no robots.txt search. No nested index traversal beyond one level.
  • Maximum 20 child sitemap files; 15-second timeout per request; 2 MB download and 4 MB uncompressed XML per file. Delays of 0.2 seconds between child requests. No concurrent crawling, retry flood, or browser automation.
  • Only exact URL path segments /product/ and /products/ qualify. Product pages with other URL structures (e.g. /shop/, /store/, /p/) are intentionally omitted. A matching path is not a verified product.
  • Follows same-host sitemap URLs only; does not fetch any product pages. Skips cross-host or malformed child sitemaps with plain-language notices. When nothing matches, returns an empty dataset and logs why.
  • Rejects DTD/ENTITY-containing XML. Public sitemap owners may change URLs, rate-limit, or block requests. DNS checks reduce SSRF risk but not every DNS rebinding scenario.

Run locally

Python 3.12+; no external packages.

cd sitemap-product-url-collector
export ACTOR_INPUT_JSON='{"sitemapUrl":"https://www.allbirds.com/sitemap.xml","maxUrls":5}'
python src/main.py

Or save the same JSON in storage/key_value_stores/default/INPUT.json and omit ACTOR_INPUT_JSON. Local output is one JSON file per dataset item in storage/datasets/default/. On Apify, runtime dataset IDs and token are used for REST dataset writes without any SDK.

Reproduce tests and script-mode smoke evidence

python -m unittest discover -s tests -p 'test_*.py' -v
python tests/smoke.py

The smoke script runs python src/main.py as a subprocess with a valid prefilled input and uses test-only sitecustomize.py to serve deterministic local XML fixtures. It captures the terminal output and resulting Dataset JSON in tests/smoke_evidence.txt and tests/smoke_dataset.json. This is an actual script execution, but its HTTP content is simulated, not a live HTTP response. .xml.gz handling is separately covered by tests that execute the decompression path.

Store metadata and suggested pricing

  • Apify Store category: ECOMMERCE (E-commerce). Suggested output type: Products (URL list).
  • Suggested price: $2 per 1,000 collected product URLs ($0.002 per dataset item), per successful result. No result means no suggested charge.
  • store_metadata.json contains the classification and proposal. No billing was configured. No Actor was published or run on Apify.