{
  "openapi": "3.0.1",
  "info": {
    "title": "Export Datasets to SFTP, FTP, Dropbox & Google Drive",
    "description": "Deliver any scraper's dataset as a CSV, JSON, JSONL or Excel file (optionally gzipped) to your own SFTP or FTPS server, Dropbox or Google Drive after every run. Atomic uploads, SFTP host-key pinning, retries, and one destination failing never blocks the others. $0.0045 per file delivered.",
    "version": "0.0",
    "x-build-id": "Q3Ndbn7soZyYTHaYy"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/charlesmarkette~dataset-delivery-export-to-sftp-ftp-dropbox-google-drive/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-charlesmarkette-dataset-delivery-export-to-sftp-ftp-dropbox-google-drive",
        "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/charlesmarkette~dataset-delivery-export-to-sftp-ftp-dropbox-google-drive/runs": {
      "post": {
        "operationId": "runs-sync-charlesmarkette-dataset-delivery-export-to-sftp-ftp-dropbox-google-drive",
        "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/charlesmarkette~dataset-delivery-export-to-sftp-ftp-dropbox-google-drive/run-sync": {
      "post": {
        "operationId": "run-sync-charlesmarkette-dataset-delivery-export-to-sftp-ftp-dropbox-google-drive",
        "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": {
          "datasetId": {
            "title": "Dataset",
            "type": "string",
            "description": "The dataset to deliver, usually the scraper run's output. In an integration (Integrations → Connect Actor or task), use {{resource.defaultDatasetId}}. Leave empty to deliver a small test file with 3 sample items."
          },
          "format": {
            "title": "File format",
            "enum": [
              "csv",
              "json",
              "jsonl",
              "xlsx"
            ],
            "type": "string",
            "description": "CSV and XLSX flatten nested fields into columns like 'address/city' and 'images/0', as Apify's own CSV export does.",
            "default": "csv"
          },
          "gzip": {
            "title": "Compress with gzip",
            "type": "boolean",
            "description": "CSV, JSON and JSONL only: delivers a .gz file (ext becomes csv.gz). XLSX is already compressed.",
            "default": false
          },
          "fields": {
            "title": "Fields",
            "type": "array",
            "description": "Optional: only these fields, in this order. Dots for nested fields ('seller.name'). Empty = all fields.",
            "items": {
              "type": "string"
            }
          },
          "omitFields": {
            "title": "Remove these fields",
            "type": "array",
            "description": "Optional: fields to leave out (dots for nested fields).",
            "items": {
              "type": "string"
            }
          },
          "fileNameTemplate": {
            "title": "File name",
            "type": "string",
            "description": "Placeholders: {date} (YYYY-MM-DD, UTC), {datetime} (YYYY-MM-DDTHH-MM-SSZ, UTC), {runId}, {datasetId}, {actorName}, {ext}. Use '/' for sub-folders, e.g. 'exports/{date}/{actorName}.{ext}'. (Single braces: Apify integrations fill in {{…}} themselves.)",
            "default": "{actorName}-{date}.{ext}"
          },
          "actorName": {
            "title": "Name for {actorName}",
            "type": "string",
            "description": "Optional. Default: the name of the Actor that made the dataset (looked up on the platform), else 'dataset'."
          },
          "ifExists": {
            "title": "If a file exists",
            "enum": [
              "overwrite",
              "skip",
              "addSuffix"
            ],
            "type": "string",
            "description": "Overwrite replaces it atomically (on Google Drive: same file and link, new version). Add a number: report-1.csv, report-2.csv … (Dropbox names it 'report (1).csv' itself).",
            "default": "overwrite"
          },
          "uploadMode": {
            "title": "Upload mode (SFTP and FTP)",
            "enum": [
              "atomic",
              "direct"
            ],
            "type": "string",
            "description": "Atomic (default) means a job watching the folder never sees half a file. Direct writes the final name with no .part and no rename, for drop folders that react to any new file or don't allow renames.",
            "default": "atomic"
          },
          "onlyIfItems": {
            "title": "Only if the dataset has items",
            "type": "boolean",
            "description": "Empty datasets deliver nothing and are free.",
            "default": true
          },
          "dryRun": {
            "title": "Dry run (build the file, don't upload)",
            "type": "boolean",
            "description": "Builds the file and reports its name, size and row count for every configured destination without uploading (free).",
            "default": false
          },
          "csvDelimiter": {
            "title": "CSV delimiter",
            "enum": [
              "comma",
              "semicolon",
              "tab",
              "pipe"
            ],
            "type": "string",
            "description": "CSV only.",
            "default": "comma"
          },
          "csvBom": {
            "title": "UTF-8 BOM",
            "type": "boolean",
            "description": "CSV only: start the file with a byte order mark, so Excel opens accented characters correctly. Leave off for databases and BI tools.",
            "default": false
          },
          "csvFormulaGuard": {
            "title": "Protect against formula injection",
            "type": "boolean",
            "description": "CSV only: values starting with = + - @ (or a tab or CR) get a leading ' so spreadsheet apps don't run them as formulas. Plain numbers like -5 are left alone. XLSX cells are always stored as text, never formulas.",
            "default": true
          },
          "xlsxSheetName": {
            "title": "Excel sheet name",
            "type": "string",
            "description": "XLSX only. At most 31 characters.",
            "default": "Data"
          },
          "xlsxOverflow": {
            "title": "When rows don't fit one sheet",
            "enum": [
              "split",
              "fail"
            ],
            "type": "string",
            "description": "An Excel sheet holds 1,048,576 rows including the header.",
            "default": "split"
          },
          "sftpHost": {
            "title": "SFTP host",
            "type": "string",
            "description": "Host name or IP, like sftp.example.com. Stored encrypted."
          },
          "sftpPort": {
            "title": "SFTP port",
            "minimum": 1,
            "maximum": 65535,
            "type": "integer",
            "description": "Usually 22.",
            "default": 22
          },
          "sftpUsername": {
            "title": "SFTP username",
            "type": "string",
            "description": "Stored encrypted."
          },
          "sftpPassword": {
            "title": "SFTP password",
            "type": "string",
            "description": "Or use a private key below. Stored encrypted."
          },
          "sftpPrivateKey": {
            "title": "SFTP private key",
            "type": "string",
            "description": "The whole private key file (OpenSSH or PEM: Ed25519, ECDSA or RSA), starting with -----BEGIN … PRIVATE KEY-----. Stored encrypted."
          },
          "sftpPrivateKeyPassphrase": {
            "title": "Key passphrase",
            "type": "string",
            "description": "Only if the private key is encrypted. Stored encrypted."
          },
          "sftpHostKeyFingerprint": {
            "title": "Host key fingerprint",
            "type": "string",
            "description": "Recommended (required for password login unless you allow an unpinned key): the server's SHA256 fingerprint as `ssh-keygen -l` prints it (SHA256:…). Any other server is refused before logging in. If empty, the run logs the fingerprint so you can paste it here. Several can be separated by commas."
          },
          "allowUnpinnedHostKey": {
            "title": "Allow an unpinned host key with a password",
            "type": "boolean",
            "description": "Off (default): without a pinned fingerprint, password login is refused (the run says the server's fingerprint so you can pin it), because a man-in-the-middle could capture the password and the file. Key login without a pin works, with a warning. Turn on only at your own risk.",
            "default": false
          },
          "sftpRemoteDir": {
            "title": "SFTP remote folder",
            "type": "string",
            "description": "Where the file goes, absolute (/data/outbound) or relative to the login folder (outbound). Created if missing. Empty = the login folder."
          },
          "ftpHost": {
            "title": "FTP host",
            "type": "string",
            "description": "Host name or IP, like ftp.example.com. Stored encrypted."
          },
          "ftpPort": {
            "title": "FTP port",
            "minimum": 1,
            "maximum": 65535,
            "type": "integer",
            "description": "Usually 21 (also for explicit FTPS).",
            "default": 21
          },
          "ftpUsername": {
            "title": "FTP username",
            "type": "string",
            "description": "Empty = anonymous. Stored encrypted."
          },
          "ftpPassword": {
            "title": "FTP password",
            "type": "string",
            "description": "Stored encrypted."
          },
          "ftpSecurity": {
            "title": "FTP security",
            "enum": [
              "tls",
              "none"
            ],
            "type": "string",
            "description": "Implicit FTPS (port 990) isn't supported; most servers offer explicit TLS on port 21.",
            "default": "tls"
          },
          "ftpVerifyCertificate": {
            "title": "Verify the TLS certificate",
            "type": "boolean",
            "description": "Turn off only for a server with a self-signed certificate that you trust.",
            "default": true
          },
          "ftpPassive": {
            "title": "Passive mode",
            "type": "boolean",
            "description": "Leave on unless your server needs active mode (rare; active mode usually fails through firewalls).",
            "default": true
          },
          "ftpRemoteDir": {
            "title": "FTP remote folder",
            "type": "string",
            "description": "Absolute (/outbound) or relative to the login folder. Created if missing."
          },
          "dropboxAppKey": {
            "title": "Dropbox app key",
            "type": "string",
            "description": "From the App Console (Settings tab). Stored encrypted."
          },
          "dropboxAppSecret": {
            "title": "Dropbox app secret",
            "type": "string",
            "description": "From the App Console (Settings tab). Stored encrypted."
          },
          "dropboxRefreshToken": {
            "title": "Dropbox refresh token",
            "type": "string",
            "description": "Long-lived; see the README for the one-time steps to get it. Stored encrypted."
          },
          "dropboxAccessToken": {
            "title": "Dropbox access token (short-lived)",
            "type": "string",
            "description": "Instead of the three fields above, for a quick test: the 'Generate' button in the App Console. It expires after a short time. Stored encrypted."
          },
          "dropboxFolder": {
            "title": "Dropbox folder",
            "type": "string",
            "description": "Like /reports. With an 'App folder' app, this is inside /Apps/<your app>/ (write /reports, not /Apps/<your app>/reports). Empty = the top (or the app folder)."
          },
          "googleServiceAccountKey": {
            "title": "Service account key (JSON)",
            "type": "string",
            "description": "The whole JSON key file of a Google Cloud service account. Stored encrypted."
          },
          "googleDriveFolder": {
            "title": "Folder",
            "type": "string",
            "description": "The folder's link (https://drive.google.com/drive/folders/…) or ID, shared with the service account's client_email as Editor (in a shared drive: a member with the Contributor or Content manager role)."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}