Authentication

All API requests must include your secret API key in the Authorization header using the Bearer scheme.

ℹ️
Keep your API key secure. Never expose it in client-side code or public repositories.
Header
Authorization: Bearer sk_live_8f7d6c5b4a3e2f1g0h9i8j7k6l5m4n3

Rate Limits

API access is throttled based on your subscription tier to ensure platform stability.

TierRequests / minBurst Limit
Starter3010
Professional12040
Enterprise1000200

When rate limited, the API returns 429 Too Many Requests with a Retry-After header.

Endpoints

POST /v1/sitemaps/generate

Triggers a full crawl and generates a new XML sitemap for the specified domain.

Parameters

NameTypeRequiredDescription
domainstringRequiredThe root domain to crawl
max_depthintegerOptionalMax crawl depth (1-10). Default: 5
include_assetsbooleanOptionalInclude images & videos. Default: false

Example Request

cURL
curl -X POST https://api.sitemap.xml/v1/sitemaps/generate \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "example.com",
    "max_depth": 4,
    "include_assets": true
  }'

Example Response

JSON (202 Accepted)
{
  "id": "sm_9f8e7d6c5b4a",
  "status": "processing",
  "domain": "example.com",
  "urls_discovered": 142,
  "estimated_completion": "2025-01-15T10:30:00Z"
}
GET /v1/sitemaps/status/{id}

Check the real-time status of a sitemap generation job.

cURL
curl -X GET https://api.sitemap.xml/v1/sitemaps/status/sm_9f8e7d6c5b4a \
  -H "Authorization: Bearer $API_KEY"
JSON (200 OK)
{
  "id": "sm_9f8e7d6c5b4a",
  "status": "completed",
  "download_url": "https://cdn.sitemap.xml/sm_9f8e7d6c5b4a.xml",
  "total_urls": 158,
  "completed_at": "2025-01-15T10:28:45Z"
}
PUT /v1/sitemaps/submit/{id}

Pushes the generated sitemap directly to Google, Bing, and Yandex indexing APIs.

⚠️
This action consumes 1 submission credit per search engine configured.
cURL
curl -X PUT https://api.sitemap.xml/v1/sitemaps/submit/sm_9f8e7d6c5b4a \
  -H "Authorization: Bearer $API_KEY" \
  -d '{
    "engines": ["google", "bing", "yandex"],
    "notify_webhook": true
  }'

Error Codes

The API uses standard HTTP status codes and returns detailed error messages in JSON.

CodeMeaningResolution
400Bad RequestMissing or invalid parameters
401UnauthorizedInvalid or missing API key
403ForbiddenInsufficient permissions or tier limits
404Not FoundResource ID does not exist
429Rate LimitedSlow down requests per tier limits
500Server ErrorInternal failure. Contact support.
JSON (401 Example)
{
  "error": "unauthorized",
  "message": "The provided API key is invalid or has expired.",
  "code": 401,
  "request_id": "req_8x7c6v5b4n3m2a1"
}