{
  "openapi": "3.0.1",
  "info": {
    "title": "Website to Markdown for AI: RAG-ready chunks",
    "description": "Give it a website URL, get clean markdown per page plus token counts and overlapping chunks for RAG and vector databases. Reads the sitemap, respects robots.txt. $1.50 per 1,000 pages. Re-runs charge only for new or changed pages.",
    "version": "0.1",
    "x-build-id": "2HgJUlw2BQSjha1KV"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/opstoolkit~website-to-markdown-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-opstoolkit-website-to-markdown-rag",
        "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/opstoolkit~website-to-markdown-rag/runs": {
      "post": {
        "operationId": "runs-sync-opstoolkit-website-to-markdown-rag",
        "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/opstoolkit~website-to-markdown-rag/run-sync": {
      "post": {
        "operationId": "run-sync-opstoolkit-website-to-markdown-rag",
        "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 to crawl",
            "type": "array",
            "description": "Start pages of the websites to convert, up to 20. Example: https://docs.example.com. Only pages on the same site as a start URL are read. Pages come from the site's sitemap, found through robots.txt or /sitemap.xml, or by following links when there is none.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Total number of pages to convert in this run, from 1 to 50,000. Default 100. You pay per page converted, so use a small number such as 10 for a first test.",
            "default": 100
          },
          "includeUrlPatterns": {
            "title": "Only these URLs (optional)",
            "type": "array",
            "description": "Keep only URLs that match one of these patterns. * is a wildcard. A pattern that starts with / is matched against the path, so /docs/* keeps pages under /docs/. Any other pattern is matched against the full URL. Default empty, which reads the whole site.",
            "items": {
              "type": "string"
            }
          },
          "excludeUrlPatterns": {
            "title": "Skip these URLs (optional)",
            "type": "array",
            "description": "Skip URLs that match one of these patterns. Same rules as 'Only these URLs'. Skip wins when a URL matches both. Examples: /blog/tag/*, */changelog*. Default empty.",
            "items": {
              "type": "string"
            }
          },
          "discovery": {
            "title": "How to find pages",
            "enum": [
              "sitemap-then-crawl",
              "sitemap",
              "crawl"
            ],
            "type": "string",
            "description": "How pages are found. 'sitemap-then-crawl' (default) reads the sitemap and follows links only when there is none. 'sitemap' reads only the pages the sitemap lists. 'crawl' ignores the sitemap and follows links from the start page.",
            "default": "sitemap-then-crawl"
          },
          "sitemapUrl": {
            "title": "Sitemap URL (optional)",
            "type": "string",
            "description": "Full address of the sitemap, for example https://docs.example.com/sitemap.xml. Only needed when it is not listed in robots.txt or at /sitemap.xml, and used when you give one start URL. Leave empty otherwise."
          },
          "maxCrawlDepth": {
            "title": "Link depth (when following links)",
            "minimum": 0,
            "maximum": 30,
            "type": "integer",
            "description": "How many link clicks away from the start page to follow, from 0 to 30. Default 5. 0 reads only the start page. Used only when links are followed; ignored when a sitemap is used.",
            "default": 5
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 0,
            "maximum": 8000,
            "type": "integer",
            "description": "Target size of each chunk in estimated tokens (about 4 characters each), from 0 to 8,000. Default 512, which suits most embedding models. 0 skips chunking and returns markdown only.",
            "default": 512
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "maximum": 4000,
            "type": "integer",
            "description": "Tokens repeated from the end of the previous chunk, so a sentence keeps its context. Default 64, from 0 to 4,000. It must not be more than half of the chunk size, or the run stops with an input error.",
            "default": 64
          },
          "prependHeadingsToChunks": {
            "title": "Put the heading path at the top of each chunk",
            "type": "boolean",
            "description": "When on, each chunk's text starts with its heading path (page title > section > subsection). This helps retrieval when a chunk is read alone. Default off, so the text stays exactly as on the page.",
            "default": false
          },
          "outputMode": {
            "title": "Dataset rows",
            "enum": [
              "pages",
              "chunks"
            ],
            "type": "string",
            "description": "What one dataset row is. 'pages' (default): one row per page with its markdown and chunks inside. 'chunks': one flat row per chunk (chunkId, url, title, headingPath, text), ready for a vector database. The price is per page either way.",
            "default": "pages"
          },
          "onlyNewOrChanged": {
            "title": "Only new or changed pages (re-runs)",
            "type": "boolean",
            "description": "When on, the Actor remembers a fingerprint of every page between runs and returns only pages that are new or changed. Unchanged pages are not returned and not charged. Use it for scheduled refreshes of a vector database. Default off.",
            "default": false
          },
          "stateStoreName": {
            "title": "Name for the memory of past runs",
            "type": "string",
            "description": "Name of the memory of past runs, used only with 'Only new or changed pages'. Runs with the same name share the memory. Letters, numbers and dashes only. Default 'website-markdown-state'.",
            "default": "website-markdown-state"
          },
          "includeLinks": {
            "title": "Keep links",
            "type": "boolean",
            "description": "When on (default), hyperlinks stay as markdown links. Turn it off for plain text without URLs.",
            "default": true
          },
          "includeImages": {
            "title": "Keep images",
            "type": "boolean",
            "description": "When on, images stay as markdown image tags. Default off, because most embedding pipelines ignore images.",
            "default": false
          },
          "minWords": {
            "title": "Skip pages shorter than (words)",
            "minimum": 0,
            "maximum": 100000,
            "type": "integer",
            "description": "Pages with fewer words than this are skipped and not charged. They are listed in the SUMMARY record. Default 10, from 0 to 100,000.",
            "default": 10
          },
          "contentSelector": {
            "title": "Main content CSS selector (optional)",
            "type": "string",
            "description": "CSS selector that forces which part of the page is the main content. Example: article.post or #docs-body. Leave empty (default) to detect the content area automatically."
          },
          "removeSelectors": {
            "title": "Remove these elements (optional)",
            "type": "array",
            "description": "CSS selectors of elements to delete before conversion. Example: [\".promo-banner\", \"#survey\"]. Default empty.",
            "items": {
              "type": "string"
            }
          },
          "maxConcurrency": {
            "title": "Pages in parallel",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many pages are fetched at the same time, from 1 to 20. Default 5. Keep it low for small sites.",
            "default": 5
          },
          "requestDelayMs": {
            "title": "Minimum delay between requests (ms)",
            "minimum": 0,
            "maximum": 10000,
            "type": "integer",
            "description": "Minimum pause between requests to one website, in milliseconds, from 0 to 10,000. Default 250. A Crawl-delay in robots.txt is used instead when it is longer.",
            "default": 250
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}