{
  "openapi": "3.0.1",
  "info": {
    "title": "Notion Scraper & Knowledge Base Sync",
    "description": "Export public or private Notion pages, wikis, and databases as Markdown, JSON, HTML, typed rows, assets, or RAG-ready chunks—with recursive crawling and incremental sync.",
    "version": "0.1",
    "x-build-id": "r1i4jPfZVwcTbck6C"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/fetchfinch~notion-scraper-knowledge-base-sync/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-fetchfinch-notion-scraper-knowledge-base-sync",
        "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/fetchfinch~notion-scraper-knowledge-base-sync/runs": {
      "post": {
        "operationId": "runs-sync-fetchfinch-notion-scraper-knowledge-base-sync",
        "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/fetchfinch~notion-scraper-knowledge-base-sync/run-sync": {
      "post": {
        "operationId": "run-sync-fetchfinch-notion-scraper-knowledge-base-sync",
        "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": "Notion page or database URLs",
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "description": "One or more Notion pages, wikis, or databases. Duplicate page IDs are processed once.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "title": "URL",
                  "type": "string",
                  "description": "Public or integration-connected Notion page or database URL."
                }
              }
            }
          },
          "notionToken": {
            "title": "Notion integration token",
            "type": "string",
            "description": "Optional encrypted read-only integration token for private or connected pages. Public pages do not need it. The token is never written to output or logs."
          },
          "crawlSubpages": {
            "title": "Crawl child pages",
            "type": "boolean",
            "description": "Follow child-page blocks within the same Notion site.",
            "default": true
          },
          "crawlDatabasePages": {
            "title": "Crawl database row pages",
            "type": "boolean",
            "description": "Visit the body of every database row page. Leave off for fast property-only database export.",
            "default": false
          },
          "maxDepth": {
            "title": "Maximum child-page depth",
            "minimum": 0,
            "maximum": 50,
            "type": "integer",
            "description": "Start URLs have depth 0.",
            "default": 10
          },
          "maxPages": {
            "title": "Maximum pages",
            "minimum": 1,
            "maximum": 10000,
            "type": "integer",
            "description": "Global page safety limit after duplicate IDs are removed.",
            "default": 500
          },
          "maxDatabaseRows": {
            "title": "Maximum rows per database",
            "minimum": 1,
            "maximum": 50000,
            "type": "integer",
            "description": "Limits rows returned from each queried database view.",
            "default": 5000
          },
          "outputMode": {
            "title": "Dataset record type",
            "enum": [
              "pages",
              "databaseRows",
              "blocks",
              "chunks"
            ],
            "type": "string",
            "description": "Pages contain whole documents; database rows are flat property records; blocks preserve fine-grained structure; chunks are embedding-ready.",
            "default": "pages"
          },
          "formats": {
            "title": "Page content formats",
            "uniqueItems": true,
            "type": "array",
            "description": "Select only what downstream systems need to keep dataset rows compact.",
            "items": {
              "type": "string",
              "enum": [
                "markdown",
                "text",
                "html",
                "json"
              ],
              "enumTitles": [
                "Markdown",
                "Plain text",
                "HTML",
                "Typed block JSON"
              ]
            },
            "default": [
              "markdown",
              "text"
            ]
          },
          "includeRawProperties": {
            "title": "Include raw database properties",
            "type": "boolean",
            "description": "Keep the original Notion property payload beside normalized values for debugging and uncommon property types.",
            "default": false
          },
          "targetChunkTokens": {
            "title": "Target tokens per chunk",
            "minimum": 100,
            "maximum": 4000,
            "type": "integer",
            "description": "Preferred approximate chunk size; semantic boundaries can produce smaller chunks.",
            "default": 700
          },
          "maxChunkTokens": {
            "title": "Maximum tokens per chunk",
            "minimum": 150,
            "maximum": 8000,
            "type": "integer",
            "description": "Hard approximate size limit except for indivisible code and table blocks.",
            "default": 1000
          },
          "overlapTokens": {
            "title": "Chunk overlap tokens",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Approximate semantic overlap copied from the end of the preceding chunk.",
            "default": 80
          },
          "downloadAssets": {
            "title": "Download images and files",
            "type": "boolean",
            "description": "Preserve assets in the run's key-value store instead of returning expiring source links only.",
            "default": false
          },
          "createZip": {
            "title": "Create a portable ZIP per page",
            "type": "boolean",
            "description": "Store Markdown and downloaded assets in a portable bundle. Implies asset download.",
            "default": false
          },
          "maxAssetsPerPage": {
            "title": "Maximum assets per page",
            "minimum": 0,
            "maximum": 500,
            "type": "integer",
            "description": "Stops pages with many attachments from consuming unbounded storage.",
            "default": 50
          },
          "maxAssetBytes": {
            "title": "Maximum bytes per asset",
            "minimum": 1024,
            "maximum": 250000000,
            "type": "integer",
            "description": "Files larger than this limit are skipped without an asset charge.",
            "default": 25000000
          },
          "maxTotalAssetBytes": {
            "title": "Maximum asset bytes per run",
            "minimum": 1024,
            "maximum": 2000000000,
            "type": "integer",
            "description": "Combined safety limit for downloaded files and generated ZIP bundles.",
            "default": 250000000
          },
          "syncKey": {
            "title": "Sync key",
            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]*$",
            "maxLength": 80,
            "type": "string",
            "description": "Optional persistent state name. It is hashed before storage use."
          },
          "emitOnlyChanges": {
            "title": "Emit only new and changed content",
            "type": "boolean",
            "description": "Requires a sync key. Unchanged pages are checked but omitted from the dataset.",
            "default": false
          },
          "includeUnchanged": {
            "title": "Include unchanged records",
            "type": "boolean",
            "description": "Include unchanged records when a sync key is configured and change-only output is disabled.",
            "default": false
          },
          "includeErrors": {
            "title": "Include error records",
            "type": "boolean",
            "description": "Write normalized, uncharged error rows to the dataset.",
            "default": true
          },
          "failOnPageError": {
            "title": "Fail run on any page error",
            "type": "boolean",
            "description": "Strict mode. By default, batch runs continue and report partial errors in the summary.",
            "default": false
          },
          "requestTimeoutSecs": {
            "title": "Request timeout in seconds",
            "minimum": 5,
            "maximum": 120,
            "type": "integer",
            "description": "Maximum time allowed for each Notion page, API, or asset request.",
            "default": 30
          },
          "maxRequestRetries": {
            "title": "Maximum request retries",
            "minimum": 0,
            "maximum": 8,
            "type": "integer",
            "description": "Retries timeouts, rate limits, and transient server failures with backoff.",
            "default": 3
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}