← All integrations
Languages

SitemapKit + TypeScript

Use SitemapKit with full TypeScript type safety. Define response types for sitemap data and integrate into your typed codebases.

Quick Start

type SitemapUrl = {
  loc: string;
  lastmod?: string;
  changefreq?: string;
  priority?: number;
};

type FullResponse = {
  sitemaps: string[];
  urls: SitemapUrl[];
  metadata: { totalUrls: number; cached: boolean };
};

async function getSitemapData(domain: string): Promise<FullResponse> {
  const res = await fetch("https://sitemapkit.com/api/v1/sitemap/full", {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
      "x-api-key": process.env.SITEMAPKIT_API_KEY!,
    },
    body: JSON.stringify({ url: domain }),
  });

  if (!res.ok) throw new Error(`API error: ${res.status}`);
  return res.json() as Promise<FullResponse>;
}

const data = await getSitemapData("example.com");
console.log(`${data.urls.length} URLs extracted`);

How it works

  1. Get your API key — Sign up for a free SitemapKit account to get your sk_live_* API key.
  2. Call the API — Use the /api/v1/sitemap/full endpoint to discover and extract all sitemaps from a domain in one call.
  3. Process the data — The response includes structured JSON with all URLs, lastmod dates, and sitemap metadata.

API Endpoints

  • POST /api/v1/sitemap/discover — Find all sitemaps on a domain
  • POST /api/v1/sitemap/extract — Parse a sitemap URL and extract all URLs
  • POST /api/v1/sitemap/full — Discover + extract in one call (recommended)

Start using SitemapKit with TypeScript

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

More Languages integrations