{
  "openapi": "3.0.1",
  "info": {
    "title": "XML Sitemap URL Extractor & Sitemap to CSV",
    "description": "Get every URL from a website's XML sitemap as JSON, CSV or Excel. Give a domain or sitemap URL: it finds sitemaps via robots.txt, follows indexes and .gz files, and returns one row per page with lastmod, images and hreflang. Optional HTTP status check and new-page monitoring.",
    "version": "0.1",
    "x-build-id": "XixtYpmuS7bL594DM"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/swillz~sitemap-url-extractor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-swillz-sitemap-url-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/swillz~sitemap-url-extractor/runs": {
      "post": {
        "operationId": "runs-sync-swillz-sitemap-url-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/swillz~sitemap-url-extractor/run-sync": {
      "post": {
        "operationId": "run-sync-swillz-sitemap-url-extractor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "required": [
          "startUrls"
        ],
        "properties": {
          "startUrls": {
            "title": "Websites or sitemap URLs",
            "type": "array",
            "description": "Required. Array of objects, e.g. [{\"url\":\"https://example.com\"}] or [{\"url\":\"https://example.com/sitemap.xml\"}]. A home page triggers sitemap auto-discovery (robots.txt + common paths); a sitemap URL is read directly.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxUrls": {
            "title": "Max URLs (total)",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many URLs across all sites (default 1000; 0 = no limit). Large sites list 100k+ URLs: raise this deliberately. Also applies to API and AI-agent calls that omit it.",
            "default": 1000
          },
          "maxUrlsPerSite": {
            "title": "Max URLs per site",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many URLs from each start URL (0 = no limit). Useful when one big site would use up maxUrls.",
            "default": 0
          },
          "includeUrlPatterns": {
            "title": "Include URL patterns",
            "type": "array",
            "description": "Only output URLs matching at least one pattern. Use a glob (e.g. */blog/*) or a regular expression (e.g. /products/\\d+). Case-insensitive.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeUrlPatterns": {
            "title": "Exclude URL patterns",
            "type": "array",
            "description": "Drop URLs matching any of these globs or regular expressions (e.g. */tag/*).",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "lastmodFrom": {
            "title": "Modified after",
            "type": "string",
            "description": "Only URLs whose lastmod date is on/after this date. Absolute (2026-01-31) or relative (7 days, 24 hours, 2 weeks). URLs without lastmod are excluded when a date filter is set."
          },
          "lastmodTo": {
            "title": "Modified before",
            "type": "string",
            "description": "Only URLs whose lastmod date is on/before this date. Absolute or relative."
          },
          "onlyNewUrls": {
            "title": "Only new URLs since the last run (monitoring)",
            "type": "boolean",
            "description": "Remembers URLs between runs (in a named key-value store) and outputs only URLs not seen before. The first run outputs everything and saves the baseline. Ideal with a schedule to get alerts on new pages, products or articles.",
            "default": false
          },
          "stateKey": {
            "title": "Monitoring state key",
            "type": "string",
            "description": "Optional name for the remembered URL set. Defaults to a hash of the start URLs. Use different keys for independent monitors."
          },
          "checkUrlStatus": {
            "title": "Check HTTP status of every URL",
            "type": "boolean",
            "description": "Sends a HEAD request (GET fallback) to each output URL and adds httpStatus and finalUrl (redirect target). Finds broken (404) and redirected sitemap entries. Slower; charged as an extra event per URL.",
            "default": false
          },
          "statusCheckConcurrency": {
            "title": "Status check concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many HTTP status checks run at the same time (only with checkUrlStatus). Lower it if the site rate-limits you.",
            "default": 10
          },
          "includeImages": {
            "title": "Include image URLs",
            "type": "boolean",
            "description": "Add the image URLs listed for each page (image:loc tags in image sitemaps).",
            "default": false
          },
          "includeAlternates": {
            "title": "Include hreflang alternates",
            "type": "boolean",
            "description": "Add hreflang language alternates (xhtml:link tags) for each page.",
            "default": false
          },
          "restrictToStartPath": {
            "title": "Restrict to start URL path",
            "type": "boolean",
            "description": "When a start URL has a path (e.g. https://example.com/blog/), output only URLs under that path and try that path's own sitemap first.",
            "default": true
          },
          "discoverFromRobotsTxt": {
            "title": "Discover sitemaps from robots.txt",
            "type": "boolean",
            "description": "Read Sitemap: lines from /robots.txt when a website (not a sitemap) is given.",
            "default": true
          },
          "tryCommonSitemapPaths": {
            "title": "Try common sitemap paths",
            "type": "boolean",
            "description": "If robots.txt lists no sitemap, try /sitemap.xml, /sitemap_index.xml, /wp-sitemap.xml, /sitemap.txt and similar.",
            "default": true
          },
          "maxSitemapDepth": {
            "title": "Max sitemap index depth",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "How deep to follow nested sitemap indexes.",
            "default": 5
          },
          "maxSitemaps": {
            "title": "Max sitemap files",
            "minimum": 1,
            "type": "integer",
            "description": "Safety limit on the number of sitemap files fetched per run.",
            "default": 1000
          },
          "sitemapConcurrency": {
            "title": "Sitemap download concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Sitemap files fetched in parallel per site.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 180,
            "type": "integer",
            "description": "Timeout for each sitemap or status-check HTTP request, in seconds.",
            "default": 30
          },
          "maxRetries": {
            "title": "Max retries per request",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries on network errors, 403, 429 and 5xx with exponential backoff (honours Retry-After).",
            "default": 3
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Usually not needed — sitemaps are meant for bots. Enable Apify Proxy only for sites that block datacenter traffic.",
            "default": {
              "useApifyProxy": false
            }
          },
          "emitStatusRows": {
            "title": "Add status rows for empty sites",
            "type": "boolean",
            "description": "Add one free row (status \"no_results\" plus a reason) for each start URL that returned no URLs, so you or an AI agent can see why. Not charged. Turn off for a pure URL list.",
            "default": true
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}