v2.4.0 Stable

Developer Documentation

Build, integrate, and scale your sitemap generation with our robust REST API, official SDKs, and real-time webhooks. Designed for reliability and developer experience.

Quick Start #

Get up and running in under 3 minutes. Install our CLI or use any HTTP client to start managing your sitemaps.

Terminal
# Install the CLI globally npm install -g @sitemap/cli # Authenticate with your project key sitemap auth YOUR_PROJECT_KEY # Initialize a new sitemap configuration sitemap init

Once initialized, run sitemap sync to crawl your domain and generate an optimized XML sitemap.

Authentication #

All API requests require authentication via Bearer tokens. Never expose your secret keys in client-side code.

  • API Key: Use your secret key from the Dashboard Settings. Prefixed with sm_sk_
  • Webhook Secrets: Used to verify payloads sent to your endpoints
  • OAuth 2.0: Available for enterprise integrations requiring user-level consent
cURL Example
curl https://api.sitemap.xml/v1/sitemaps \\ -H "Authorization: Bearer sm_sk_live_..." \\ -H "Content-Type: application/json"

Rate Limits #

Our API uses a sliding window rate limit algorithm. Limits vary by tier:

PlanRequests/minConcurrent Crawls
Starter601
Professional3005
EnterpriseUnlimitedCustom

When rate limited, the API returns 429 Too Many Requests with a Retry-After header. Implement exponential backoff for resilience.

Core Endpoints #

MethodEndpointDescription
GET/v1/sitemapsList all active sitemaps
POST/v1/sitemapsCreate & configure a new sitemap
GET/v1/sitemaps/:idFetch sitemap status & metadata
POST/v1/sitemaps/:id/submitPush to search engines instantly
DEL/v1/sitemaps/:idArchive & delete sitemap

Webhooks #

Receive real-time notifications when sitemaps are updated, indexed, or when crawl errors occur.

Webhook Payload Example
{ "id": "wh_9x2kL1mPqR", "event": "sitemap.updated", "timestamp": "2025-01-15T08:30:00Z", "data": { "sitemap_id": "smap_7fG3hJ2", "url_count": 1482, "status": "indexed", "errors": [] } }

SDK Examples #

Official libraries for JavaScript and Python. Full type definitions included.

JavaScript / TypeScript
import { SitemapClient } from '@sitemap/sdk'; const client = new SitemapClient({ apiKey: process.env.SITEMAP_API_KEY }); const sitemap = await client.create({ domain: 'https://myapp.com', schedule: 'daily', includeImages: true }); console.log(`Generated: ${sitemap.url}`);