{
  "openapi": "3.0.1",
  "info": {
    "title": "Sitemap Robots Delta Monitor",
    "description": "Monitor sitemap.xml and robots.txt for URL inventory changes and return new, changed, or removed URLs in normalized JSON.",
    "version": "0.1",
    "x-build-id": "DqmnHRf0O3rMNUSxJ"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/tom_the_builder~sitemap-robots-delta-monitor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-tom_the_builder-sitemap-robots-delta-monitor",
        "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/tom_the_builder~sitemap-robots-delta-monitor/runs": {
      "post": {
        "operationId": "runs-sync-tom_the_builder-sitemap-robots-delta-monitor",
        "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/tom_the_builder~sitemap-robots-delta-monitor/run-sync": {
      "post": {
        "operationId": "run-sync-tom_the_builder-sitemap-robots-delta-monitor",
        "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",
        "properties": {
          "mode": {
            "title": "Run mode",
            "enum": [
              "snapshot",
              "delta"
            ],
            "type": "string",
            "description": "Use snapshot to return the current URL inventory, or delta to return only new, changed, and removed URLs compared with the previous run for the same state key.",
            "default": "snapshot"
          },
          "changeMode": {
            "title": "Delta mode",
            "enum": [
              "new_only",
              "new_and_changed"
            ],
            "type": "string",
            "description": "Choose whether delta runs return only new URLs or both new and changed URLs. Removed URLs are included when includeRemoved is enabled.",
            "default": "new_and_changed"
          },
          "stateKey": {
            "title": "State key",
            "type": "string",
            "description": "Persistent state namespace. Use a stable key per monitored website group.",
            "default": "sitemap-robots-default"
          },
          "sites": {
            "title": "Website base URLs",
            "type": "array",
            "description": "Website base URLs. The Actor discovers Sitemap declarations from robots.txt and /sitemap.xml.",
            "items": {
              "type": "string"
            }
          },
          "sitemapUrls": {
            "title": "Direct sitemap URLs",
            "type": "array",
            "description": "Optional direct sitemap.xml or sitemap index URLs.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "includeRobotsSitemaps": {
            "title": "Read robots.txt Sitemap lines",
            "type": "boolean",
            "description": "Discover Sitemap: declarations from /robots.txt.",
            "default": true
          },
          "includeDefaultSitemap": {
            "title": "Try /sitemap.xml",
            "type": "boolean",
            "description": "Also try the common /sitemap.xml location.",
            "default": true
          },
          "sameHostOnly": {
            "title": "Same host only",
            "type": "boolean",
            "description": "Keep sitemap URLs and listed pages on the same hostname as the input site.",
            "default": true
          },
          "maxSitemapsPerSite": {
            "title": "Max sitemaps per site",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Maximum sitemap files to read per site, including sitemap indexes.",
            "default": 10
          },
          "maxUrlsPerSite": {
            "title": "Max URLs per site",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum sitemap URL records to collect per site before delta filtering.",
            "default": 1000
          },
          "maxItems": {
            "title": "Max output items",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "Maximum dataset items to write after snapshot or delta selection.",
            "default": 100
          },
          "includePatterns": {
            "title": "Include URL regex patterns",
            "type": "array",
            "description": "Optional JavaScript regex patterns. If set, only matching URLs are kept.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "title": "Exclude URL regex patterns",
            "type": "array",
            "description": "Optional JavaScript regex patterns for URLs to exclude.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "checkStatus": {
            "title": "Check URL HTTP status",
            "type": "boolean",
            "description": "Use lightweight HEAD requests for listed URLs. This is slower but useful for sitemap QA.",
            "default": false
          },
          "includeRemoved": {
            "title": "Include removed URLs",
            "type": "boolean",
            "description": "On delta runs, report URLs that existed in the previous state but no longer appear.",
            "default": true
          },
          "includeUnchanged": {
            "title": "Include unchanged URLs",
            "type": "boolean",
            "description": "On delta runs, also include unchanged URLs. Usually leave this off for low-noise monitoring.",
            "default": false
          },
          "webhookMode": {
            "title": "Webhook payload",
            "enum": [
              "summary",
              "full"
            ],
            "type": "string",
            "description": "Full includes all output items in WEBHOOK_PAYLOAD. Summary includes the first 20.",
            "default": "full"
          },
          "userAgent": {
            "title": "User-Agent",
            "type": "string",
            "description": "User-Agent header used for sitemap, robots.txt, and optional status requests.",
            "default": "sitemap-robots-delta-monitor/0.1 (+https://apify.com)"
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}