API Documentation

Build, manage, and submit sitemaps programmatically. Integrate indexing pipelines with 100+ search engines.

Quick Start All endpoints require a valid API key passed in the Authorization header. Base URL: https://api.sitemap.xml/v1

Base URL

All API requests should be made to:

https://api.sitemap.xml/v1

Authentication

Authenticate your requests using API keys. Include your key in the Authorization header as a Bearer token.

# Example curl request curl -X GET https://api.sitemap.xml/v1/sitemaps \\ -H "Authorization: Bearer YOUR_API_KEY"

Keep your API keys secure. Never expose them in client-side code or public repositories. Generate keys from your Dashboard → API Settings.

Rate Limits

API requests are rate-limited to ensure stable performance across all users. Limits are applied per API key:

  • Starter: 100 requests/hour
  • Professional: 2,500 requests/hour
  • Enterprise: Custom limits (contact sales)

Rate limit headers are included in every response:

X-RateLimit-Limit: 2500 X-RateLimit-Remaining: 2498 X-RateLimit-Reset: 1699999999

Generate Sitemap

POST /sitemaps/generate

Initiates a full crawl of the target URL and generates an optimized XML sitemap. Supports dynamic content, pagination, and multi-language structures.

Request Body

ParameterTypeDescription
target_url RequiredstringThe root URL to crawl (e.g., https://example.com)
max_urls OptionalintegerMaximum URLs to include (default: 50000)
include_assets OptionalbooleanInclude images, videos, and news extensions
webhook_url OptionalstringURL to receive completion notifications

Example Request

curl -X POST https://api.sitemap.xml/v1/sitemaps/generate \\ -H "Content-Type: application/json" \\ -H "Authorization: Bearer YOUR_API_KEY" \\ -d '{ "target_url": "https://myapp.io", "max_urls": 10000, "include_assets": true }'

Success Response (202)

{ "id": "smap_8f3k29d1x4", "status": "processing", "target_url": "https://myapp.io", "created_at": "2025-01-15T08:30:00Z", "estimated_completion": "2025-01-15T08:45:00Z" }

Get Sitemap Status

GET /sitemaps/:id

Retrieve the current status, progress, and statistics for a generated sitemap.

Response Example

{ "id": "smap_8f3k29d1x4", "status": "completed", "urls_found": 8432, "urls_indexed": 8105, "size_kb": 1240, "download_url": "https://cdn.sitemap.xml/smaps/smap_8f3k29d1x4.xml", "completed_at": "2025-01-15T08:42:18Z" }

Submit for Indexing

POST /indexing/submit

Push URLs directly to major search engine indexing APIs (Google Indexing API, Bing, Yandex). Returns immediate acknowledgment with tracking IDs.

Request Body

ParameterTypeDescription
urls Requiredarray[string]List of URLs to submit (max 200 per request)
engines Optionalarray[enum]["google", "bing", "yandex"] (default: all)
priority Optionalstring"normal" or "urgent"

Errors

The API uses standard HTTP status codes and returns detailed error objects when requests fail:

400 Bad Request
401 Unauthorized
403 Forbidden
404 Not Found
429 Rate Limited
500 Server Error

Error Response Format

{ "error": { "code": "RATE_LIMIT_EXCEEDED", "message": "Too many requests. Please retry after 30s.", "documentation_url": "https://docs.sitemap.xml/errors/rate-limit" } }

SDKs & Libraries

Official client libraries are available for popular languages. They handle authentication, retries, and pagination automatically:

  • JavaScript/Node.js: npm install @sitemap/sdk
  • Python: pip install sitemap-client
  • Go: go get github.com/sitemap-xml/go-client
  • PHP: composer require sitemap/xml-sdk
Need more? Access our full SDK documentation, interactive Postman collection, or contact support for custom integrations.