API & Integrations v24

Programmatic access to dynamic sitemap generation, search engine submission, and real-time indexing pipelines. Designed for high-throughput applications.

Base URL https://api.sitemapxml.com/v24

Overview #

The Sitemap.xml v24 API provides RESTful endpoints to generate, validate, submit, and monitor XML sitemaps at scale. All responses are JSON-formatted and support standard HTTP status codes.

📌 Important: API v24 introduces asynchronous processing for payloads exceeding 10,000 URLs. Use polling endpoints or webhooks to track completion.
POST https://api.sitemapxml.com/v24/sitemaps/generate
-H "Authorization: Bearer sk_live_8f7d..."
-H "Content-Type: application/json"
-d '{
  "url": "https://example.com",
  "depth": 4,
  "output": "xml",
  "include_robots": true
}'

Authentication #

Access the API using Bearer tokens. Generate keys in your Dashboard → API Keys. Tokens are scoped to specific workspace permissions.

  • sk_live_* — Production environments
  • sk_test_* — Sandbox/testing (no real indexing)
  • rs_* — Read-only tokens for monitoring/status checks

All requests must include the Authorization header. Invalid or expired tokens return 401 Unauthorized.

Rate Limits #

Rate limits are applied per API key and reset every 60 seconds. Exceeding limits returns 429 Too Many Requests with a Retry-After header.

Plan Requests / min Max URLs / request Concurrent Jobs
Starter605001
Professional60010,0005
Enterprise3,0001,000,000Unlimited

Core Endpoints #

Generate Sitemap POST /sitemaps/generate

Initiates a crawl and sitemap generation job. Returns a job_id for tracking.

Request Body
// Supported parameters
{
  "url": "https://yoursite.com",       // Required: Base domain to crawl
  "depth": 3,                          // Optional: Crawl depth (1-6)
  "format": "xml",                      // xml, html, json
  "compression": true,                  // gzip output
  "custom_headers": {                  // Optional: Auth cookies/headers
    "Cookie": "session=abc123"
  }
}

Job Status GET /sitemaps/{job_id}/status

Check generation progress, error logs, and final download URLs.

Response
{
  "job_id": "sm_9x2kLp4mQ",
  "status": "completed",       // queued, crawling, processing, completed, failed
  "urls_found": 1428,
  "created_at": "2025-01-15T08:30:00Z",
  "download": "https://cdn.sitemapxml.com/v24/sm_9x2kLp4mQ.xml.gz"
}

Submit to Search Engines POST /sitemaps/{job_id}/submit

Pushes generated sitemaps to Google Search Console, Bing Webmaster, and Yandex automatically.

Webhooks #

Configure webhook endpoints in your dashboard to receive real-time events. All payloads are signed with HmacSHA256 using your webhook secret.

🚀

job.completed

Triggered when sitemap generation finishes successfully.

⚠️

job.failed

Returned with error details and crawl logs when a job terminates prematurely.

📤

indexing.confirmed

Search engines have acknowledged your sitemap submission.

Official SDKs #

First-party libraries with automatic retries, pagination, and TypeScript definitions.

🟢 Node.js / Deno

npm install @sitemapxml/sdk

Stable

🐍 Python

pip install sitemapxml-py

Stable

⚡ Go

go get github.com/sitemapxml/go-sdk

Stable

🐘 PHP

composer require sitemapxml/php

Beta

Platform Integrations #

One-click plugins and headless connectors for major ecosystems. No API key required for basic usage.

🔵 WordPress

Auto-generates sitemaps on post/page publish. Supports WooCommerce.

🟠 Shopify

Syncs product & collection URLs. Handles pagination & filters.

⚫ Next.js / Nuxt

Middleware hook for SSR/SSG routes. Generates on build or runtime.

🟣 Strapi / Directus

Headless CMS webhook trigger. Maps content types to sitemap URLs.

Error Codes #

Standard HTTP error codes with extended machine-readable identifiers in the response body.

CodeMeaningAction
400INVALID_PARAMSCheck required fields & URL format
401UNAUTHORIZEDVerify API key scope & expiration
403FORBIDDEN_DOMAINDomain not verified in workspace
429RATE_LIMITEDExponential backoff. Check Retry-After
503UPSTREAM_TIMEOUTTarget site rejected crawl. Verify robots.txt