Sitemap Validator avatar

Sitemap Validator

Pricing

$0.01 / actor start

Go to Apify Store
Sitemap Validator

Sitemap Validator

Pricing

$0.01 / actor start

Rating

0.0

(0)

Developer

Eichan Jolly

Eichan Jolly

Maintained by Community

Actor stats

0

Bookmarked

2

Total users

1

Monthly active users

4 days ago

Last modified

Categories

Features

Limited permissions

Share

Check a single public XML sitemap and get one predictable summary dataset item. Designed for SEO practitioners, site administrators, web developers and technical auditors who want a quick sitemap health check without logging in.

What it checks

  • Makes one HTTPS/HTTP GET request to the supplied sitemap URL (no redirect following).
  • Checks HTTP status, well-formed XML, and <urlset> or <sitemapindex> format.
  • For a URL sitemap, counts <url> entries, capped at 10,000, and flags missing/invalid <loc> values. urlCount is 0 for a sitemap index: this tool does not sum the URLs in its children.
  • For a sitemap index, checks up to 20 child sitemap URLs, including HTTP status, XML, supported root format and <loc> presence. Only children on the same scheme, hostname and standard port as the parent are fetched. Out-of-origin child URLs are reported but not requested.
  • Emits a single item with readable issues instead of aborting on a malformed or unreachable sitemap.

Example input

{"sitemapUrl":"https://search.gov/sitemap.xml"}

The prefill is an actual public sitemap URL referenced in Search.gov's documentation. Website availability may change. No example.com placeholders are needed.

Example output

Illustrative output (not an assertion about the current live Search.gov sitemap):

{
"sitemapUrl": "https://search.gov/sitemap.xml",
"httpStatus": 200,
"isValidXml": true,
"format": "urlset",
"urlCount": 3,
"childSitemaps": [],
"issues": [],
"status": "ok",
"error": null
}

For sitemap indices, format is index, urlCount is 0, and childSitemaps contains up to 20 objects with url, httpStatus (integer or null) and valid (boolean). format is invalid for unsupported XML. status is ok, issues, or error. A missing <loc> yields status: "issues"; malformed XML yields status: "error" and error containing a plain-language message.

Honest limitations

  • Not an exhaustive crawler: does not visit page <loc> URLs, verify page indexability, recursively traverse nested sitemap indices, or scan more than 20 index children.
  • The 10,000 entry counting cap applies to each document inspected; additional entries are not counted. A 10 MB downloaded/uncompressed XML limit also applies.
  • Only HTTP 200 responses are parsed, and HTTP redirects are not followed. Submit the final URL if a redirect occurs.
  • Private / special-use IP destinations, IP-literal URLs, non-standard ports, credentials, login paths and cross-origin child requests are blocked. Public DNS resolution and TLS validation are used. Child URL links discovered in the parent XML are read only within that same origin.
  • Valid XML does not guarantee an SEO-valid sitemap; the checks focus on basic XML shape and required <loc> values. A syntactically valid HTML document is not treated as a sitemap.
  • A sitemap index may contain external children. Such children appear in childSitemaps with valid: false and a safety-related issue rather than being fetched.

Run locally

Python 3.12+; standard library only. From this Actor folder:

$ACTOR_INPUT_JSON='{"sitemapUrl":"https://search.gov/sitemap.xml"}' python src/main.py

Or put input JSON in storage/key_value_stores/default/INPUT.json. Output is written as numbered items to storage/datasets/default/*.json. Set APIFY_LOCAL_STORAGE_DIR to change the local storage root.

On Apify, the Actor reads input from the run's default key-value store through GET /v2/key-value-stores/{id}/records/{inputKey} and appends output to its default dataset through POST /v2/datasets/{id}/items. It uses the automatically provided APIFY_TOKEN and run storage identifiers only—buyers provide no credentials. ACTOR_INPUT_JSON is a testing/local override. No SDK is installed.

Verification

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

Smoke runner executes python src/main.py as a subprocess with valid public-URL input and a local, controlled HTTPS fixture. See verification/script-mode-smoke.txt and verification/dataset-items.json. This is not evidence of successful live website access or an Apify cloud deployment.

Store / pricing recommendation

Category: DEVELOPER_TOOLS. Suggested: $0.004 per successful Actor run (pay-per-event, not per child or per dataset row); proposal only. No billing, listing, or publication configured. See store_metadata.json.