{
  "openapi": "3.0.1",
  "info": {
    "title": "Recurring Web Check for AI Agents",
    "description": "Checks many URLs in one run. Per URL returns clean Markdown, CSS/JSON-extracted fields and a diff vs. the previous run under the same watchId, so only what changed is flagged. For agents doing recurring checks: prices, docs, changelogs, status pages, job boards, JSON APIs. No login, browser or LLM.",
    "version": "0.1",
    "x-build-id": "MgKUdnh6KmcRmes7k"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vikingtrading~recurring-web-check/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vikingtrading-recurring-web-check",
        "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/vikingtrading~recurring-web-check/runs": {
      "post": {
        "operationId": "runs-sync-vikingtrading-recurring-web-check",
        "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/vikingtrading~recurring-web-check/run-sync": {
      "post": {
        "operationId": "run-sync-vikingtrading-recurring-web-check",
        "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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "URLs to check",
            "type": "array",
            "description": "Absolute URLs to check in this run. Put ALL URLs of one recurring job here — one run handles many URLs, you do not need one run per URL. HTML pages, JSON/REST endpoints, RSS/Atom feeds and plain-text files all work.",
            "items": {
              "type": "string"
            }
          },
          "task": {
            "title": "Task",
            "enum": [
              "monitor",
              "fetch",
              "extract"
            ],
            "type": "string",
            "description": "monitor (default): remembers each URL per watchId and reports changed=true with a compact diff when the page or any field changed since the last run. fetch: stateless, returns content + fields. extract: stateless, returns only the fields (tiny output).",
            "default": "monitor"
          },
          "watchId": {
            "title": "Watch ID (name of the recurring job)",
            "type": "string",
            "description": "Stable name for a recurring job, e.g. competitor-pricing or docs-acme-api. Snapshots are stored under this ID, so every later run with the same watchId diffs against the previous one. Leave empty and an ID is derived from the URL set + selector + fields, so identical repeat calls still get change detection."
          },
          "fields": {
            "title": "Fields to extract (name → selector)",
            "type": "object",
            "description": "Optional map of field name → extraction spec. Specs: 'h1' (text of first match), 'a.buy@href' (attribute), '.price | /([\\d.,]+)/' (regex on the text, first capture group), 'all:.item .name' (array of all matches), 'json:data.items[0].price' (path into a JSON response). Changed field values are reported in fieldChanges with before/after. No LLM involved — deterministic and free of hallucination."
          },
          "selector": {
            "title": "Scope selector",
            "type": "string",
            "description": "Optional CSS selector that limits the content to one part of the page, e.g. 'main', '#pricing', 'article'. Smaller scope = fewer tokens and fewer false 'changed' flags. If it matches nothing, the whole body is used and scopeMatched=false is returned."
          },
          "ignoreSelectors": {
            "title": "Ignore selectors",
            "type": "array",
            "description": "Elements to remove before comparing, e.g. ads, comments, timestamps, counters, 'related posts'. Use this to stop noisy page parts from triggering changed=true.",
            "items": {
              "type": "string"
            }
          },
          "ignorePatterns": {
            "title": "Ignore text patterns (regex)",
            "type": "array",
            "description": "Regular expressions removed from the text before storing and comparing, e.g. clock times, '5 minutes ago', session IDs. Plain pattern or /pattern/flags.",
            "items": {
              "type": "string"
            }
          },
          "outputFormat": {
            "title": "Content format",
            "enum": [
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "markdown keeps headings/lists/tables so an LLM can still see structure; text is flatter and a bit smaller.",
            "default": "markdown"
          },
          "maxChars": {
            "title": "Max content characters per URL",
            "minimum": 0,
            "maximum": 1000000,
            "type": "integer",
            "description": "Token budget: page content returned per URL is cut at this many characters (truncated=true tells you when). Set 0 to omit content entirely and only receive fields + diff. Change detection always uses the FULL content, not the truncated one.",
            "default": 6000
          },
          "diffMode": {
            "title": "Diff output",
            "enum": [
              "compact",
              "none"
            ],
            "type": "string",
            "description": "compact returns a short +/- line diff of what changed; none returns only the change flags and field changes.",
            "default": "compact"
          },
          "maxDiffChars": {
            "title": "Max diff characters per URL",
            "minimum": 0,
            "maximum": 200000,
            "type": "integer",
            "description": "Upper bound for the diff text per URL.",
            "default": 3000
          },
          "changeThreshold": {
            "title": "Change threshold (0–1)",
            "minimum": 0,
            "maximum": 1,
            "type": "number",
            "description": "Minimum share of changed characters (0–1) before content counts as changed. 0 = any difference. 0.02 ignores tiny edits like a rotated testimonial. Field changes always count regardless of this threshold.",
            "default": 0
          },
          "stripBoilerplate": {
            "title": "Strip navigation/footer/forms",
            "type": "boolean",
            "description": "Remove nav, header, footer, aside, forms and cookie banners from the content (ignored when a scope selector is set).",
            "default": true
          },
          "keepLinks": {
            "title": "Keep link URLs in Markdown",
            "type": "boolean",
            "description": "By default links are reduced to their text (URLs with tracking parameters change on every load and inflate output). Enable to keep [text](url).",
            "default": false
          },
          "webhookUrl": {
            "title": "Webhook URL on change",
            "type": "string",
            "description": "Optional. When at least one URL changed, a JSON payload {event, watchId, runId, changed:[...]} is POSTed here — handy for scheduled runs that should wake up an agent only when something happened."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Optional. Leave empty for direct requests. Enable Apify Proxy for sites that block datacenter IPs."
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "Parallel requests. Lower it for sites with strict rate limits.",
            "default": 5
          },
          "timeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 3,
            "maximum": 120,
            "type": "integer",
            "description": "Per-URL timeout. Keep runs fast: an MCP call-actor waits at most 45 s for the whole run.",
            "default": 20
          },
          "maxRetries": {
            "title": "Max retries",
            "minimum": 0,
            "maximum": 5,
            "type": "integer",
            "description": "Retries for network errors, HTTP 429 and 5xx. 4xx responses are reported immediately as ok=false (a 404 is a meaningful monitoring result).",
            "default": 1
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}