{
  "openapi": "3.0.1",
  "info": {
    "title": "Google Drive Folder Downloader — Bulk ZIP Shared Folders",
    "description": "Bulk-download an entire Google Drive folder — every file, all subfolders — as ZIP files in the cloud, with a file manifest. No login or API key needed for public folders. Handles huge folders that make Google's own download button fail.",
    "version": "0.3",
    "x-build-id": "uL0NUAUOIkE5gjuDe"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/vasram~google-drive-folder-downloader/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-vasram-google-drive-folder-downloader",
        "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/vasram~google-drive-folder-downloader/runs": {
      "post": {
        "operationId": "runs-sync-vasram-google-drive-folder-downloader",
        "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/vasram~google-drive-folder-downloader/run-sync": {
      "post": {
        "operationId": "run-sync-vasram-google-drive-folder-downloader",
        "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": [
          "folderUrl"
        ],
        "properties": {
          "folderUrl": {
            "title": "Google Drive folder URL or ID",
            "type": "string",
            "description": "Paste the share link, e.g. https://drive.google.com/drive/folders/1AbC… — the folder must be shared as 'Anyone with the link' (or provide an OAuth token below for private folders). A bare folder ID also works."
          },
          "apiKey": {
            "title": "Your Google API key (optional)",
            "type": "string",
            "description": "Optional. Uses the official Drive API (better metadata incl. MD5, Shared Drives support). Create one at console.cloud.google.com → enable Drive API → Credentials → API key. Leave empty to use the default no-key mode for public folders."
          },
          "oauthToken": {
            "title": "OAuth access token (private folders only)",
            "type": "string",
            "description": "Only needed for private/restricted folders. Requires https://www.googleapis.com/auth/drive.readonly scope. Leave empty for public folders."
          },
          "downloadSubfolders": {
            "title": "Include subfolders",
            "type": "boolean",
            "description": "Recurse into subfolders and download everything inside.",
            "default": true
          },
          "maxDepth": {
            "title": "Max subfolder depth (-1 = unlimited)",
            "minimum": -1,
            "type": "integer",
            "description": "-1 recurses the whole tree. A positive number limits how deep subfolders are followed.",
            "default": -1
          },
          "includePatterns": {
            "title": "Download only files matching (globs)",
            "type": "array",
            "description": "Glob patterns matched against the file name or relative path, e.g. *.pdf or photos/**. Empty = download everything.",
            "items": {
              "type": "string"
            }
          },
          "excludePatterns": {
            "title": "Skip files matching (globs)",
            "type": "array",
            "description": "Glob patterns to skip, e.g. *.tmp or ~$* (Office lock files).",
            "items": {
              "type": "string"
            }
          },
          "typeFilter": {
            "title": "File type filter",
            "enum": [
              "all",
              "images",
              "documents",
              "spreadsheets",
              "pdfs",
              "videos",
              "audio",
              "archives"
            ],
            "type": "string",
            "description": "Only download files of the selected type.",
            "default": "all"
          },
          "minSizeMB": {
            "title": "Min file size (MB)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip files smaller than this. 0 = no minimum. Note: file sizes are only known in API-key mode — in the default no-key mode this filter is skipped (a warning is logged).",
            "default": 0
          },
          "maxSizeMB": {
            "title": "Max file size (MB)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip files larger than this. 0 = no maximum. Note: file sizes are only known in API-key mode — in the default no-key mode this filter is skipped (a warning is logged).",
            "default": 0
          },
          "modifiedAfter": {
            "title": "Only files modified after (YYYY-MM-DD)",
            "type": "string",
            "description": "ISO date, e.g. 2026-01-01. Only files modified after this date are downloaded — handy for scheduled incremental runs. Files whose date is unknown are kept."
          },
          "exportDocsAs": {
            "title": "Export Google Docs/Sheets/Slides as",
            "enum": [
              "pdf",
              "docx",
              "xlsx",
              "pptx",
              "csv",
              "skip"
            ],
            "type": "string",
            "description": "Google-native files (Docs, Sheets, Slides, Drawings) cannot be downloaded directly — they get converted: Docs→PDF/DOCX, Sheets→XLSX/CSV, Slides→PPTX/PDF, Drawings→PNG/PDF. Use 'skip' to ignore them.",
            "default": "pdf"
          },
          "outputMode": {
            "title": "Output mode",
            "enum": [
              "zip",
              "individual-files",
              "manifest-only"
            ],
            "type": "string",
            "description": "zip = multi-part ZIPs in the Key-Value store. individual-files = every file stored separately under files/<path>. manifest-only = just list the files without downloading anything.",
            "default": "zip"
          },
          "zipPartSizeMB": {
            "title": "ZIP part size (MB)",
            "minimum": 0,
            "type": "integer",
            "description": "Output ZIPs are split into parts of this size (0 = a single ZIP). Each part is an independent, openable ZIP file in the Key-Value store.",
            "default": 200
          },
          "preserveStructure": {
            "title": "Keep folder structure in ZIP",
            "type": "boolean",
            "description": "true keeps the exact folder tree inside the ZIP; false flattens everything into one folder.",
            "default": true
          },
          "compression": {
            "title": "ZIP compression",
            "enum": [
              "store",
              "fast",
              "best"
            ],
            "type": "string",
            "description": "store = no compression (fastest — best for photos/videos which are already compressed). fast/best = deflate.",
            "default": "store"
          },
          "maxFiles": {
            "title": "Max files per run (safety cap)",
            "minimum": 1,
            "type": "integer",
            "description": "If the folder contains more files than this, the run stops BEFORE downloading anything (and before charging) so you never get surprise costs.",
            "default": 5000
          },
          "concurrency": {
            "title": "Parallel downloads",
            "minimum": 1,
            "maximum": 20,
            "type": "integer",
            "description": "How many files to download at the same time (1–20).",
            "default": 5
          },
          "timeoutSecPerFile": {
            "title": "Per-file download timeout (sec)",
            "minimum": 10,
            "type": "integer",
            "description": "Maximum time allowed per file download.",
            "default": 120
          },
          "maxRetries": {
            "title": "Retries per file",
            "minimum": 0,
            "maximum": 10,
            "type": "integer",
            "description": "Retries on network errors, 5xx and rate limits (exponential backoff, honors Retry-After).",
            "default": 3
          },
          "incremental": {
            "title": "Incremental sync (only new/changed files)",
            "type": "boolean",
            "description": "Stores sync state in a named Key-Value store; on re-runs only new/modified files are downloaded. Great with scheduled runs.",
            "default": false
          },
          "stateStoreName": {
            "title": "Incremental state store name",
            "type": "string",
            "description": "Named Key-Value store used to remember what was already downloaded in incremental mode.",
            "default": "drive-sync-state"
          },
          "notifyWebhookUrl": {
            "title": "Webhook URL for completion notification",
            "type": "string",
            "description": "A JSON summary is POSTed here when the run finishes (success or failure). Works with Make, n8n, Zapier."
          },
          "telegramToken": {
            "title": "Telegram bot token (notifications)",
            "type": "string",
            "description": "Bot token used to send a completion message via Telegram (needs telegramChatId too)."
          },
          "telegramChatId": {
            "title": "Telegram chat ID",
            "type": "string",
            "description": "Chat or channel ID that receives the completion message."
          },
          "proxyConfiguration": {
            "title": "Proxy configuration",
            "type": "object",
            "description": "Optional. Use only if Google rate-limits or blocks the actor. Using a proxy increases platform costs.",
            "default": {
              "useApifyProxy": 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
                  }
                }
              },
              "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}