{
  "openapi": "3.0.1",
  "info": {
    "title": "Target Site Terms Automation Clause Change Watcher",
    "description": "Watches the legal documents of the sites that you scrape and reports every change to the clauses that govern automated access, with the date on which the new clause binds. One record for each clause change, one for each document and one summary. HTTP only",
    "version": "0.1",
    "x-build-id": "RCyeFEliCmSAMg1JY"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/kingii98~target-site-terms-automation-clause-change-watcher/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-kingii98-target-site-terms-automation-clause-change-watcher",
        "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/kingii98~target-site-terms-automation-clause-change-watcher/runs": {
      "post": {
        "operationId": "runs-sync-kingii98-target-site-terms-automation-clause-change-watcher",
        "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/kingii98~target-site-terms-automation-clause-change-watcher/run-sync": {
      "post": {
        "operationId": "run-sync-kingii98-target-site-terms-automation-clause-change-watcher",
        "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": [
          "documents"
        ],
        "properties": {
          "documents": {
            "title": "Legal documents to watch",
            "minItems": 1,
            "maxItems": 30,
            "type": "array",
            "description": "1 to 30 records. Each record holds a site label and the URL of one legal document, for example a terms of use, an acceptable use policy or a developer agreement. Private, loopback and reserved addresses are refused.",
            "default": [
              {
                "label": "Project Gutenberg",
                "url": "https://www.gutenberg.org/policy/robot_access.html"
              },
              {
                "label": "Project Gutenberg terms of use",
                "url": "https://www.gutenberg.org/policy/terms_of_use.html"
              }
            ]
          },
          "clauseTerms": {
            "title": "Clause terms",
            "maxItems": 50,
            "type": "array",
            "description": "The taxonomy of terms that govern automated access. The Actor keeps a text window around each term and compares only those windows, so a change to an address or to a price table is not reported. Maximum 50 terms.",
            "default": [
              "automated means",
              "automated",
              "scrape",
              "scraping",
              "crawler",
              "crawl",
              "spider",
              "bot",
              "robot",
              "robots.txt",
              "data mining",
              "text and data mining",
              "harvest",
              "AI agent",
              "artificial intelligence",
              "machine learning",
              "LLM",
              "large language model",
              "rate limit",
              "API key",
              "resale",
              "resell"
            ],
            "items": {
              "type": "string"
            }
          },
          "contextChars": {
            "title": "Context window size (characters)",
            "minimum": 100,
            "maximum": 2000,
            "type": "integer",
            "description": "Size of the text window that the Actor keeps around each matched term. A larger window shows more of the clause and reports a change more often.",
            "default": 600
          },
          "reportUnchanged": {
            "title": "Report unchanged clauses",
            "type": "boolean",
            "description": "Also write one record for each clause window that is still there word for word. Use this for an audit. An unchanged window is not charged as a clause change.",
            "default": false
          },
          "stateStoreName": {
            "title": "Baseline store name",
            "pattern": "^[A-Za-z0-9_-]{1,63}$",
            "type": "string",
            "description": "Name of the key-value store that holds the previous normalised text and the previous clause windows. Keep the same name over every run of one watch list, because a change is a difference against the stored version.",
            "default": "tos-clause-baselines"
          },
          "timeoutSeconds": {
            "title": "Request timeout (seconds)",
            "minimum": 1,
            "maximum": 60,
            "type": "integer",
            "description": "Timeout for one GET of one document.",
            "default": 20
          },
          "maxResponseBytes": {
            "title": "Maximum response bytes",
            "minimum": 10000,
            "maximum": 5000000,
            "type": "integer",
            "description": "Hard cap on the bytes read from one document. A longer body is cut at this size and the record shows truncated.",
            "default": 1000000
          },
          "maxRedirects": {
            "title": "Maximum redirects",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Redirect hops followed for one document. Every hop passes the public-address check.",
            "default": 3
          },
          "concurrency": {
            "title": "Parallel documents",
            "minimum": 1,
            "maximum": 8,
            "type": "integer",
            "description": "Number of documents fetched at the same time. Keep it low, because the watch list holds sites that you must not overload.",
            "default": 4
          },
          "userAgent": {
            "title": "User agent",
            "pattern": "^[\\x20-\\x7E]*$",
            "type": "string",
            "description": "User-Agent header sent with every request, so the watched site can identify this Actor in its logs. ASCII characters only.",
            "default": "TosClauseWatcher/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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}