v3.2.1

API Documentation

Welcome to the official Sitemap.xml API documentation. Our RESTful API allows you to programmatically generate, manage, and push XML sitemaps to search engines at scale. Whether you're building a custom crawler, integrating with a headless CMS, or automating SEO workflows, this guide has you covered.

Base URL: https://api.sitemap.xml/v3
All endpoints return JSON responses. Timestamps follow ISO 8601 format. Pagination uses cursor-based navigation for datasets over 100 items.

Authentication

Access the API using API keys generated from your dashboard. All requests must include an Authorization header with the Bearer token scheme.

Header
Authorization: Bearer sk_live_9f8e7d6c5b4a3210
Content-Type: application/json

Key Scopes

ScopeDescription
sitemaps:readFetch existing sitemaps and metadata
sitemaps:writeGenerate, update, and delete sitemaps
indexing:pushSubmit URLs to search engine APIs
analytics:readAccess coverage and performance metrics

Quick Start

Get up and running in under 2 minutes. Install the SDK, configure your environment, and make your first API call.

Terminal
npm install @sitemap/xml-sdk
# or
pip install sitemap-xml-py
# or
cargo add sitemap_xml_rs
JavaScript / Node.js
import { SitemapClient } from '@sitemap/xml-sdk';

const client = new SitemapClient({
  apiKey: process.env.SITEMAP_API_KEY,
  baseUrl: 'https://api.sitemap.xml/v3'
});

const result = await client.sitemaps.generate({
  url: 'https://example.com',
  depth: 3,
  include: ['css', 'js', 'images']
});

console.log(result.sitemapUrl);
Success! The API returned a temporary URL to your generated sitemap. It auto-expands to support up to 50,000 URLs using sitemap index files.

POST /sitemaps/generate

POST /v3/sitemaps/generate

Generate a dynamic sitemap from a live URL

Triggers a crawler that discovers all routes, handles JavaScript rendering, and outputs a valid XML sitemap compliant with W3C standards.

ParameterTypeDescription
url*stringThe root URL to crawl
depthintegerMax crawl depth (default: 3, max: 6)
includearrayAsset types to include (css, js, images, fonts)
userAgentstringCustom crawler user agent string

GET /sitemaps/{id}

GET /v3/sitemaps/{sitemap_id}

Retrieve a generated sitemap by ID

Returns metadata, download URL, expiration timestamp, and raw XML content if requested via query parameter ?format=xml.

POST /indexing/push

POST /v3/indexing/push

Submit URLs directly to search engine APIs

Bypasses standard crawl delays by pushing URLs to Google Indexing API, Bing Webmaster Tools, and Yandex simultaneously.

ParameterTypeDescription
urls*array[string]List of URLs to submit (max 500 per request)
providersarrayTarget engines: google, bing, yandex (default: all)
notifybooleanSend webhook on completion

GET /analytics/coverage

GET /v3/analytics/coverage

View indexing status and coverage metrics

Aggregate data on submitted URLs, indexing success rates, crawl errors, and estimated organic visibility score.

Error Handling

The API uses standard HTTP status codes. Errors return a JSON body with a structured error object.

CodeMeaning
400Bad Request - Invalid parameters or malformed JSON
401Unauthorized - Missing or invalid API key
403Forbidden - Insufficient scope or rate limit exceeded
429Too Many Requests - Backoff using Retry-After header
500Server Error - Internal failure (retry with exponential backoff)
Error Response Example
{
  "error": {
    "code": "rate_limit_exceeded",
    "message": "You have exceeded 100 requests per minute.",
    "docs": "https://docs.sitemap.xml/rate-limits"
  }
}

Official SDKs

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

  • JavaScript/TypeScript: @sitemap/xml-sdk (npm)
  • Python: sitemap-xml-py (PyPI)
  • Ruby: sitemap_ruby (RubyGems)
  • Go: github.com/sitemap-xml/go-sdk
  • PHP: sitemap/xml-php (Packagist)
Note: All SDKs require API version 3.0+. Legacy v2 endpoints are deprecated and will sunset on Dec 31, 2025.

Rate Limits

Rate limits are enforced per API key to ensure platform stability. Limits vary by plan tier.

PlanRequests/minConcurrent Crawls
Starter301
Professional2005
EnterpriseUnlimited20+

Frequently Asked Questions

How long does sitemap generation take?

Typically 15-45 seconds for sites under 10k pages. Larger sites are processed asynchronously, and you'll receive a webhook notification when ready.

Can I schedule automatic updates?

Yes. Use the Cron Builder in your dashboard or integrate with GitHub Actions / Vercel Cron using the /sitemaps/generate endpoint.

Do you support headless / SPA frameworks?

Absolutely. Our crawler uses a headless Chrome engine that fully renders React, Next.js, Vue, Nuxt, SvelteKit, and Angular applications before extracting routes.