Sitemap Extractor & Per-URL robots.txt Checker avatar

Sitemap Extractor & Per-URL robots.txt Checker

Pricing

from $0.20 / 1,000 results

Go to Apify Store
Sitemap Extractor & Per-URL robots.txt Checker

Sitemap Extractor & Per-URL robots.txt Checker

Give it a website. It reads robots.txt, finds and follows the sitemaps, and returns the listed URLs — up to the maxUrls cap — with last-modified dates, a page type, and whether robots.txt allows a crawler you name (Googlebot, GPTBot) to fetch it.

Pricing

from $0.20 / 1,000 results

Rating

0.0

(0)

Developer

Khristian Kopachelli

Khristian Kopachelli

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

9 days ago

Last modified

Categories

Features

Limited permissions

Share

Give it a website. It reads the site's robots.txt, finds the sitemaps, follows sitemap indexes, and returns the URLs the site lists — up to the maxUrls cap, and none at all from a site whose robots.txt cannot be read. Each URL comes with its last-modified date, the sitemap it came from, a simple page type, and a flag that says whether robots.txt allows a crawler you name (for example Googlebot or GPTBot) to fetch it.

It reads only the files that a site publishes for crawlers: robots.txt and sitemaps. It never opens the pages themselves.

What it is for

  • SEO audits. Get the URL list of a site, up to maxUrls per run. Find URLs that the sitemap lists and robots.txt blocks.
  • Crawlers, RAG pipelines, site migrations. Get the list of pages to fetch before you fetch anything.
  • AI crawler access. See which listed pages a given AI crawler may read.
  • AI agents. One call that answers "which pages does this site have?"

Input

FieldDefaultMeaning
startUrls (required)—Websites or sitemap files, at most 10,000. For a website, the Actor reads robots.txt and finds the sitemaps itself. For the address of a page, the root of its site is used. For a sitemap file (…/sitemap.xml, ….xml.gz, ….txt), only that sitemap is read.
maxUrls1000The run stops when it has returned this many URLs. The largest value is 1,000,000. There is no "unlimited".
robotsUserAgent*The crawler for which every URL is checked against robots.txt. Give the name (Googlebot, GPTBot); a whole User-Agent string works too — the name after compatible; is used.
includePatternsnoneRegular expressions (at most 100, of 300 characters each). A URL is kept if it matches at least one — in its written form or its decoded form, so /café/ also matches /caf%C3%A9/.
excludePatternsnoneRegular expressions (same limits). A URL that matches one is dropped.
modifiedAfternoneA date (YYYY-MM-DD). Keeps URLs whose last-modified date is that day or later. The day starts at 00:00 UTC and the sitemap dates are compared in UTC. URLs without a date are dropped when this is set.
discoverSitemapstrueWhen robots.txt names no sitemap, try the common addresses (see below).
includeExtensionsfalseAdd images and alternates (language versions) from the sitemap, at most 20 of each.
maxSitemaps500The run stops when it has read this many sitemap files; the common-path guesses and files that robots.txt closes for this Actor do not count. The largest value is 10,000.

A wrong input ends the run at once, with a message that names the field — unless only some start URLs are unusable: those are skipped, counted in the record OUTPUT and named in the status message, and the run fails only when none is usable. A broken regular expression is found before any request is made, and so is one the matching engine cannot run in guaranteed linear time (look-ahead and look-behind are not accepted); every accepted pattern answers in time proportional to the URL, so a pattern cannot hold the run.

Example input

{
"startUrls": [{ "url": "https://docs.apify.com" }],
"maxUrls": 1000,
"robotsUserAgent": "GPTBot"
}

This is the prefill input with robotsUserAgent changed to GPTBot: it reads the sitemaps of docs.apify.com and marks each URL with the robots.txt answer for GPTBot.

Output

Dataset: one item per URL

