AI Frameworks

SitemapKit + OpenAI Agents SDK

Build OpenAI agents that can discover and analyze website sitemaps. Give your agent the ability to map out any domain's content structure.

Written by SitemapKit Editorial TeamUpdated: Jul 21, 2026

Prerequisites

  • A SitemapKit API key kept outside browser and mobile client bundles.
  • A server-side OpenAI Agents SDK environment that can make HTTPS requests and parse JSON responses.

How to connect SitemapKit and OpenAI Agents SDK

  1. 1

    Store the API key for OpenAI Agents SDK

    Use the secret or environment-variable mechanism provided by your ai frameworks setup. Never expose the key in client-side code.

  2. 2

    Call the SitemapKit full endpoint

    Adapt the request shown in the OpenAI Agents SDK example below and send the target domain from a trusted server process.

  3. 3

    Map the response in OpenAI Agents SDK

    Handle discovered sitemap files, extracted URLs, lastmod values, truncation flags, and API errors before passing the result downstream.

Quick start

from agents import Agent, Runner, function_tool
import requests

@function_tool
def discover_sitemaps(domain: str) -> dict:
    """Discover all XML sitemaps on a domain."""
    resp = requests.post(
        "https://sitemapkit.com/api/v1/sitemap/full",
        headers={"x-api-key": "YOUR_API_KEY", "Content-Type": "application/json"},
        json={"url": domain}
    )
    data = resp.json()
    return {
        "sitemaps_found": len(data["sitemaps"]),
        "total_urls": len(data["urls"]),
        "sample_urls": [u["loc"] for u in data["urls"][:10]],
    }

agent = Agent(
    name="SEO Analyst",
    instructions="You analyze websites. Use discover_sitemaps to map out a domain.",
    tools=[discover_sitemaps],
)

result = Runner.run_sync(agent, "Analyze the sitemap of vercel.com")
print(result.final_output)

Continue with SitemapKit

Start using SitemapKit with OpenAI Agents SDK

100 free API calls/month. No credit card required.

More AI Frameworks integrations