API Reference

Programmatically generate sitemaps, push URLs to search engines, and monitor indexing status. Our RESTful API is designed for reliability, speed, and developer experience.

Base URL

Base Endpoint
https://api.sitemap.xml/v1

All API requests must be made over HTTPS. Calls made over plain HTTP will fail. API requests without authentication will also fail.

Authentication

The Sitemap.xml API uses API keys for authentication. You can generate and manage your API keys in the Dashboard.

Include your key in the Authorization header using Bearer token format:

Header
Authorization: Bearer sk_live_your_api_key_here

Never expose your secret API keys in client-side code. Use restricted keys or a backend proxy for browser-based applications.

Rate Limits

API requests are rate-limited based on your subscription tier. Exceeding limits will result in a 429 Too Many Requests response.

Plan Requests / Minute Concurrent Requests
Starter1005
Professional1,00025
Enterprise10,000Unlimited

When rate-limited, include the Retry-After header in your logic to implement exponential backoff.

Generate Sitemap

POST /sitemaps

Initiates a crawl of the specified domain and generates an XML sitemap. Returns immediately with a job ID for polling.

Request Body

ParameterTypeDescription
domain RequiredstringThe root domain to crawl (e.g., example.com)
max_urls OptionalintegerMaximum number of URLs to include (default: 50000)
include_assets OptionalbooleanInclude images and videos (default: true)
ignore_paths OptionalarrayRegex patterns to exclude from crawling
Request
curl -X POST https://api.sitemap.xml/v1/sitemaps \\
  -H "Authorization: Bearer sk_live_..." \\
  -H "Content-Type: application/json" \\
  -d '{
    "domain": "shopwave.io",
    "max_urls": 10000,
    "ignore_paths": ["/admin/.*", "/cart"]
  }'

Response

202 Accepted
{
  "status": "processing",
  "sitemap_id": "sm_8f9a2b3c4d5e",
  "estimated_completion": 120,
  "webhook_url": null
}

Check Sitemap Status

GET /sitemaps/{id}

Retrieve the status of a previously generated sitemap and download URL if completed.

Response
{
  "status": "completed",
  "urls_found": 4829,
  "generated_at": "2025-01-15T08:30:00Z",
  "download_url": "https://cdn.sitemap.xml/sm_8f9a...xml",
  "expires_at": "2025-02-15T08:30:00Z"
}

Push to Search Engines

POST /index/push

Directly submit URLs to Google, Bing, and Yandex indexing APIs. Triggers immediate crawling.

ParameterTypeDescription
urls RequiredarrayList of URLs to submit (max 100 per request)
engines OptionalarrayTarget engines: ["google", "bing"]
200 OK
{
  "submitted": 15,
  "failed": 0,
  "estimated_crawl_time": "2-15 minutes"
}

Indexing Analytics

GET /analytics/overview

Returns indexing statistics, coverage issues, and crawl frequency for your connected domains.

Query Parameters
domain: example.com
period: 7d|30d|90d (default: 30d)

Error Handling

The API uses conventional HTTP status codes. Errors are returned in JSON format with a structured payload.

400
Bad Request - Invalid parameters
401
Unauthorized - Missing/invalid key
403
Forbidden - Insufficient permissions
429
Rate Limited - Slow down
500
Server Error - Try again later
Error Response
{
  "error": {
    "code": "invalid_domain",
    "message": "The provided domain does not resolve or is blocked.",
    "request_id": "req_9x8c7v6b5n4"
  }
}

Pagination

List endpoints return paginated results. Use the cursor parameter to fetch the next page.

Pagination Example
{
  "data": [ // array of items ],
  "has_more": true,
  "next_cursor": "eyJpZCI6MTAwfQ==",
  "limit": 20
}