XML Sitemap Generator API
Generate sitemap.xml from a list of URLs (with optional lastmod, changefreq and priority), validated against the sitemaps.org protocol.
POST /api/v1/tools/sitemap-generatorMCP sitemap_generatorWeb & SEOTurn a list of URLs into a valid XML sitemap with lastmod, changefreq and priority, split large lists with a sitemap index, or check an existing sitemap.
Input
Send these as a JSON object. Unknown fields are rejected.
- urls
- One absolute URL per line. A line may add a lastmod date (W3C format, e.g. 2026-01-31), a changefreq and a priority (0.0 to 1.0), in any order, separated by commas or spaces, e.g. "https://example.com/, 2026-01-01, weekly, 0.8". (string, required)
- lastmod
- Default lastmod for lines without one, e.g. 2026-10-20. (string, up to 40 characters)
- changefreq
- Default changefreq for lines without one. (string, one of always, hourly, daily, weekly, monthly, yearly, never)
- priority
- Default priority for lines without one. (number, 0 to 1)
curl https://pithlab.com/api/v1/tools/sitemap-generator \n -H "Authorization: Bearer $PITHLAB_KEY" \n -H "Content-Type: application/json" \n -d '{"urls":"https://example.com/, 2026-10-01, daily, 1.0\nhttps://example.com/about\nhttps://example.com/blog/first-post","changefreq":"monthly"}'Example response
{
"ok": true,
"result": {
"files": [
{
"filename": "sitemap.xml",
"xml": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<urlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\">\n <url>\n <loc>https://example.com/</loc>\n <lastmod>2026-10-01</lastmod>\n <changefreq>daily</changefreq>\n <priority>1.0</priority>\n </url>\n <url>\n <loc>https://example.com/about</loc>\n <changefreq>monthly</changefreq>\n </url>\n <url>\n <loc>https://example.com/blog/first-post</loc>\n <changefreq>monthly</changefreq>\n </url>\n</urlset>\n",
"count": 3
}
],
"index": null,
"urlCount": 3,
"duplicatesRemoved": 0,
"errors": [],
"warnings": []
}
}