{
  "openapi": "3.0.1",
  "info": {
    "title": "Docs-to-RAG Optimizer",
    "description": "Convert public developer documentation into clean Markdown, semantic RAG chunks, token counts, duplicate hashes, JSONL exports, and quality warnings for AI assistants.",
    "version": "0.1",
    "x-build-id": "ceR4NC1byF0zmjUFg"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vamsi-krishna~docs-to-rag-optimizer/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vamsi-krishna-docs-to-rag-optimizer",
        "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/vamsi-krishna~docs-to-rag-optimizer/runs": {
      "post": {
        "operationId": "runs-sync-vamsi-krishna-docs-to-rag-optimizer",
        "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/vamsi-krishna~docs-to-rag-optimizer/run-sync": {
      "post": {
        "operationId": "run-sync-vamsi-krishna-docs-to-rag-optimizer",
        "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": "One or more public documentation URLs to crawl and convert into Markdown, JSONL, and RAG chunks.",
            "default": [
              {
                "url": "https://docusaurus.io/docs"
              }
            ],
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "sitemapUrls": {
            "title": "Sitemap URLs",
            "type": "array",
            "description": "Optional XML sitemap URLs to seed additional pages.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum number of pages to successfully process (stored + charged).",
            "default": 100
          },
          "maxDepth": {
            "title": "Max depth",
            "minimum": 0,
            "type": "integer",
            "description": "Maximum crawl depth from the start URLs.",
            "default": 5
          },
          "includePatterns": {
            "title": "Include patterns (regex)",
            "type": "array",
            "description": "Only crawl URLs matching at least one regex. If empty, include all (subject to other filters).",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "excludePatterns": {
            "title": "Exclude patterns (regex)",
            "type": "array",
            "description": "Skip URLs matching any regex.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "crawlOnlyDocs": {
            "title": "Crawl only docs pages",
            "type": "boolean",
            "description": "Skip obvious non-docs pages (blog, pricing, login, etc.).",
            "default": true
          },
          "outputFormats": {
            "title": "Output formats",
            "type": "array",
            "description": "Output formats to produce.",
            "items": {
              "type": "string",
              "enum": [
                "json",
                "markdown"
              ]
            },
            "default": [
              "json",
              "markdown"
            ]
          },
          "removeSelectors": {
            "title": "Remove selectors",
            "type": "array",
            "description": "CSS selectors to remove before extraction/markdown conversion.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "keepSelectors": {
            "title": "Keep selectors",
            "type": "array",
            "description": "If provided, restrict extraction to these selectors.",
            "items": {
              "type": "string"
            },
            "default": []
          },
          "preserveCodeBlocks": {
            "title": "Preserve code blocks",
            "type": "boolean",
            "description": "Preserve fenced code blocks in the generated Markdown and extract code blocks into JSON.",
            "default": true
          },
          "preserveTables": {
            "title": "Preserve tables",
            "type": "boolean",
            "description": "Convert HTML tables into GitHub-Flavored Markdown tables and include table HTML in JSON.",
            "default": true
          },
          "preserveLinks": {
            "title": "Preserve links",
            "type": "boolean",
            "description": "Keep links in Markdown and include normalized links in JSON.",
            "default": true
          },
          "chunkingEnabled": {
            "title": "Chunking enabled",
            "type": "boolean",
            "description": "Generate chunk-level records suitable for RAG ingestion.",
            "default": true
          },
          "chunkStrategy": {
            "title": "Chunk strategy",
            "enum": [
              "header-aware"
            ],
            "type": "string",
            "description": "Chunking strategy used to split pages into semantic chunks.",
            "default": "header-aware"
          },
          "chunkSize": {
            "title": "Chunk size (tokens)",
            "minimum": 50,
            "type": "integer",
            "description": "Target maximum tokens per chunk (approximate).",
            "default": 800
          },
          "chunkOverlap": {
            "title": "Chunk overlap (tokens)",
            "minimum": 0,
            "type": "integer",
            "description": "Approximate overlap between consecutive chunks to improve retrieval continuity.",
            "default": 100
          },
          "deduplicateContent": {
            "title": "Deduplicate content",
            "type": "boolean",
            "description": "Detect exact-duplicate pages by content hash and mark them via duplicateOf.",
            "default": true
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Respect robots.txt disallow rules when crawling.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max concurrency",
            "minimum": 1,
            "type": "integer",
            "description": "Maximum concurrent page requests.",
            "default": 5
          }
        }
      },
      "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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}