{
"url": "https://docs.apify.com/api",
"site": "https://docs.apify.com",
"sitemapUrl": "https://docs.apify.com/sitemap_base.xml",
"lastmod": null,
"changefreq": "weekly",
"priority": 0.5,
"urlType": "docs",
"robotsAllowed": true,
"robotsRule": null
}
FieldMeaning
urlA URL that the site lists in a sitemap. Every URL appears once per run, also after a restart.
siteOrigin (scheme, host and port) of the start URL.
sitemapUrlThe sitemap file that lists the URL.
lastmodThe last-modified date from the sitemap, as ISO 8601 in UTC. null when the sitemap gives no valid date.
changefreq, priorityAs the sitemap gives them. null when absent or not valid.
urlTypehome, product, category, article, docs, info, file or other. A rule on the path and the host name of the URL (see below), not a guess about the content.
robotsAllowedtrue or false: whether the site's robots.txt allows the crawler named in robotsUserAgent. null when it cannot be known: the URL has another scheme, host or port than the site — a robots.txt speaks only for its own origin.
robotsRuleThe line of robots.txt that decided, for example Disallow: /private/. null when no rule matches.
images, alternatesOnly with includeExtensions.

Key-value store: the record OUTPUT

A summary of the run. For every site: the status of robots.txt, the sitemaps it names, the crawl delay it asks for, and every sitemap file, with its type, its number of URLs, how many of them went to the dataset, and its error if there was one. Then the totals, and the reason if the run stopped early (maxUrls, maxSitemaps, or the spending limit).

A sitemap that cannot be read never fails the run. Its error is in the summary and the other sitemaps are read — unless the host itself stopped answering: then the site is reported unavailable and that host is not asked again in the run.

How it finds the sitemaps

  1. It reads /robots.txt of the site.
  2. If robots.txt has Sitemap: lines, it reads those sitemaps.
  3. If it has none, and discoverSitemaps is on, it tries these addresses in order and uses the first that holds a sitemap: /sitemap.xml, /sitemap_index.xml, /sitemap-index.xml, /wp-sitemap.xml, /sitemap.xml.gz, /sitemap.txt.
  4. A sitemap index is followed up to five levels deep. No sitemap is read twice.

What it reads: XML sitemaps (urlset) and sitemap indexes, plain-text sitemaps (one URL per line), and gzip files. Gzip is recognised by the content of the file, not by its name. An unescaped & in a URL, the most common defect of real sitemaps, is repaired and counted. The encoding the XML declaration names is honoured; a URL with bytes that no encoding could read is counted invalid, not delivered as a changed address. A file that is no sitemap — an HTML page, a "not found" answer in plain text or JSON — does not count, and the search for a sitemap goes on. A broken file gives the URLs that were read before the break, and an error in the summary. RSS and Atom feeds are not read.

When robots.txt is missing — any 4xx answer that is not a block — everything is allowed. When it cannot be read (a server error, no answer, or a block), the site is skipped and reported: what the site allows is then not known.

robots.txt may redirect, up to five hops. A hop to another host is followed only when that host's own robots.txt allows it — it is read first — except a hop to /robots.txt itself. When the redirect ends on /robots.txt of another host, that file is also that host's robots.txt. When it ends on any other page, the page is read as the start site's robots.txt, and the URLs of the other host get robotsAllowed: null: a page is not a robots.txt and decides nothing for its own host.

Page types

urlType is decided by these rules, in this order:

  1. home: the root of the site, also behind leading language or region segments (/en/, /de-at/, /es-419/). A root path with a query is other, not home: ?p=123 and index.php?route=… route by the query.
  2. file: the path ends in a file extension that is not a web page (.pdf, .jpg, .zip, .xml, …).
  3. The first path segment that names a kind of page decides:
    • a shop segment (products, product, item, dp, collections, category, shop, tag, …): product when a product segment is followed by the product itself (/products/blue-widget), else category (/products, /collections/shoes). /p/ counts as a product segment only when the segment after it holds a digit (/p/12345);
    • article: blog, news, articles, posts, press, stories, … — but article and articles give docs on a documentation host (rule 7);
    • docs: docs, help, support, guides, api, reference, faq, kb, tutorials, ….
  4. article: the path starts with a year and a month (/2026/03/…).
  5. product: the last segment ends in -p and a number (/pricing-p2, /about-p1).
  6. info: the first segment is about, contact, privacy, terms, legal, careers, pricing, …, or starts with one of those words followed by - or _ (/about-us, /privacy-policy). A page extension is ignored, so /about.html counts too.
  7. docs: the host starts with docs., help., support., developer. and the like. On such a host, shop segments and the -p<number> rule are not read as a shop or a product.
  8. other: everything else.

