{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset to Vector DB - Pinecone, Qdrant & pgvector RAG",
    "description": "Load Apify datasets, JSON, CSV or Markdown into your own Pinecone, Qdrant or Postgres pgvector (Supabase, Neon). Chunking, metadata, idempotent IDs, delta sync. Free local embeddings or your OpenAI key. Pay per chunk.",
    "version": "0.1",
    "x-build-id": "SjQaVMinjdrdCf7fb"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~vector-db-uploader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-vector-db-uploader",
        "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/gazidev~vector-db-uploader/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-vector-db-uploader",
        "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/gazidev~vector-db-uploader/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-vector-db-uploader",
        "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",
        "properties": {
          "datasetIds": {
            "title": "Apify datasets",
            "type": "array",
            "description": "Datasets to load, e.g. the output of Website Content Crawler or any scraper. In an integration / webhook use {{resource.defaultDatasetId}}. Datasets, file URLs and pasted items are combined."
          },
          "fileUrls": {
            "title": "File URLs (JSON, JSON Lines, CSV, Markdown, text)",
            "type": "array",
            "description": "Public URLs of JSON arrays, JSON Lines, CSV/TSV files (one document per row) or a raw Markdown / text file (one document). GitHub 'blob' links are converted to raw links.",
            "items": {
              "type": "string"
            }
          },
          "items": {
            "title": "Or paste JSON items",
            "type": "array",
            "description": "Optional: a JSON array of objects, e.g. [{\"url\": \"https://example.com/a\", \"text\": \"...\"}]. Handy for AI agents and quick tests."
          },
          "textFields": {
            "title": "Text fields",
            "type": "array",
            "description": "Field(s) holding the text to embed (dot paths allowed, e.g. content.body). The first non-empty field is used, unless 'Combine text fields' is on. Default: markdown, text, content, body, pageContent, description (works with Website Content Crawler output).",
            "items": {
              "type": "string"
            }
          },
          "combineTextFields": {
            "title": "Combine text fields",
            "type": "boolean",
            "description": "Join all listed text fields (e.g. title + description + body) instead of using the first non-empty one.",
            "default": false
          },
          "idField": {
            "title": "Document ID field",
            "type": "string",
            "description": "Field that identifies a document (stable across runs), used to build deterministic vector IDs so re-runs update instead of duplicating. Default: url, then id. Without an ID the text hash is used."
          },
          "metadataFields": {
            "title": "Metadata fields",
            "type": "array",
            "description": "Fields stored as metadata/payload next to each vector, for filtering and citations. Use 'path:name' to rename, e.g. 'metadata.title:title'. Missing fields are skipped. The chunk text is always stored as 'text'.",
            "default": [
              "url",
              "title",
              "metadata.title:title",
              "metadata.description:description",
              "metadata.languageCode:language",
              "crawl.loadedTime:crawledAt"
            ],
            "items": {
              "type": "string"
            }
          },
          "chunkSize": {
            "title": "Chunk size (characters)",
            "minimum": 100,
            "maximum": 8000,
            "type": "integer",
            "description": "Maximum characters per chunk (~4 characters per token). 800-1500 is typical for RAG.",
            "default": 1000
          },
          "chunkOverlap": {
            "title": "Chunk overlap (characters)",
            "minimum": 0,
            "maximum": 4000,
            "type": "integer",
            "description": "Characters repeated from the end of the previous chunk (max half the chunk size).",
            "default": 150
          },
          "markdownAware": {
            "title": "Markdown-aware splitting",
            "type": "boolean",
            "description": "Split at Markdown headings first (code blocks kept intact) and store the heading path of each chunk as 'headings'. Then paragraphs, lines, sentences, words.",
            "default": true
          },
          "minChunkChars": {
            "title": "Minimum chunk length",
            "minimum": 1,
            "type": "integer",
            "description": "Drop chunks shorter than this many characters (e.g. lone headings or menu leftovers).",
            "default": 20
          },
          "embeddingProvider": {
            "title": "Embeddings",
            "enum": [
              "local",
              "openai"
            ],
            "type": "string",
            "description": "'Local' runs a small open-source model inside the Actor (no API key, no token cost). 'OpenAI-compatible' uses your own key with OpenAI or any compatible /embeddings endpoint.",
            "default": "local"
          },
          "localModel": {
            "title": "Local model",
            "enum": [
              "BAAI/bge-small-en-v1.5",
              "BAAI/bge-base-en-v1.5",
              "sentence-transformers/all-MiniLM-L6-v2",
              "sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2",
              "snowflake/snowflake-arctic-embed-s",
              "nomic-ai/nomic-embed-text-v1.5-Q"
            ],
            "type": "string",
            "description": "Used when Embeddings = Local. bge-small-en-v1.5 (384 dims) is preloaded and fastest. Use the multilingual MiniLM model for non-English text. Use the same model for indexing and for your queries.",
            "default": "BAAI/bge-small-en-v1.5"
          },
          "embeddingApiKey": {
            "title": "Embedding API key",
            "type": "string",
            "description": "Your OpenAI (or compatible provider) API key. Stored encrypted. Only used when Embeddings = OpenAI-compatible."
          },
          "embeddingModel": {
            "title": "Embedding model (API)",
            "type": "string",
            "description": "Model name for the API, e.g. text-embedding-3-small, text-embedding-3-large, mistral-embed, nomic-embed-text.",
            "default": "text-embedding-3-small"
          },
          "embeddingBaseUrl": {
            "title": "API base URL",
            "type": "string",
            "description": "OpenAI-compatible base URL (the Actor calls {base}/embeddings). Default https://api.openai.com/v1. Examples: https://api.mistral.ai/v1, https://api.together.xyz/v1."
          },
          "embeddingDimensions": {
            "title": "Dimensions (optional)",
            "minimum": 0,
            "type": "integer",
            "description": "Ask the API for shorter vectors (supported by text-embedding-3 models). Leave empty for the model default."
          },
          "target": {
            "title": "Vector database",
            "enum": [
              "none",
              "qdrant",
              "pinecone",
              "pgvector"
            ],
            "type": "string",
            "description": "Where to write the vectors. 'None' = dry run: chunks and embeddings are saved to the dataset only (no database needed).",
            "default": "none"
          },
          "collection": {
            "title": "Collection / index / table name",
            "type": "string",
            "description": "Qdrant collection, Pinecone index (lowercase letters, digits, '-'; underscores become '-') or Postgres table (optionally schema.table).",
            "default": "apify_docs"
          },
          "createIfMissing": {
            "title": "Create if missing",
            "type": "boolean",
            "description": "Create the collection / serverless index / table (with HNSW cosine index) when it does not exist, sized to the model's dimension.",
            "default": true
          },
          "qdrantUrl": {
            "title": "Qdrant URL",
            "type": "string",
            "description": "Your Qdrant cluster URL incl. port, e.g. https://xyz.eu-central-1-0.aws.cloud.qdrant.io:6333"
          },
          "qdrantApiKey": {
            "title": "Qdrant API key",
            "type": "string",
            "description": "Qdrant Cloud API key (stored encrypted). Leave empty for an unsecured self-hosted instance."
          },
          "pineconeApiKey": {
            "title": "Pinecone API key",
            "type": "string",
            "description": "Your Pinecone API key (stored encrypted)."
          },
          "pineconeNamespace": {
            "title": "Pinecone namespace",
            "type": "string",
            "description": "Optional namespace inside the index."
          },
          "pineconeCloud": {
            "title": "Pinecone cloud (new index)",
            "enum": [
              "aws",
              "gcp",
              "azure"
            ],
            "type": "string",
            "description": "Cloud for a newly created serverless index.",
            "default": "aws"
          },
          "pineconeRegion": {
            "title": "Pinecone region (new index)",
            "type": "string",
            "description": "Region for a newly created serverless index (free Starter plan: aws us-east-1).",
            "default": "us-east-1"
          },
          "postgresUrl": {
            "title": "Postgres connection string",
            "type": "string",
            "description": "postgresql://user:password@host:5432/db?sslmode=require (stored encrypted). Supabase: use the session or transaction pooler string. The 'vector' extension must be enabled or creatable."
          },
          "mode": {
            "title": "Update mode",
            "enum": [
              "delta",
              "upsert"
            ],
            "type": "string",
            "description": "'Delta' compares a content hash per chunk with what is already stored and only embeds + writes new or changed chunks (unchanged chunks are free). 'Upsert all' re-embeds and overwrites everything.",
            "default": "delta"
          },
          "sourceTag": {
            "title": "Source tag",
            "type": "string",
            "description": "Optional label stored with every vector (e.g. 'docs-site') and used as an ID prefix, so several sources can share one collection. Required for deleting missing documents."
          },
          "deleteMissingDocuments": {
            "title": "Delete documents missing from the source",
            "type": "boolean",
            "description": "After a complete run, delete vectors with this Source tag whose document ID was not in this run's input (e.g. pages removed from a website). Skipped when the run stopped early or a source failed.",
            "default": false
          },
          "maxItems": {
            "title": "Max documents",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after this many documents (0 = all). Useful for a first test.",
            "default": 0
          },
          "maxChunks": {
            "title": "Max chunks written",
            "minimum": 0,
            "type": "integer",
            "description": "Stop after writing this many chunks (0 = no limit). The run also stops at your max cost per run.",
            "default": 0
          },
          "includeVectorsInOutput": {
            "title": "Include vectors in dry-run output",
            "type": "boolean",
            "description": "Target 'None' only: include the embedding vector in each dataset row (turn off to just preview chunks).",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}