Languages

SitemapKit + JavaScript / Node.js

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.

Written by SitemapKit Editorial TeamUpdated: Jul 21, 2026

Prerequisites

  • A SitemapKit API key kept outside browser and mobile client bundles.
  • A server-side JavaScript / Node.js environment that can make HTTPS requests and parse JSON responses.

How to connect SitemapKit and JavaScript / Node.js

  1. 1

    Store the API key for JavaScript / Node.js

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

  2. 2

    Call the SitemapKit full endpoint

    Adapt the request shown in the JavaScript / Node.js example below and send the target domain from a trusted server process.

  3. 3

    Map the response in JavaScript / Node.js

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

Quick start

const API_KEY = "YOUR_API_KEY";
const BASE = "https://sitemapkit.com/api/v1/sitemap";

// Discover + extract in one call
const response = await fetch(`${BASE}/full`, {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    "x-api-key": API_KEY,
  },
  body: JSON.stringify({ url: "example.com" }),
});

const data = await response.json();
console.log(`Found ${data.sitemaps.length} sitemaps`);
console.log(`Extracted ${data.urls.length} URLs`);

// Process URLs
const recentUrls = data.urls
  .filter((u) => u.lastmod && u.lastmod > "2025-01-01")
  .map((u) => u.loc);

Continue with SitemapKit

Start using SitemapKit with JavaScript / Node.js

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

More Languages integrations