How it behaves on the web

  • It says who it is. Every request carries the User-Agent SitemapExtractorRobotsChecker/1.0 (+https://apify.com/kopachelli/sitemap-extractor-robots-checker). It does not pose as a browser or as another bot.
  • It obeys robots.txt for its own requests. A sitemap that robots.txt closes for this Actor is not fetched, and the summary says so. To address this Actor in a robots.txt, use the name SitemapExtractorRobotsChecker — a version or comment after it (SitemapExtractorRobotsChecker/1.0) names the same crawler. There is no input that turns this off.
  • robots.txt is read by RFC 9309. A User-agent line names a crawler by its product token; Allow/Disallow paths may hold * and a final $, and non-ASCII characters are compared in their percent-encoded form. A named group applies to the crawler of exactly that name; every other crawler gets the * groups.
  • It is slow on purpose. It sends one request at a time, at least 250 ms between two request starts, and a Crawl-delay of the site is honoured up to 10 seconds.
  • It retries once at most, on 429, on 503 and when there is no answer, and never sooner than the server asks. If the server asks to wait more than 30 seconds, or names a wait that cannot be read, it does not retry.
  • It never goes around a block. On 401, 403, 451, a challenge answer (the headers cf-mitigated: challenge or x-amzn-waf-action: challenge, captcha or signal, whatever the status), or 429 after the one retry, it stops for that site and reports it. A block is remembered for the whole run: another start URL of the same site is not asked again. It uses no proxy.
  • It leaves a silent host alone. When a host gives no answer or a server error three times in a row — a download that breaks off counts too — or asks for a wait longer than 30 seconds, it is not requested again in the run, and the site is reported unavailable.
  • It reads public addresses only: http and https, and no address of a private network — written out in any form, including the IPv6 transition addresses (NAT64, 6to4, Teredo) that carry a private IPv4 address inside.
  • It never carries a password. An address with a user name or a password — a Sitemap: line, a sitemap entry, a start URL or a redirect target — is read without them or refused, and the password reaches neither the dataset, the summary, the status message nor the log.

Pricing

The Actor uses Apify's pay-per-event model. Three events are charged:

  • apify-actor-start — once per run;
  • site-analyzed — once per site whose robots.txt was read (a site that is skipped or blocked is not charged);
  • apify-default-dataset-item — once per URL written to the dataset.

URLs dropped by the filters, duplicates and URLs of a site that could not be read are never written and never charged. The current prices are set in Console and shown on this page.

Limits

WhatLimit
robots.txtthe first 500 KB are read; a line cut at the limit is dropped; at most 1,000 Sitemap: lines are kept and the rest are counted in the summary
One sitemap60 MB after decompression; 256 KB between two markup events; a line or text node of 8,192 characters
Sitemap index depth5 levels
Waiting for an answer30 seconds; a pause of 30 seconds in a download ends it; one file may take 5 minutes
Redirects5 per request; every hop is checked against robots.txt
URLs per runmaxUrls, at most 1,000,000
Sitemap files per runmaxSitemaps, at most 10,000

When a run is interrupted

If the platform moves the run to another server, or the run is aborted gracefully, the Actor saves where it is — and the summary of the work so far — before it stops. The restarted run continues from there and does not return a URL twice.

Questions and answers

Does it fetch the pages the sitemap lists? No. It reads only robots.txt and sitemap files. Checking the pages themselves (status codes, titles, noindex) is a different kind of tool.

What does robotsAllowed: null mean? The URL is on another origin than the site — another scheme, host or port. A robots.txt speaks only for its own origin, so no answer can be given. It is not "blocked" and not "allowed".

What if the site has no robots.txt, or it is missing? A robots.txt that answers with a non-blocking 4xx (404 and the like) means everything is allowed, and the sitemaps are still found. When robots.txt cannot be read at all — a server error, no answer, or a block — the site is skipped and reported; what it allows is then unknown.

Can I check several crawlers at once? One crawler per run: robotsUserAgent takes a name such as Googlebot, GPTBot or ClaudeBot, or a whole User-Agent string (the name after compatible; is used). Run the Actor once per crawler for several answers.

Does it work on sites behind a CDN or a bot wall? If the site answers with a block — 401, 403, 451, a challenge page, or 429 after one retry — the Actor stops for that site and reports it. It does not pose as a browser and uses no proxy.

Support

Questions and bug reports: the Issues tab of this Actor's page. The version and the changelog are on the Actor's page too.