API Reference

Integrate the Sitemap.xml API into your application to programmatically generate, manage, and submit sitemaps to search engines. All endpoints require authentication and support JSON request/response formats.

Base URL https://api.sitemapxml.com/v1
All API requests must be made over HTTPS. Calls made over plain HTTP will fail with a 403 status code.

Authentication

The API uses API keys to authenticate requests. You can manage your API keys from the Dashboard → Settings. Include your key in the Authorization header using the Bearer scheme.

HTTP Header
Authorization: Bearer sm_live_4eC39HqLyjWDarjtT1zdp7dc
⚠️ Security Notice Never expose your live API keys in client-side code or public repositories. Use environment variables and restrict key permissions per project.

Sitemaps

POST /sitemaps Generate a new sitemap

Creates a new sitemap project or triggers a fresh crawl of an existing one. Returns a job ID for async processing.

Request Parameters

ParameterTypeDescription
url *required string The root URL to crawl (e.g., https://example.com)
type optional string Sitemap format: xml (default), html, json
max_pages optional integer Maximum number of URLs to discover (default: 50,000)
webhook_url optional string URL to receive completion callback

Example Request

JSON
{
  "url": "https://example.com",
  "type": "xml",
  "max_pages": 10000,
  "webhook_url": "https://hooks.yoursite.com/sitemap-complete"
}

Response

JSON
{
  "id": "smap_8f7a2c1d9e",
  "status": "processing",
  "created_at": "2025-06-12T10:15:30Z",
  "download_url": "https://cdn.sitemapxml.com/smap_8f7a2c1d9e.xml"
}

Status Codes

202 Accepted
400 Invalid URL
401 Unauthorized
429 Rate Limited
GET /sitemaps/{sitemap_id} Retrieve sitemap details

Fetch metadata, status, and download links for a specific sitemap generation job.

Path Parameters

ParameterTypeDescription
sitemap_id *requiredstringUnique identifier returned from creation request
cURL
curl -X GET "https://api.sitemapxml.com/v1/sitemaps/smap_8f7a2c1d9e" \
  -H "Authorization: Bearer $API_KEY"

Indexing

POST /indexing/submit Push URL to search engines

Immediately notifies Google, Bing, and Yandex about a new or updated URL. Bypasses standard crawl schedules.

ParameterTypeDescription
url *requiredstringFully qualified URL to index
engines optionalarray[string]Target engines: ["google", "bing", "yandex"] (default: all)
priority optionalstringnormal (default) or high
Response
{
  "success": true,
  "job_id": "idx_9a2b1c3d",
  "estimated_crawl_time": "2-5 minutes",
  "engines_notified": ["google", "bing"]
}
POST /indexing/batch Bulk URL submission

Submit up to 1,000 URLs in a single request. Ideal for e-commerce product updates or blog publishing pipelines.

💡 Tip For lists exceeding 1,000 URLs, chunk your payloads and use the idempotency_key header to safely retry failed batches.