{
  "openapi": "3.0.1",
  "info": {
    "title": "Docs2rag",
    "description": "Crawl public docs and convert them into AI-ready RAG datasets. Docs2RAG strips navigation noise, preserves code blocks & tables, and exports clean Markdown and structured chunks ready for vector DBs like Pinecone, Qdrant, & Chroma with zero API keys required.",
    "version": "0.0",
    "x-build-id": "Cv3w5hAildRY5Q8rP"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/thebyteguy~docs2rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-thebyteguy-docs2rag",
        "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/thebyteguy~docs2rag/runs": {
      "post": {
        "operationId": "runs-sync-thebyteguy-docs2rag",
        "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/thebyteguy~docs2rag/run-sync": {
      "post": {
        "operationId": "run-sync-thebyteguy-docs2rag",
        "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 documentation entry point URLs to begin crawling.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of pages to crawl and extract. Default is 100.",
            "default": 100
          },
          "maxDepth": {
            "title": "Max Depth",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Maximum link crawl depth from the start URLs. Default is 10.",
            "default": 10
          },
          "includeUrlPatterns": {
            "title": "Include URL Patterns",
            "type": "array",
            "description": "Optional list of regex or glob patterns. Only URLs matching at least one pattern will be crawled.",
            "default": []
          },
          "excludeUrlPatterns": {
            "title": "Exclude URL Patterns",
            "type": "array",
            "description": "Optional list of regex or glob patterns. Matching URLs will be skipped.",
            "default": []
          },
          "sameDomainOnly": {
            "title": "Same Domain Only",
            "type": "boolean",
            "description": "If true, only links on the same host domain as the start URL will be crawled.",
            "default": true
          },
          "respectRobotsTxt": {
            "title": "Respect robots.txt",
            "type": "boolean",
            "description": "Whether to fetch and respect the target site's robots.txt rules.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Max Concurrency",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "Maximum number of concurrent requests. Keep safe to avoid overloading target servers.",
            "default": 5
          },
          "requestTimeoutSecs": {
            "title": "Request Timeout (Seconds)",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum timeout in seconds for each HTTP request.",
            "default": 30
          },
          "removeSelectors": {
            "title": "Remove Selectors (CSS)",
            "type": "array",
            "description": "Custom CSS selectors for elements to remove from the page prior to extraction (e.g., banner, cookie popups).",
            "default": []
          },
          "contentSelectors": {
            "title": "Content Selectors (CSS)",
            "type": "array",
            "description": "Custom CSS selectors to locate the main documentation body. If provided, the first match is extracted.",
            "default": []
          },
          "chunkSize": {
            "title": "Chunk Size",
            "minimum": 200,
            "maximum": 10000,
            "type": "integer",
            "description": "Target size for each text chunk (in characters, or tokens if token-aware chunking). Default is 1200.",
            "default": 1200
          },
          "chunkOverlap": {
            "title": "Chunk Overlap",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Overlap between consecutive chunks (in characters, or tokens). Default is 200.",
            "default": 200
          },
          "minContentLength": {
            "title": "Min Content Length",
            "minimum": 10,
            "maximum": 5000,
            "type": "integer",
            "description": "Minimum character count for extracted page content to be kept. Prevents saving empty or stub pages.",
            "default": 100
          },
          "includeCode": {
            "title": "Include Code Blocks",
            "type": "boolean",
            "description": "Whether to preserve code blocks and syntax-highlighted snippets in Markdown and chunks.",
            "default": true
          },
          "includeImages": {
            "title": "Include Images",
            "type": "boolean",
            "description": "Whether to preserve image markdown syntax with alt text and URLs.",
            "default": false
          },
          "outputFormats": {
            "title": "Output Formats",
            "type": "array",
            "description": "Supported output formats to produce: MARKDOWN, JSON, JSONL.",
            "default": [
              "MARKDOWN",
              "JSON",
              "JSONL"
            ]
          },
          "deduplicateContent": {
            "title": "Deduplicate Content",
            "type": "boolean",
            "description": "Avoid processing duplicate pages with identical content hashes.",
            "default": true
          },
          "crawlSitemap": {
            "title": "Crawl Sitemap",
            "type": "boolean",
            "description": "Automatically discover documentation URLs via /sitemap.xml if available.",
            "default": true
          },
          "generatePageSummaries": {
            "title": "Generate Page Summaries",
            "type": "boolean",
            "description": "Optional extractive page summary generation (does not require external API keys).",
            "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}