{
  "openapi": "3.0.1",
  "info": {
    "title": "Docs To Rag",
    "description": "Transform documentation websites into RAG-ready chunks with semantic understanding, quality scoring, and direct vector database integration.",
    "version": "2.0",
    "x-build-id": "7mca9TZUcwthQLO02"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gabrielaxy~docs-to-rag/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gabrielaxy-docs-to-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/gabrielaxy~docs-to-rag/runs": {
      "post": {
        "operationId": "runs-sync-gabrielaxy-docs-to-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/gabrielaxy~docs-to-rag/run-sync": {
      "post": {
        "operationId": "run-sync-gabrielaxy-docs-to-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": "Documentation URLs",
            "type": "array",
            "description": "URLs of documentation sites to crawl",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "maxDepth": {
            "title": "Max Crawl Depth",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "How many levels deep to crawl (0 = start page only)",
            "default": 10
          },
          "maxPages": {
            "title": "Max Pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Maximum number of pages to crawl",
            "default": 1000
          },
          "includeGlobs": {
            "title": "Include Patterns",
            "type": "array",
            "description": "Only crawl URLs matching these glob patterns",
            "items": {
              "type": "string"
            }
          },
          "excludeGlobs": {
            "title": "Exclude Patterns",
            "type": "array",
            "description": "Skip URLs matching these glob patterns",
            "items": {
              "type": "string"
            }
          },
          "chunkSize": {
            "title": "Chunk Size (tokens)",
            "minimum": 100,
            "maximum": 2000,
            "type": "integer",
            "description": "Target size for each text chunk",
            "default": 500
          },
          "chunkOverlap": {
            "title": "Chunk Overlap (tokens)",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Overlap between consecutive chunks for context",
            "default": 50
          },
          "splitByHeaders": {
            "title": "Split by Headers",
            "type": "boolean",
            "description": "Create new chunks at H1/H2 headers",
            "default": true
          },
          "includeCodeBlocks": {
            "title": "Include Code Blocks",
            "type": "boolean",
            "description": "Include code snippets in chunks",
            "default": true
          },
          "chunkingStrategy": {
            "title": "Chunking Strategy",
            "enum": [
              "simple",
              "semantic"
            ],
            "type": "string",
            "description": "Simple: token-based splitting. Semantic: preserves code blocks, paragraphs, lists, and document structure for better RAG retrieval.",
            "default": "semantic"
          },
          "outputFormat": {
            "title": "Output Format",
            "enum": [
              "json",
              "jsonl",
              "csv"
            ],
            "type": "string",
            "description": "Format for the output data",
            "default": "jsonl"
          },
          "generateEmbeddings": {
            "title": "Generate Embeddings",
            "type": "boolean",
            "description": "Generate OpenAI embeddings for each chunk",
            "default": false
          },
          "openaiApiKey": {
            "title": "OpenAI API Key",
            "type": "string",
            "description": "Your OpenAI API key for embeddings. Can also be set via OPENAI_API_KEY environment variable."
          },
          "embeddingModel": {
            "title": "Embedding Model",
            "enum": [
              "text-embedding-3-small",
              "text-embedding-3-large"
            ],
            "type": "string",
            "description": "OpenAI embedding model to use",
            "default": "text-embedding-3-small"
          },
          "proxyConfig": {
            "title": "Proxy Configuration",
            "type": "object",
            "description": "Configure proxy to avoid IP blocking"
          },
          "vectorDbProvider": {
            "title": "Vector Database",
            "enum": [
              "none",
              "pinecone",
              "supabase",
              "qdrant"
            ],
            "type": "string",
            "description": "Select a vector database to push chunks directly after embedding generation",
            "default": "none"
          },
          "vectorDbConfig": {
            "title": "Vector DB Configuration",
            "type": "object",
            "description": "Provider config (optional if using env vars). Pinecone: {indexName}. Supabase: {tableName}. Qdrant: {collectionName}. API keys can be set via environment variables."
          },
          "vectorDbNamespace": {
            "title": "Namespace/Collection",
            "type": "string",
            "description": "Namespace (Pinecone) or collection name. Can also use VECTOR_DB_NAMESPACE env var."
          },
          "upsertBatchSize": {
            "title": "Upsert Batch Size",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "Number of vectors to upsert in each batch",
            "default": 100
          },
          "enableQualityScoring": {
            "title": "Enable Quality Scoring",
            "type": "boolean",
            "description": "Enable quality scoring to filter low-value chunks",
            "default": true
          },
          "minQualityScore": {
            "title": "Minimum Quality Score",
            "minimum": 0,
            "maximum": 100,
            "type": "integer",
            "description": "Chunks below this score will be filtered out (0-100)",
            "default": 40
          },
          "includeQualityInMetadata": {
            "title": "Include Quality in Metadata",
            "type": "boolean",
            "description": "Add quality scores to chunk metadata for retrieval optimization",
            "default": true
          },
          "enrichMetadata": {
            "title": "Enrich Metadata",
            "type": "boolean",
            "description": "Add content type, topics, complexity, and relationship metadata",
            "default": true
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}