{
  "openapi": "3.0.1",
  "info": {
    "title": "Extract ZIP Files: Unzip Archives & Email Attachments",
    "description": "Extract every file inside ZIP, 7z, TAR/GZ archives, emails (.eml/.msg attachments), PDFs (attachments and images) and Office files (embedded media). Each file gets a direct download URL plus name, path, size, MIME type and SHA-256. Zip-bomb and path-traversal safe.",
    "version": "0.1",
    "x-build-id": "HxLoSgINDZPegj9w9"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/data-done-right~extract-zip-files/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-data-done-right-extract-zip-files",
        "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/data-done-right~extract-zip-files/runs": {
      "post": {
        "operationId": "runs-sync-data-done-right-extract-zip-files",
        "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/data-done-right~extract-zip-files/run-sync": {
      "post": {
        "operationId": "run-sync-data-done-right-extract-zip-files",
        "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": [
          "urls"
        ],
        "properties": {
          "urls": {
            "title": "File URLs",
            "type": "array",
            "description": "Links to archives (zip, 7z, tar, tar.gz/tgz, tar.bz2, tar.xz, gz), emails (.eml, .msg), PDFs, or Office files (docx, xlsx, pptx, odt). Everything inside is extracted.",
            "items": {
              "type": "string"
            }
          },
          "includeExtensions": {
            "title": "Only these extensions",
            "type": "array",
            "description": "Deliver only files with these extensions, e.g. pdf, jpg, png, csv. Empty = everything. Nested archives are still opened.",
            "items": {
              "type": "string"
            }
          },
          "excludeExtensions": {
            "title": "Skip these extensions",
            "type": "array",
            "description": "Never deliver files with these extensions, e.g. exe, dll, js.",
            "items": {
              "type": "string"
            }
          },
          "maxFiles": {
            "title": "Max files (whole run)",
            "minimum": 1,
            "type": "integer",
            "description": "Stop after this many extracted files. Also caps the cost (you pay per extracted file).",
            "default": 1000
          },
          "maxTotalSizeMb": {
            "title": "Max total extracted size (MB, whole run)",
            "minimum": 1,
            "type": "integer",
            "description": "Files that would push the run past this many extracted megabytes are skipped.",
            "default": 1024
          },
          "nestedDepth": {
            "title": "Nested archive depth",
            "minimum": 0,
            "maximum": 3,
            "type": "integer",
            "description": "How many levels of archives/emails inside the source to open (a zip inside a zip, an email attached to an email). 0 = deliver inner archives as files.",
            "default": 1
          },
          "keepNestedArchives": {
            "title": "Also deliver opened inner archives",
            "type": "boolean",
            "description": "When an inner archive/email is opened, also deliver the archive file itself.",
            "default": false
          },
          "flattenPaths": {
            "title": "Unique flat file names",
            "type": "boolean",
            "description": "Make every fileName unique across the run (report.pdf, report (2).pdf), so all files can be saved into one folder. 'path' becomes the flat name too; the original folder path stays in 'originalPath'.",
            "default": false
          },
          "skipDuplicates": {
            "title": "Skip duplicate files",
            "type": "boolean",
            "description": "Skip files whose content (SHA-256) was already delivered in this run, e.g. the same logo in every email.",
            "default": false
          },
          "skipJunkFiles": {
            "title": "Skip junk files",
            "type": "boolean",
            "description": "Skip __MACOSX folders, ._ resource forks, .DS_Store, Thumbs.db and desktop.ini.",
            "default": true
          },
          "emailInlineImages": {
            "title": "Email: include inline images",
            "type": "boolean",
            "description": "Deliver inline images (signature logos, embedded pictures). Turn off to get only real attachments.",
            "default": true
          },
          "emailMetadataRows": {
            "title": "Email: output headers and body",
            "type": "boolean",
            "description": "Add one row per email with from, to, cc, date, subject and the text/HTML body (free, not charged).",
            "default": true
          },
          "pdfAttachments": {
            "title": "PDF: embedded file attachments",
            "type": "boolean",
            "description": "Extract files attached to PDFs (e.g. ZUGFeRD/Factur-X invoice XML, portfolios).",
            "default": true
          },
          "pdfImages": {
            "title": "PDF: embedded images",
            "type": "boolean",
            "description": "Extract images embedded in PDF pages (saved as PNG/JPG; identical images are extracted once).",
            "default": true
          },
          "pdfMinImageSize": {
            "title": "PDF: minimum image size (px)",
            "minimum": 0,
            "type": "integer",
            "description": "Skip PDF images narrower or shorter than this (removes tiny icons, lines and masks).",
            "default": 32
          },
          "officeEmbeddedFiles": {
            "title": "Office: include embedded files",
            "type": "boolean",
            "description": "Besides media (images, video), also deliver embedded objects from docx/xlsx/pptx (e.g. an Excel sheet inside a Word file).",
            "default": true
          },
          "maxFileSizeMb": {
            "title": "Max size per extracted file (MB)",
            "minimum": 1,
            "type": "integer",
            "description": "Larger inner files are skipped (listed in the summary).",
            "default": 200
          },
          "maxDownloadSizeMb": {
            "title": "Max source download size (MB)",
            "minimum": 1,
            "maximum": 1000,
            "type": "integer",
            "description": "Source files larger than this are not downloaded.",
            "default": 200
          },
          "maxCompressionRatio": {
            "title": "Zip-bomb guard: max compression ratio",
            "minimum": 10,
            "type": "integer",
            "description": "Entries or archives that expand more than this many times their compressed size are refused (only checked above 1 MB uncompressed). Normal files compress 2-20x; zip bombs 1000x+.",
            "default": 200
          },
          "maxEntriesPerSource": {
            "title": "Zip-bomb guard: max entries per source",
            "minimum": 1,
            "type": "integer",
            "description": "Stop reading a source after this many entries (all nesting levels).",
            "default": 10000
          },
          "timeoutSecondsPerSource": {
            "title": "Timeout per source (seconds)",
            "minimum": 10,
            "type": "integer",
            "description": "Stop extracting a source after this long; files found so far are kept.",
            "default": 300
          },
          "keyValueStoreName": {
            "title": "Save files to named key-value store",
            "type": "string",
            "description": "Optional. Save extracted files into this named store (kept until you delete it) instead of the run's default store (deleted after your plan's data retention period)."
          },
          "proxyConfiguration": {
            "title": "Proxy",
            "type": "object",
            "description": "Only needed if the file host blocks datacenter IPs.",
            "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
                  },
                  "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
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}