{
  "openapi": "3.0.1",
  "info": {
    "title": "Website to Markdown + PDF & Office Docs, llms.txt for RAG",
    "description": "Crawl a website into clean Markdown for LLMs, RAG and AI agents. Linked PDF, Word, PowerPoint and Excel files are converted too. Writes llms.txt and llms-full.txt. Inputs like Website Content Crawler. robots.txt respected; blocked and empty pages under 1 MB are free.",
    "version": "0.2",
    "x-build-id": "uL3lUR8AFql4fcT9e"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/greenrun~website-to-markdown/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-greenrun-website-to-markdown",
        "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/greenrun~website-to-markdown/runs": {
      "post": {
        "operationId": "runs-sync-greenrun-website-to-markdown",
        "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/greenrun~website-to-markdown/run-sync": {
      "post": {
        "operationId": "run-sync-greenrun-website-to-markdown",
        "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": "Pages to start from. The crawler follows links to pages whose URL starts with one of these URLs (like Website Content Crawler). A sitemap URL (ending with .xml) is read as a list of pages.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxCrawlPages": {
            "title": "Max pages",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after fetching this many pages, counting start URLs and pages that turn out empty or duplicate. Documents are limited separately by Max documents.",
            "default": 1000
          },
          "maxCrawlDepth": {
            "title": "Max crawling depth",
            "minimum": 0,
            "type": "integer",
            "description": "How many links away from a start URL to go. Start URLs are depth 0; pages found in sitemaps are depth 1.",
            "default": 20
          },
          "convertDocuments": {
            "title": "Convert linked documents",
            "type": "boolean",
            "description": "Convert PDF, DOCX, PPTX, XLSX, XLS and EPUB files linked from crawled pages to Markdown, with tables and page markers, also outside the start URL path (like Website Content Crawler files). Each document is a separate result.",
            "default": true
          },
          "maxDocuments": {
            "title": "Max documents",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Convert at most this many documents per run. Links that turn out not to be documents do not count. 0 turns document conversion off.",
            "default": 100
          },
          "documentsFromOtherDomains": {
            "title": "Documents from other domains",
            "type": "boolean",
            "description": "Also convert documents hosted on other domains than the start URLs (for example PDFs on a CDN or cited papers). Off: only the start URL domains and their subdomains.",
            "default": false
          },
          "useSitemaps": {
            "title": "Load URLs from sitemaps",
            "type": "boolean",
            "description": "Also read the sitemaps of the start URL domains (from robots.txt, or /sitemap.xml) and crawl the pages in scope.",
            "default": false
          },
          "generateLlmsTxt": {
            "title": "Write llms.txt and llms-full.txt",
            "type": "boolean",
            "description": "After the crawl, save llms.txt (an index of all pages and documents in the llmstxt.org format) and llms-full.txt (all Markdown in one file) to the key-value store of the run.",
            "default": true
          },
          "includeUrlGlobs": {
            "title": "Include URL patterns (globs)",
            "type": "array",
            "description": "Crawl only pages matching these globs, for example https://example.com/docs/**. Setting this replaces the start URL prefix rule.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "glob"
              ],
              "properties": {
                "glob": {
                  "type": "string",
                  "title": "Glob of a web page"
                }
              }
            }
          },
          "excludeUrlGlobs": {
            "title": "Exclude URL patterns (globs)",
            "type": "array",
            "description": "Skip pages and documents matching these globs, for example https://example.com/blog/**.",
            "default": [],
            "items": {
              "type": "object",
              "required": [
                "glob"
              ],
              "properties": {
                "glob": {
                  "type": "string",
                  "title": "Glob of a web page"
                }
              }
            }
          },
          "maxResults": {
            "title": "Max results",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after saving this many pages and documents together.",
            "default": 9999999
          },
          "useLlmsTxt": {
            "title": "Crawl /llms.txt",
            "type": "boolean",
            "description": "Also read /llms.txt of the start URL domains and crawl the pages it links to (in scope). Markdown pages are saved as they are.",
            "default": false
          },
          "ignoreCanonicalUrl": {
            "title": "Ignore canonical URLs",
            "type": "boolean",
            "description": "By default a page whose canonical URL was already saved is skipped (not charged). Turn this on to save such pages anyway.",
            "default": false
          },
          "keepUrlFragments": {
            "title": "URL #fragments identify unique pages",
            "type": "boolean",
            "description": "Treat https://example.com/#a and https://example.com/#b as different pages. Only for sites that serve different content per fragment.",
            "default": false
          },
          "htmlTransformer": {
            "title": "HTML transformer",
            "enum": [
              "readableText",
              "readableTextIfPossible",
              "none",
              "extractus",
              "defuddle"
            ],
            "type": "string",
            "description": "readableText: the main content of the page: its main element (or its only article element) when it has one, otherwise the content found by Readability, otherwise the whole page. Tables and code blocks are kept. none: the whole page after removing the elements below. readableTextIfPossible, extractus and defuddle are accepted for compatibility and work as readableText.",
            "default": "readableText"
          },
          "removeElementsCssSelector": {
            "title": "Remove HTML elements (CSS selector)",
            "type": "string",
            "description": "Elements removed before extracting the content. The default is the same as in Website Content Crawler: navigation, footers, scripts, inline images, alerts, banners and dialogs.",
            "default": "nav, footer, script, style, noscript, svg, img[src^='data:'],\n[role=\"alert\"],\n[role=\"banner\"],\n[role=\"dialog\"],\n[role=\"alertdialog\"],\n[role=\"region\"][aria-label*=\"skip\" i],\n[aria-modal=\"true\"]"
          },
          "keepElementsCssSelector": {
            "title": "Keep HTML elements (CSS selector)",
            "type": "string",
            "description": "If set, only elements matching this selector are kept, for example article, .docs-content. Runs before the HTML transformer.",
            "default": ""
          },
          "removeCookieWarnings": {
            "title": "Remove cookie warnings",
            "type": "boolean",
            "description": "Remove common cookie consent banners (OneTrust, Cookiebot, Usercentrics, Didomi and similar) from the HTML.",
            "default": true
          },
          "saveMarkdown": {
            "title": "Save Markdown",
            "type": "boolean",
            "description": "Save the markdown field. Plain text is always saved in the text field.",
            "default": true
          },
          "readableTextCharThreshold": {
            "title": "Readable text character threshold",
            "type": "integer",
            "description": "When Readability finds fewer characters than this, the main element or the whole page is used instead.",
            "default": 100
          },
          "maxDocumentPages": {
            "title": "Max pages per document",
            "minimum": 1,
            "maximum": 2000,
            "type": "integer",
            "description": "Stop converting a PDF after this many pages. Pages above 20 are billed as extra pages.",
            "default": 200
          },
          "maxDocumentSizeMb": {
            "title": "Max document size (MB)",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Larger documents are skipped and not charged.",
            "default": 50
          },
          "ocr": {
            "title": "OCR for scanned PDFs",
            "enum": [
              "off",
              "auto",
              "force"
            ],
            "type": "string",
            "description": "off: no OCR (a scanned PDF has no text, is reported in CRAWL-REPORT and not charged). auto: OCR only pages without a text layer, billed per OCR page. force: OCR every page.",
            "default": "off"
          },
          "ocrLanguages": {
            "title": "OCR languages",
            "type": "string",
            "description": "Tesseract language codes joined with +, for example eng+pol. Available: eng, pol, deu, fra, spa, ita, por, nld.",
            "default": "eng"
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "maximum": 999,
            "type": "integer",
            "description": "Pages fetched at the same time. A Crawl-delay in robots.txt always takes precedence and spaces requests to that site. Values above 50 are treated as 50 (no browser is used, so higher values add no speed).",
            "default": 5
          },
          "maxRequestRetries": {
            "title": "Maximum retries on network and server errors",
            "minimum": 0,
            "maximum": 20,
            "type": "integer",
            "description": "Retries after timeouts, HTTP 429 and 5xx, with growing pauses. Blocked requests (401, 403) are never retried. Values above 10 are treated as 10.",
            "default": 3
          },
          "requestTimeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 1,
            "maximum": 600,
            "type": "integer",
            "description": "Timeout for one HTTP request. Values below 5 are treated as 5.",
            "default": 60
          },
          "crawlerType": {
            "title": "Crawler type (compatibility)",
            "type": "string",
            "description": "Accepted so inputs from Website Content Crawler work unchanged (playwright:adaptive, playwright:firefox, cheerio and others). This Actor always fetches over HTTP without a browser."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration (compatibility)",
            "type": "object",
            "description": "Accepted for compatibility and not used: this Actor connects directly, without proxies."
          },
          "respectRobotsTxtFile": {
            "title": "Respect robots.txt (compatibility)",
            "type": "boolean",
            "description": "Accepted for compatibility. robots.txt is always respected."
          },
          "saveFiles": {
            "title": "Save files (compatibility)",
            "type": "boolean",
            "description": "Accepted for compatibility. Use convertDocuments."
          },
          "customHttpHeaders": {
            "title": "Custom HTTP headers (compatibility)",
            "type": "object",
            "description": "Accepted for compatibility and not used."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}