Download Zip
curl --request GET \
--url https://api.example.com/browser/sessions/{id}/fs/zipimport requests
url = "https://api.example.com/browser/sessions/{id}/fs/zip"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/browser/sessions/{id}/fs/zip', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/browser/sessions/{id}/fs/zip",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/browser/sessions/{id}/fs/zip"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/browser/sessions/{id}/fs/zip")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions/{id}/fs/zip")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyFilesystem
Download Zip
Download a workspace directory as a ZIP archive.
GET
/
browser
/
sessions
/
{id}
/
fs
/
zip
Download Zip
curl --request GET \
--url https://api.example.com/browser/sessions/{id}/fs/zipimport requests
url = "https://api.example.com/browser/sessions/{id}/fs/zip"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/browser/sessions/{id}/fs/zip', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/browser/sessions/{id}/fs/zip",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/browser/sessions/{id}/fs/zip"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/browser/sessions/{id}/fs/zip")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions/{id}/fs/zip")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_bodyOverview
Streams a ZIP archive of a workspace directory. Passpath to archive a subdirectory, or omit it to archive the entire workspace root. The response is application/zip with a Content-Disposition: attachment header; point your HTTP client at a file when calling this endpoint from the CLI.
Path Parameters
string
required
Browser session ID (UUID).
Query Parameters
string
Workspace-relative directory to archive. When empty/omitted, the full workspace is archived as
workspace.zip.Example Request
curl -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/zip" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
-o workspace.zip
curl -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/zip" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
--data-urlencode "path=downloads" \
-o downloads.zip
Response
Success Response (200)
Binary response withContent-Type: application/zip and a Content-Disposition: attachment; filename="<path>.zip" header. When path is omitted the filename is workspace.zip; otherwise slashes in the path are replaced with dashes (e.g. exports/csv becomes exports-csv.zip).
Error Responses
| Status | Description |
|---|---|
400 | Invalid path. |
401 | Unauthorized — invalid or missing API key. |
404 | Session or path not found. |
413 | Zip archive would exceed the 500 MiB server-side cap (MAX_ZIP_BYTES). |
Was this page helpful?