{
  "openapi": "3.0.1",
  "info": {
    "title": "Broken Link Checker from Sitemap (with Monitor Mode)",
    "description": "Find broken links on a website starting from its sitemap: reads every page, checks internal and external links (HEAD, then GET) and returns one row per broken link. Monitor mode returns only links that broke since the last run.",
    "version": "0.1",
    "x-build-id": "yOBVj5mqWbbEK11mu"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/pennapixel~broken-link-checker/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-pennapixel-broken-link-checker",
        "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/pennapixel~broken-link-checker/runs": {
      "post": {
        "operationId": "runs-sync-pennapixel-broken-link-checker",
        "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/pennapixel~broken-link-checker/run-sync": {
      "post": {
        "operationId": "run-sync-pennapixel-broken-link-checker",
        "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",
            "type": "array",
            "description": "A website (example.com or https://example.com), or the URL of a sitemap. Pages are taken from the site's sitemaps (found through robots.txt). If the site has no sitemap, only the page you gave is checked.",
            "items": {
              "type": "string"
            }
          },
          "checkExternalLinks": {
            "title": "Also check external links",
            "type": "boolean",
            "description": "Check links that point to other websites as well as internal ones. Each distinct link is checked once per run.",
            "default": true
          },
          "onlyNewBrokenLinks": {
            "title": "Monitor mode: only links that broke since the last run",
            "type": "boolean",
            "description": "Compare with the previous run on the same website and return only the links that became broken (flagged isNew). The first run returns all broken links and saves them as the baseline. The list is kept in a key-value store named 'broken-link-checker-state' in your account. Schedule the run (daily, weekly) to be told when a link breaks.",
            "default": false
          },
          "includeWorkingLinks": {
            "title": "Also return working links",
            "type": "boolean",
            "description": "Add a row (broken: false) for every link that works, not only for broken ones. Useful for a full link inventory. Charging does not change: every checked link is one event.",
            "default": false
          },
          "maxPagesPerSite": {
            "title": "Max pages per website",
            "minimum": 1,
            "maximum": 5000,
            "type": "integer",
            "description": "Cost cap: how many pages of the sitemap are downloaded and searched for links.",
            "default": 50
          },
          "maxLinksPerSite": {
            "title": "Max links checked per website",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Cost cap: how many different links are checked (each one is a charged event). Pages are read first, then links are checked in the order they were found.",
            "default": 1000
          },
          "includePagePatterns": {
            "title": "Only pages matching",
            "type": "array",
            "description": "Optional regular expressions. A sitemap page is read only if its URL matches at least one. Example: /blog/",
            "items": {
              "type": "string"
            }
          },
          "excludeLinkPatterns": {
            "title": "Skip links matching",
            "type": "array",
            "description": "Optional regular expressions for links that must not be checked. Example: linkedin\\.com or \\?utm_",
            "items": {
              "type": "string"
            }
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many requests run at the same time. Requests to the same host are also spaced out, and the site's Crawl-delay is honoured.",
            "default": 8
          },
          "requestTimeoutSecs": {
            "title": "Timeout per request (seconds)",
            "minimum": 3,
            "maximum": 60,
            "type": "integer",
            "description": "A link that does not answer within this time is reported as a timeout.",
            "default": 15
          },
          "maxSecondsPerSite": {
            "title": "Max seconds per website",
            "minimum": 10,
            "maximum": 3600,
            "type": "integer",
            "description": "Time limit for one website. When it is reached the run keeps what it has checked so far and moves on, so a slow site can never keep your run (and your bill) open.",
            "default": 300
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}