XML Sitemap URLs Extractor icon

Search & SEO · Live on Apify

XML Sitemap URL Extractor

Turn a sitemap into a clean list of page URLs. It reads sitemap indexes and gzip files too. It does not visit the pages.

About $1.27 for 1,000 URLs$0.00027 per URL + $0.02 per run. One run gives up to 20 URLs. Apify bills you, not us.One URL in a run of its own: about $0.02.Free to try: the Apify free plan gives you $5 of usage every month, no credit card needed.

Run it on Apify Opens apify.com, the website where our tools run. Sign up free with Google or email, no card needed.

Apify links on this page are affiliate links. We may earn a commission. You pay the same price. Affiliate disclosure

What you get, for example

urlhttps://www.sitemaps.org/
lastmod2016-11-21T00:00:00.000Z
sitemapUrlhttps://www.sitemaps.org/sitemap.xml

How to use it: 3 steps

  1. Make a free Apify accountApify is the cloud platform where our tools run. The free plan gives you $5 of usage every month, no credit card needed. You pay Apify, not us.
  2. Paste your input and press StartNo code needed: you fill in a form (the input). It already has a working example. For example: {"url": "https://www.sitemaps.org/sitemap.xml"} in Sitemap URLs. Each start is one run.
  3. Download the resultsWhen the run ends, the results are in a table (the dataset). Open Output, press Export and pick Excel or CSV. JSON and the API are there too.

This tool is an Apify Actor: a small program that runs on Apify. You can also run it on a schedule, for example every Monday. New to it? Read how it works, step by step and the 8 words you need first.

What it does

Read public XML sitemaps, sitemap indexes, and gzip sitemap files and save one deduplicated row per page URL. Each row includes url, lastmod, changefreq, priority, and the source sitemapUrl.

  • reads public HTTP(S) XML sitemaps;
  • follows nested sitemapindex files up to the depth you set;
  • reads gzip sitemap files with bounded decompression;
  • saves one row for each unique page URL;
  • keeps lastmod, changefreq, priority, and the first sitemap that contained the URL;
  • blocks private-network targets, unsafe redirects, XML DTD/entity input, oversized responses, and decompression bombs.

Good for

  • Build a clean URL inventory before a crawler or audit.
  • Export sitemap metadata for SEO or migration work.
  • Read a large sitemap index without visiting the listed pages.
  • Turn .xml.gz sitemap files into a normal Dataset.

Not a good fit

  • Bare website domains. Add the direct sitemap URL instead.
  • Login-protected or private-network sitemaps.
  • Page status checks. The Actor does not request discovered page URLs.
  • Image, video, news, or hreflang sitemap extensions.

Who uses it

SEO specialists

Build a URL list for an audit or a site migration.

Crawler builders

Get a seed list before you start a separate crawler.

Content managers

See which pages changed recently with the lastmod date.

Price

Pay per event: you pay for each result the tool saves, plus a small start fee for each run. The price includes Apify platform costs. Apify bills you, not us. Prices below are for the Apify free plan.

What you pay forPriceWhen
Start fee$0.02Charged once per run. This tool uses 1 GB of memory or less by default; more memory costs more.
Sitemap URL saved$0.00027One unique page URL saved to the default Dataset.

Examples

  • One URL: about $0.02.
  • 1,000 URLs: about $1.27 (50 runs of up to 20).
  • Every day 100 URLs, for 30 days: about $3.81 a month (5 runs a day).
  • 20 URLs once a week (4 runs a month): about $0.10 a month.

Free to try: the Apify free plan gives you $5 of usage every month, no credit card needed. That is enough for about 3,900 URLs.

Prices checked on 24 October 2026. See the current price on Apify.

Questions

Can I just add my domain?

No. Add the direct sitemap URL, for example example.com/sitemap.xml.

Does it open every page in the sitemap?

No. It reads the sitemap files only and saves the listed URLs.

Does it read .xml.gz files?

Yes. Gzip sitemaps are read and saved as normal rows.

Does it find a sitemap from a website homepage?

No. Add the direct sitemap URL, such as https://example.com/sitemap.xml.

Does it support sitemap indexes?

Yes. It follows nested indexes up to maxDepth and maxSitemaps.

Why are some metadata fields null?

They are optional in a sitemap. The Actor keeps null when the publisher does not provide a usable value.

Details

Step by step on Apify
  1. Open the Input tab.
  2. Add one direct public sitemap URL to Sitemap URLs (startUrls).
  3. Keep the default limits for the first run.
  4. Click Start.
  5. Open the Dataset and check the url and sitemapUrl fields.
