ForHosting KIT · SEO

Generate a sitemap

Plenty of sites launch, grow, and lose pages to a broken build script long before anyone notices the sitemap stopped matching reality. This endpoint crawls the site itself rather than trusting a CMS plugin, and emits a sitemap.xml that reflects what actually exists right now.

● StablePer request + per page$0.002
Use it from WebAPIEmailApp soonTelegram soon

The gap between a CMS sitemap and the real site

Most sitemap plugins only know about the pages their own database table tracks — they miss static pages bolted on outside the CMS, forget to drop URLs that were deleted, and rarely notice a staging subdomain accidentally left crawlable. A generator that actually follows links the way a search engine would catches all of that, because it is reporting on the site as it is, not as the database thinks it is.

How the crawl behaves

Give it a starting URL and it follows internal links breadth-first, respecting robots.txt directives and any noindex signals it encounters, so pages you have deliberately excluded stay excluded. It stops at the site's own domain boundary by default, so a footer link to a partner site will not send the crawl wandering. The result is valid sitemap.xml XML, following the same protocol search engines expect, with lastmod dates set from what the pages themselves reveal.

Why the format still matters in 2026

Even with sites now discovered constantly through links, feeds and social sharing, a sitemap remains the one signal a site owner controls directly, telling engines which URLs are canonical and worth revisiting. For large catalogs, newly launched sections, or sites with thin internal linking, it is often the fastest way to get fresh pages noticed at all.

What you get back and when

The task runs asynchronously — you submit the domain, receive a task_id right away, and the finished sitemap.xml arrives through your webhook or a signed link once the crawl completes. Larger sites simply take longer to crawl; there is no separate 'large site' pricing tier, the per-request cost stays the same.

Handling a messy or half-broken site

Redirect loops, timeouts and malformed HTML are common on real sites, and the crawler is built to work around them rather than abort. It caps redirect chains, skips URLs that clearly loop back on themselves, and keeps going past individual page errors so one broken template does not stall the whole crawl. If the domain itself is unreachable after three attempts, the task fails with a specific error and you are not charged for it.

Post-migration sitemap rebuild

Regenerate sitemap.xml from scratch right after a redesign, instead of trusting an old plugin export that still lists pages that no longer exist.

Sites without a CMS

Produce a valid sitemap for a static site or custom-built application that has no plugin ecosystem to generate one automatically.

Catching orphaned or forgotten pages

Compare the crawled sitemap against the CMS-generated one to spot pages that are live but invisible to the site's own sitemap logic.

Scheduled freshness checks

Re-run the crawl monthly for a content-heavy site to keep lastmod dates and the URL list aligned with what actually got published.

How does this sitemap generator api differ from a CMS plugin?

It crawls the live site by following actual links rather than reading a database table, so it captures pages a plugin would miss and drops pages that no longer exist.

Does it respect robots.txt and noindex tags?

Yes, the crawl honors robots.txt disallow rules and skips pages carrying a noindex directive.

Will it crawl external domains linked from the site?

No, by default the crawl stays within the starting domain's boundary.

Is there a free trial to test it first?

There's no free tier — free tiers get abused and slow everyone down. Access runs on a prepaid ForHosting KIT balance: top up from $10.00 (it never expires) and each request is charged at its published price, so a call with no balance returns HTTP 402. No subscription, no tokens, no invented credits, and a failed task is never charged.

What does the sitemap generator api cost?

A flat $0.002 per request, independent of how many pages the crawl finds.

How large a site can it handle?

There is no hard page cap; larger sites simply take proportionally longer to crawl before the sitemap is ready.

How do I retrieve the finished sitemap.xml?

Via a signed webhook notification when the crawl finishes, or a signed link that remains valid for 24 hours.

What happens if the site is temporarily down during the crawl?

The task retries automatically up to three times; if the site stays unreachable, it fails with a clear error and is never charged.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/seo/sitemap-generate

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, and soon from our app, email and Telegram.

curl -X POST https://api.kit.forhosting.com/seo/sitemap-generate \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"…"}'
{
  "input": "…"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "seo.sitemap_generate",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.
413input_too_largeThe file exceeds the size limit.

Read the full KIT documentation →