2026-06-17 11:11:37 +08:00
---
description : Safely extract files from a ZIP archive with bomb protection.
---
2026-07-11 13:01:55 +08:00
# Extract ZIP {#extract-zip}
2026-06-17 11:11:37 +08:00
Safely extract files from a ZIP archive. Single-file archives return the contained file directly; multi-file archives return a flat ZIP with the extracted contents.
2026-07-11 13:01:55 +08:00
## API Endpoint {#api-endpoint}
2026-06-17 11:11:37 +08:00
2026-06-21 00:12:59 +08:00
`POST /api/v1/tools/files/extract-zip`
2026-06-17 11:11:37 +08:00
Accepts multipart form data with a ZIP file. No settings field is required.
2026-07-11 13:01:55 +08:00
## Parameters {#parameters}
2026-06-17 11:11:37 +08:00
This tool has no configurable parameters. Upload a `.zip` file to extract.
2026-07-11 13:01:55 +08:00
## Example Request {#example-request}
2026-06-17 11:11:37 +08:00
```bash
2026-06-21 00:12:59 +08:00
curl -X POST http://localhost:1349/api/v1/tools/files/extract-zip \
2026-06-17 11:11:37 +08:00
-H "Authorization: Bearer si_your-api-key" \
-F "file=@archive.zip"
```
2026-07-11 13:01:55 +08:00
## Example Response {#example-response}
2026-06-17 11:11:37 +08:00
```json
{
"jobId" : "a1b2c3d4-e5f6-7890-abcd-ef1234567890" ,
2026-06-17 17:13:31 +08:00
"downloadUrl" : "/api/v1/download/a1b2c3d4-e5f6-7890-abcd-ef1234567890/archive_extracted.zip" ,
2026-06-17 11:11:37 +08:00
"originalSize" : 2800000 ,
"processedSize" : 3500000
}
```
2026-07-11 13:01:55 +08:00
## Notes {#notes}
2026-06-17 11:11:37 +08:00
- Only `.zip` files are accepted as input.
- If the archive contains a single file, that file is returned directly (not wrapped in a ZIP).
- If the archive contains multiple files, a flat ZIP is returned with all files extracted to the root level (nested directory structure is flattened).
- Built-in bomb protection rejects archives with excessive compression ratios or file counts to prevent resource exhaustion.