{
  "openapi": "3.0.1",
  "info": {
    "title": "Docs to RAG Chunks — Ultra-Fast LLM Documentation Scraper",
    "description": "Ultra-fast LLM documentation scraper & heading-aware RAG chunker. Auto-detects llms.txt, sitemaps, and 12+ doc frameworks with code-safe token chunking, SHA-256 incremental sync, and LangChain/LlamaIndex/Pinecone/Qdrant export.",
    "version": "1.0",
    "x-build-id": "RKJcqvqicNaPzzckz"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/weiyi-ai~docs-to-rag-chunks/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-weiyi-ai-docs-to-rag-chunks",
        "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/weiyi-ai~docs-to-rag-chunks/runs": {
      "post": {
        "operationId": "runs-sync-weiyi-ai-docs-to-rag-chunks",
        "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/weiyi-ai~docs-to-rag-chunks/run-sync": {
      "post": {
        "operationId": "run-sync-weiyi-ai-docs-to-rag-chunks",
        "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": "Documentation Start URLs",
            "type": "array",
            "description": "One or more root documentation URLs (e.g. https://docs.stripe.com/api or https://fastapi.tiangolo.com/tutorial/).",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxPages": {
            "title": "Max Pages to Process",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of documentation pages to fetch and chunk.",
            "default": 15
          },
          "discoveryMode": {
            "title": "URL Discovery Strategy",
            "enum": [
              "auto",
              "llms_txt",
              "sitemap",
              "crawl",
              "single_pages"
            ],
            "type": "string",
            "description": "How to discover pages: 'auto' tries llms.txt -> sitemap.xml -> same-prefix crawling; 'llms_txt' only uses llms-full.txt/llms.txt; 'sitemap' uses sitemap.xml; 'crawl' follows internal links only.",
            "default": "auto"
          },
          "stayWithinStartPath": {
            "title": "Stay Within Start URL Path Prefix",
            "type": "boolean",
            "description": "Only process URLs that share the same path prefix as your Start URLs (prevents wandering into marketing blogs or unrelated locales).",
            "default": true
          },
          "includeUrlPatterns": {
            "title": "Include URL Regex Patterns",
            "type": "array",
            "description": "Optional regex patterns; if provided, only matching URLs are processed.",
            "default": [],
            "items": {
              "type": "string"
            }
          },
          "excludeUrlPatterns": {
            "title": "Exclude URL Regex Patterns",
            "type": "array",
            "description": "Optional regex patterns to skip (e.g. changelog, blog, localized paths like /ja/ or /zh/).",
            "default": [
              "\\.(png|jpg|jpeg|gif|svg|webp|ico|pdf|zip|tar|gz|mp4|mp3|woff2?|css|js)$"
            ],
            "items": {
              "type": "string"
            }
          },
          "maxTokensPerChunk": {
            "title": "Max Tokens per Chunk",
            "minimum": 64,
            "maximum": 8192,
            "type": "integer",
            "description": "Target maximum token count per RAG chunk (counted via tiktoken cl100k_base). Code blocks and tables are kept intact whenever possible.",
            "default": 512
          },
          "minTokensPerChunk": {
            "title": "Min Tokens per Chunk",
            "minimum": 10,
            "maximum": 2048,
            "type": "integer",
            "description": "Merge tiny sibling chunks below this token threshold with adjacent chunks under the same parent section.",
            "default": 60
          },
          "chunkOverlapTokens": {
            "title": "Chunk Overlap (Tokens)",
            "minimum": 0,
            "maximum": 1024,
            "type": "integer",
            "description": "Number of overlapping tokens preserved between consecutive split chunks inside the same section.",
            "default": 50
          },
          "prependHeadingContext": {
            "title": "Prepend Heading Breadcrumb to Chunk Text",
            "type": "boolean",
            "description": "Prepend 'Page Title > H2 > H3' context header to each chunk so vector search retains full section context.",
            "default": true
          },
          "outputFormat": {
            "title": "Output Format Preset",
            "enum": [
              "standard",
              "langchain",
              "llamaindex",
              "pinecone",
              "qdrant"
            ],
            "type": "string",
            "description": "Choose schema tailored to your downstream vector database or AI framework.",
            "default": "standard"
          },
          "previousPageHashes": {
            "title": "Previous Page Hashes (Incremental Sync)",
            "type": "object",
            "description": "Optional map of { url: pageContentHash } from a previous run. Unchanged pages are skipped to save embedding costs.",
            "default": {}
          },
          "maxConcurrency": {
            "title": "Max Concurrent Requests",
            "minimum": 1,
            "maximum": 30,
            "type": "integer",
            "description": "Number of simultaneous HTTP requests.",
            "default": 8
          },
          "requestTimeoutSecs": {
            "title": "Request Timeout (Seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "HTTP timeout per page request.",
            "default": 20
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Check and honor robots.txt disallow rules.",
            "default": true
          },
          "useApifyProxy": {
            "title": "Use Apify Proxy",
            "type": "boolean",
            "description": "Route requests through Apify Proxy (recommended only if target site rate-limits datacenter IPs).",
            "default": false
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}