{
  "openapi": "3.0.1",
  "info": {
    "title": "Website to Markdown Crawler for RAG – Hard Spend Cap",
    "description": "Crawl a website sitemap-first and get clean Markdown or plain text for every page, for RAG, LLM knowledge bases and content audits. You set a hard page and spend cap before the run, so a crawl never costs more than planned. Static HTML only.",
    "version": "1.0",
    "x-build-id": "B2XVS5OF9b2FWblDU"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/appetizing_horsefly~capped-content-crawler/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-appetizing_horsefly-capped-content-crawler",
        "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/appetizing_horsefly~capped-content-crawler/runs": {
      "post": {
        "operationId": "runs-sync-appetizing_horsefly-capped-content-crawler",
        "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/appetizing_horsefly~capped-content-crawler/run-sync": {
      "post": {
        "operationId": "run-sync-appetizing_horsefly-capped-content-crawler",
        "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": "Start URLs",
            "type": "array",
            "description": "Sites or sections to crawl. Only pages under the same host and path prefix are crawled.",
            "default": [
              "https://docs.apify.com/academy"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxPages": {
            "title": "Max pages (hard cap)",
            "minimum": 1,
            "maximum": 100000,
            "type": "integer",
            "description": "The run stops after this many pages are saved. You are never billed for more.",
            "default": 20
          },
          "maxSpendUsd": {
            "title": "Max spend (USD, hard cap)",
            "minimum": 0,
            "type": "number",
            "description": "Hard budget. Converted to a page cap at the per-page price; the lower of the two caps wins. 0 = use maxPages only.",
            "default": 0
          },
          "maxRunMinutes": {
            "title": "Max run time (minutes)",
            "minimum": 1,
            "maximum": 1440,
            "type": "integer",
            "description": "The crawl stops cleanly after this time and keeps everything saved so far.",
            "default": 30
          },
          "useSitemaps": {
            "title": "Sitemap first",
            "type": "boolean",
            "description": "Discover pages from robots.txt Sitemap: entries and /sitemap.xml before following links.",
            "default": true
          },
          "followLinks": {
            "title": "Follow links",
            "type": "boolean",
            "description": "Also follow in-scope links found on pages (needed when a site has no sitemap).",
            "default": true
          },
          "maxDepth": {
            "title": "Max link depth",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Link-following depth from start URLs.",
            "default": 5
          },
          "includeUrlPatterns": {
            "title": "Include URL regexes",
            "type": "array",
            "description": "Only save pages whose URL matches one of these regexes. Empty = all in scope.",
            "items": {
              "type": "string"
            }
          },
          "excludeUrlPatterns": {
            "title": "Exclude URL regexes",
            "type": "array",
            "description": "Skip URLs matching any of these regexes.",
            "default": [
              "\\.(pdf|zip|png|jpe?g|gif|svg|mp4)$",
              "/(tag|tags|author|page)/"
            ],
            "items": {
              "type": "string"
            }
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Skip URLs disallowed by robots.txt.",
            "default": true
          },
          "outputFormat": {
            "title": "Content format",
            "enum": [
              "markdown",
              "text"
            ],
            "type": "string",
            "description": "Format of the main content.",
            "default": "markdown"
          },
          "concurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 50,
            "type": "integer",
            "description": "How many HTTP requests to run in parallel. Lower it for small or slow sites.",
            "default": 10
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (s)",
            "minimum": 3,
            "maximum": 120,
            "type": "integer",
            "description": "Seconds to wait for each page request before skipping it.",
            "default": 20
          },
          "minWords": {
            "title": "Min words",
            "minimum": 0,
            "type": "integer",
            "description": "Pages with less main text than this are skipped (not charged).",
            "default": 30
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}