Use the SitemapKit API with Python's requests library to discover and extract sitemaps. Perfect for SEO scripts, data pipelines, and AI training data collection.
Use the secret or environment-variable mechanism provided by your languages setup. Never expose the key in client-side code.
Adapt the request shown in the Python example below and send the target domain from a trusted server process.
Handle discovered sitemap files, extracted URLs, lastmod values, truncation flags, and API errors before passing the result downstream.
import requests
API_KEY = "YOUR_API_KEY"
BASE = "https://sitemapkit.com/api/v1/sitemap"
# Discover sitemaps
resp = requests.post(f"{BASE}/discover", json={"url": "example.com"}, headers={
"x-api-key": API_KEY,
"Content-Type": "application/json",
})
sitemaps = resp.json()["sitemaps"]
print(f"Found {len(sitemaps)} sitemaps")
# Extract all URLs
resp = requests.post(f"{BASE}/full", json={"url": "example.com"}, headers={
"x-api-key": API_KEY,
"Content-Type": "application/json",
})
data = resp.json()
print(f"Extracted {len(data['urls'])} URLs")
# Filter by pattern
blog_urls = [u["loc"] for u in data["urls"] if "/blog/" in u["loc"]]Check authentication, endpoints, response fields, and limits.
Preview the URL extraction result before writing integration code.
See how teams use sitemap data in SEO and engineering workflows.
Look up lastmod, sitemap indexes, and other response concepts.
100 free API calls/month. No credit card required.
Integrate SitemapKit into your Node.js applications or serverless functions. Use fetch or axios to call the API and process sitemap data in your JavaScript projects.
Use SitemapKit with full TypeScript type safety. Define response types for sitemap data and integrate into your typed codebases.
Call the SitemapKit API from PHP using cURL. Ideal for WordPress plugins, Laravel applications, and PHP-based SEO tools.