Use SitemapKit as a tool in LangChain agents or as a URL source for document loaders. Get all URLs from a domain to build RAG pipelines.
Use the secret or environment-variable mechanism provided by your ai frameworks setup. Never expose the key in client-side code.
Adapt the request shown in the LangChain 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.
from langchain.tools import tool
from langchain_community.document_loaders import WebBaseLoader
import requests
@tool
def get_sitemap_urls(domain: str) -> list[str]:
"""Get all URLs from a domain's sitemap using SitemapKit API."""
resp = requests.post(
"https://sitemapkit.com/api/v1/sitemap/full",
headers={"x-api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
json={"url": domain}
)
return [u["loc"] for u in resp.json()["urls"]]
# Use in a RAG pipeline
urls = get_sitemap_urls.invoke("docs.example.com")
loader = WebBaseLoader(urls[:50]) # Load first 50 pages
docs = loader.load()
# Now index docs into your vector store
from langchain_community.vectorstores import FAISS
from langchain_openai import OpenAIEmbeddings
vectorstore = FAISS.from_documents(docs, OpenAIEmbeddings())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.
Feed sitemap URLs into LlamaIndex for building knowledge bases. Discover all pages on a domain, then index them for RAG-based question answering.
Use SitemapKit to discover all URLs, then crawl them with Crawl4AI for LLM-friendly content extraction. The perfect combination for building AI training datasets.
Build OpenAI agents that can discover and analyze website sitemaps. Give your agent the ability to map out any domain's content structure.