{
  "openapi": "3.0.1",
  "info": {
    "title": "Dataset Export to S3, GCS, Azure, SFTP & Airtable",
    "description": "Export any Apify dataset to your own S3, R2, MinIO, Google Cloud Storage, Azure Blob, SFTP or FTP as CSV, JSON, JSONL, Excel or Parquet (gzip, split, path templates), or upsert it into Airtable or Postgres. Use after any scraper. Free preview.",
    "version": "0.1",
    "x-build-id": "HjZuzBjzxfhYnpcxC"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/gazidev~dataset-cloud-export/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-gazidev-dataset-cloud-export",
        "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~dataset-cloud-export/runs": {
      "post": {
        "operationId": "runs-sync-gazidev-dataset-cloud-export",
        "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~dataset-cloud-export/run-sync": {
      "post": {
        "operationId": "run-sync-gazidev-dataset-cloud-export",
        "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 ID",
            "type": "string",
            "description": "The Apify dataset to export (ID or \"username~dataset-name\"). In a \"Run Actor\" integration / webhook after another Actor, use {{resource.defaultDatasetId}}. A raw webhook payload with resource.defaultDatasetId also works. Leave empty to try the Actor with 5 sample rows."
          },
          "items": {
            "title": "Or paste JSON items",
            "type": "array",
            "description": "Optional: a JSON array of objects to export directly (handy for AI agents and quick tests). Ignored when a dataset is set."
          },
          "maxItems": {
            "title": "Max items",
            "minimum": 0,
            "type": "integer",
            "description": "Export at most this many items (0 = all).",
            "default": 0
          },
          "onlyNewItems": {
            "title": "Only new items since the last run",
            "type": "boolean",
            "description": "Remember how far this dataset was exported to this destination and only deliver items added since (datasets are append-only). Useful for scheduled runs on a named dataset that keeps growing. The cursor moves only after a successful delivery.",
            "default": false
          },
          "stateStoreName": {
            "title": "State store name",
            "type": "string",
            "description": "Named key-value store that keeps the only-new cursors.",
            "default": "dataset-cloud-export-state"
          },
          "fields": {
            "title": "Fields to export",
            "type": "array",
            "description": "Only these fields, in this order (dot paths like \"rating.stars\" or \"images.0\" allowed). Empty = all fields.",
            "items": {
              "type": "string"
            }
          },
          "omit": {
            "title": "Fields to drop",
            "type": "array",
            "description": "Fields to remove (dot paths allowed).",
            "items": {
              "type": "string"
            }
          },
          "fieldMap": {
            "title": "Rename fields (field map)",
            "type": "object",
            "description": "Rename fields: {\"source.path\": \"Target column\"}. For Airtable these must be your table's field names. If \"Fields to export\" is empty, only the mapped fields are exported."
          },
          "skipHiddenFields": {
            "title": "Skip hidden fields (#...)",
            "type": "boolean",
            "description": "Drop fields whose name starts with # (Apify convention for internal fields).",
            "default": true
          },
          "destination": {
            "title": "Destination",
            "enum": [
              "s3",
              "gcs",
              "azure",
              "sftp",
              "ftp",
              "airtable",
              "postgres",
              "apify-kvs"
            ],
            "type": "string",
            "description": "Where to deliver the data. Without connection details the run is a free PREVIEW: nothing is uploaded or charged, the dataset shows what would be delivered.",
            "default": "s3"
          },
          "dryRun": {
            "title": "Dry run (prepare, do not upload)",
            "type": "boolean",
            "description": "Build the files / records and validate the settings, but do not upload or write anything. Never charged.",
            "default": false
          },
          "format": {
            "title": "File format",
            "enum": [
              "csv",
              "json",
              "jsonl",
              "xlsx",
              "parquet"
            ],
            "type": "string",
            "description": "File format for the file destinations. CSV, XLSX and Parquet flatten nested objects into dot-notation columns (rating.stars). Ignored for Airtable / Postgres.",
            "default": "csv"
          },
          "filenameTemplate": {
            "title": "File path template",
            "type": "string",
            "description": "Path of each file inside the bucket / container / server. Placeholders: {actorName} (Actor that produced the dataset), {datasetId}, {datasetName}, {sourceRunId}, {runId}, {date} (YYYY-MM-DD), {year}, {month}, {day}, {time} (HHMMSS), {datetime}, {timestamp}, {part} (-part-0001 when split), {ext}. Folders are created as needed. For SFTP/FTP, relative paths start in the login directory.",
            "default": "apify/{actorName}/{date}/{datasetId}-{time}{part}.{ext}"
          },
          "gzip": {
            "title": "Gzip compress",
            "type": "boolean",
            "description": "Compress CSV / JSON / JSONL files (.gz). XLSX and Parquet are already compressed.",
            "default": false
          },
          "splitEvery": {
            "title": "Split every N rows",
            "minimum": 0,
            "type": "integer",
            "description": "Start a new file every N rows (0 = one file). Each file is one \"file delivered\" event.",
            "default": 0
          },
          "csvDelimiter": {
            "title": "CSV delimiter",
            "type": "string",
            "description": "Single character, or \"tab\".",
            "default": ","
          },
          "csvBom": {
            "title": "CSV with UTF-8 BOM (for Excel)",
            "type": "boolean",
            "description": "Add a byte-order mark so Excel opens UTF-8 CSV files correctly.",
            "default": false
          },
          "s3Bucket": {
            "title": "S3 bucket",
            "type": "string",
            "description": "Bucket name (no s3:// prefix)."
          },
          "s3Region": {
            "title": "Region",
            "type": "string",
            "description": "e.g. us-east-1, eu-central-1. \"auto\" for Cloudflare R2. Default us-east-1."
          },
          "s3AccessKeyId": {
            "title": "Access key ID",
            "type": "string",
            "description": "Stored encrypted. Use a key limited to s3:PutObject on this bucket (s3:ListBucket optional)."
          },
          "s3SecretAccessKey": {
            "title": "Secret access key",
            "type": "string",
            "description": "Stored encrypted."
          },
          "s3SessionToken": {
            "title": "Session token (optional)",
            "type": "string",
            "description": "Only for temporary STS credentials."
          },
          "s3EndpointUrl": {
            "title": "Custom endpoint URL (R2, MinIO, B2, Wasabi, Spaces)",
            "type": "string",
            "description": "Leave empty for AWS. Examples: https://<accountid>.r2.cloudflarestorage.com, https://s3.us-west-004.backblazeb2.com, https://minio.example.com:9000"
          },
          "s3Acl": {
            "title": "Canned ACL (optional)",
            "type": "string",
            "description": "e.g. bucket-owner-full-control or public-read. Empty = bucket default."
          },
          "s3StorageClass": {
            "title": "Storage class (optional)",
            "type": "string",
            "description": "e.g. STANDARD_IA, INTELLIGENT_TIERING, GLACIER_IR. Empty = STANDARD."
          },
          "gcsBucket": {
            "title": "GCS bucket",
            "type": "string",
            "description": "Bucket name (no gs:// prefix)."
          },
          "gcsServiceAccountJson": {
            "title": "Service account key (JSON)",
            "type": "string",
            "description": "Full content of the service account JSON key file. Stored encrypted. Needs roles/storage.objectCreator (plus objectViewer to overwrite)."
          },
          "azureConnectionString": {
            "title": "Connection string",
            "type": "string",
            "description": "Storage account connection string (Access keys page). Stored encrypted."
          },
          "azureContainer": {
            "title": "Container",
            "type": "string",
            "description": "Container name (used with the connection string)."
          },
          "azureContainerSasUrl": {
            "title": "Or container SAS URL",
            "type": "string",
            "description": "Alternative to the connection string: a container URL with a SAS token that allows create + write. Stored encrypted."
          },
          "host": {
            "title": "Host",
            "type": "string",
            "description": "Server host name or IP."
          },
          "port": {
            "title": "Port",
            "minimum": 1,
            "maximum": 65535,
            "type": "integer",
            "description": "Default 22 for SFTP, 21 for FTP."
          },
          "username": {
            "title": "Username",
            "type": "string",
            "description": "Login user."
          },
          "password": {
            "title": "Password",
            "type": "string",
            "description": "Stored encrypted. For SFTP you can use a private key instead."
          },
          "privateKey": {
            "title": "SFTP private key",
            "type": "string",
            "description": "OpenSSH / PEM private key (Ed25519, ECDSA or RSA), incl. BEGIN/END lines. Stored encrypted."
          },
          "privateKeyPassphrase": {
            "title": "Private key passphrase",
            "type": "string",
            "description": "Only if the key is encrypted."
          },
          "sftpHostKeyFingerprint": {
            "title": "SFTP host key fingerprint (optional)",
            "type": "string",
            "description": "e.g. SHA256:abc... (from ssh-keyscan | ssh-keygen -lf -). If set, the upload is refused when the server key does not match."
          },
          "ftpTls": {
            "title": "FTPS (explicit TLS)",
            "type": "boolean",
            "description": "Use FTP over TLS (AUTH TLS) for FTP.",
            "default": false
          },
          "airtableToken": {
            "title": "Airtable personal access token",
            "type": "string",
            "description": "Create at airtable.com/create/tokens with scope data.records:write and access to the base. Stored encrypted."
          },
          "airtableBaseId": {
            "title": "Base ID",
            "type": "string",
            "description": "Starts with \"app\" (from the base URL). Pasting the base URL also works."
          },
          "airtableTable": {
            "title": "Table name or ID",
            "type": "string",
            "description": "Table name or ID (tbl...)."
          },
          "upsertKey": {
            "title": "Upsert key (merge fields)",
            "type": "array",
            "description": "Airtable: 1-3 field names to match existing records (performUpsert) - matching records are updated, others created. Postgres: key columns for INSERT ... ON CONFLICT DO UPDATE (primary key when the table is created). Empty = always insert / create.",
            "items": {
              "type": "string"
            }
          },
          "airtableTypecast": {
            "title": "Typecast values",
            "type": "boolean",
            "description": "Let Airtable convert text to select options, numbers, dates, etc.",
            "default": true
          },
          "airtableApiUrl": {
            "title": "Airtable API base URL (advanced)",
            "type": "string",
            "description": "Only change for a proxy.",
            "default": "https://api.airtable.com"
          },
          "postgresUrl": {
            "title": "Postgres connection string",
            "type": "string",
            "description": "postgresql://user:password@host:5432/db?sslmode=require (Supabase: Session pooler string). Stored encrypted."
          },
          "postgresTable": {
            "title": "Table",
            "type": "string",
            "description": "Table name, optionally schema.table. Only fields that match existing columns are written.",
            "default": "apify_items"
          },
          "postgresCreateTable": {
            "title": "Create table if missing",
            "type": "boolean",
            "description": "Create the table with columns and types inferred from the first batch (objects/arrays as jsonb), with the upsert key as primary key.",
            "default": true
          },
          "kvsName": {
            "title": "Key-value store name",
            "type": "string",
            "description": "For destination \"Apify key-value store\": named store to keep files (kept forever). Empty = this run's store."
          },
          "gcsEndpointUrl": {
            "title": "GCS endpoint URL (advanced)",
            "type": "string",
            "description": "Only for GCS emulators."
          }
        }
      },
      "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}