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.
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"]]sk_live_* API key./api/v1/sitemap/full endpoint to discover and extract all sitemaps from a domain in one call.POST /api/v1/sitemap/discover — Find all sitemaps on a domainPOST /api/v1/sitemap/extract — Parse a sitemap URL and extract all URLsPOST /api/v1/sitemap/full — Discover + extract in one call (recommended)100 free API calls/month. No credit card required.