Use cases
TaskInputMain outputTypical next step
Build an SEO URL inventorydirect sitemap or indexurl, lastmod, sitemapUrlExport to CSV/JSON for analysis
Prepare a crawl seed listdirect sitemap or indexdeduplicated url valuesSend URLs to a separate crawler
Review publisher sitemap hintssitemap URLlastmod, changefreq, priorityCompare in a spreadsheet
Read a compressed sitemap.xml.gz URLnormal Dataset rowsExport or call the Dataset API
Tips for better results
  • Add the direct sitemap link, not the home page.
  • Set the index depth to control how deep nested sitemaps go.
  • Sort by lastmod in a spreadsheet to find new pages.
Limits and good to know

partial means a limit or a failing sitemap prevented a full run. It can contain zero rows, such as when an index depth limit stops all children. Check RUN_SUMMARY for limitReached and bounded issue details.

  • Up to 20 start sitemap URLs per run
  • Up to 4000 unique page results
  • Up to 50 sitemap files when maxSitemaps is raised
  • Sitemap-index depth is bounded from 0 to 10
  • Fixed scan limits: 60 seconds of source work, 64 HTTP attempts (including retries and redirects), and 8 MiB of downloaded response bodies across the whole run
  • Each gzip file is capped at 5 MiB compressed and 8 MiB of XML. XML nesting is capped at 64 levels and each file at 50,000 entries
  • A smaller user spending limit can stop results early; summaries count only saved rows
  • Only public HTTP(S) targets on standard web ports are allowed

For developers

Sample result

One result from a real test run, in JSON. Real values change from run to run. In Excel or CSV each field is a column.

one result · JSON
{
  "url": "https://www.sitemaps.org/",
  "lastmod": "2016-11-21T00:00:00.000Z",
  "changefreq": null,
  "priority": null,
  "sitemapUrl": "https://www.sitemaps.org/sitemap.xml"
}

Use it from code

Actor ID: cliqtomedia/xml-sitemap-urls-extractor. You need your Apify API token from Apify Console → Settings → API & Integrations.

Python · apify-client
from apify_client import ApifyClient

client = ApifyClient("YOUR_APIFY_TOKEN")
run = client.actor("cliqtomedia/xml-sitemap-urls-extractor").call(run_input={
    "startUrls": [
        {
            "url": "https://www.sitemaps.org/sitemap.xml"
        }
    ],
    "maxDepth": 5
})
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)
cURL
curl -X POST "https://api.apify.com/v2/acts/cliqtomedia~xml-sitemap-urls-extractor/run-sync-get-dataset-items?token=YOUR_APIFY_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"startUrls": [{"url": "https://www.sitemaps.org/sitemap.xml"}], "maxDepth": 5}'
LangChain · langchain-apify
# pip install langchain-apify
# set APIFY_TOKEN in your environment
from langchain_apify import ApifyActorsTool

tool = ApifyActorsTool("cliqtomedia/xml-sitemap-urls-extractor")
result = tool.invoke({"run_input": {"startUrls": [{"url": "https://www.sitemaps.org/sitemap.xml"}], "maxDepth": 5}})
print(result)

The cURL call waits for the results, up to 300 seconds. For longer runs, start a run (/runs) and get the results with a webhook or by checking the run. Apify API docs. LlamaIndex, MCP for AI agents and the JavaScript client: AI agents & MCP.

Data fields (5)
FieldTypeMeaning
urlstringPage URL from the sitemap.
lastmodstringLast modification value, normalized to ISO 8601 when parseable.
changefreqstringPublisher-declared change frequency.
prioritynumberPublisher-declared priority between 0 and 1.
sitemapUrlstringFirst sitemap file that contained this deduplicated URL.
Input settings (8)

The main fields of the input form. With the API you send them as JSON.

SettingName in the APITypeExample value
Sitemap URLs requiredstartUrlsarray[{"url": "https://www.sitemaps.org/sitemap.xml"}]
Maximum index depthmaxDepthinteger5
Maximum sitemap filesmaxSitemapsinteger20
Maximum resultsmaxResultsinteger4000
Request timeoutrequestTimeoutSecsinteger20
Maximum retriesmaxRetriesinteger2
Maximum compressed sitemap bytesmaxCompressedBytesinteger5242880
Maximum XML bytesmaxDecompressedBytesinteger8388608

Use cases with this tool

Each guide shows all the steps and the other tools.

Start on Apify

Make a free Apify account: you get $5 of free usage every month. Missing a tool? Suggest it. We read every idea, but we do not promise to build it.

Apify links on this page are affiliate links. We may earn a commission. You pay the same price. Affiliate disclosure