v1.2.0
API Documentation
Integrate Sitemap.xml into your workflow. Generate, monitor, and submit sitemaps programmatically with our RESTful API. All requests use JSON and require HTTPS.
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.
| Tier | Requests / min | Burst Limit |
|---|---|---|
| Starter | 30 | 10 |
| Professional | 120 | 40 |
| Enterprise | 1000 | 200 |
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
| Name | Type | Required | Description |
|---|---|---|---|
| domain | string | Required | The root domain to crawl |
| max_depth | integer | Optional | Max crawl depth (1-10). Default: 5 |
| include_assets | boolean | Optional | Include 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.
| Code | Meaning | Resolution |
|---|---|---|
| 400 | Bad Request | Missing or invalid parameters |
| 401 | Unauthorized | Invalid or missing API key |
| 403 | Forbidden | Insufficient permissions or tier limits |
| 404 | Not Found | Resource ID does not exist |
| 429 | Rate Limited | Slow down requests per tier limits |
| 500 | Server Error | Internal failure. Contact support. |
JSON (401 Example)
{
"error": "unauthorized",
"message": "The provided API key is invalid or has expired.",
"code": 401,
"request_id": "req_8x7c6v5b4n3m2a1"
}