List Directory
curl --request GET \
--url https://api.example.com/browser/sessions/{id}/fs/dirimport requests
url = "https://api.example.com/browser/sessions/{id}/fs/dir"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/browser/sessions/{id}/fs/dir', 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/dir",
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/dir"
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/dir")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions/{id}/fs/dir")
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_body{
"path": "<string>",
"entries": [
{}
]
}Filesystem
List Directory
List entries of a workspace directory.
GET
/
browser
/
sessions
/
{id}
/
fs
/
dir
List Directory
curl --request GET \
--url https://api.example.com/browser/sessions/{id}/fs/dirimport requests
url = "https://api.example.com/browser/sessions/{id}/fs/dir"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/browser/sessions/{id}/fs/dir', 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/dir",
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/dir"
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/dir")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/browser/sessions/{id}/fs/dir")
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_body{
"path": "<string>",
"entries": [
{}
]
}Overview
Returns the immediate children of a workspace directory. Pass an emptypath (or omit it) to list the workspace root. The listing is not recursive — use GET /fs/zip to get the full tree as an archive.
Path Parameters
string
required
Browser session ID (UUID).
Query Parameters
string
Workspace-relative directory path. Empty or omitted lists the workspace root.
Example Request
curl -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/dir" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY"
curl -G "https://api.scrapengine.io/api/v1/browser/sessions/baa3f390-fa6e-4a24-b84a-a575a5f3a9c7/fs/dir" \
-H "Authorization: Bearer $SCRAPENGINE_API_KEY" \
--data-urlencode "path=downloads"
Response
Success Response (200)
string
The listed workspace-relative directory path.
array
Entries in the directory. Each entry contains:
name(string) — basename of the entry.path(string) — workspace-relative path of the entry.type(string) — one offile,dir,symlink,other.size(integer) — size in bytes (0 for directories).mode(integer) — Unix mode.mtime(string) — last modified timestamp (ISO 8601).
{
"path": "downloads",
"entries": [
{
"name": "invoice.pdf",
"path": "downloads/invoice.pdf",
"type": "file",
"size": 20813,
"mode": 420,
"mtime": "2026-04-24T09:12:44Z"
}
]
}
Error Responses
| Status | Description |
|---|---|
400 | Invalid path. |
401 | Unauthorized — invalid or missing API key. |
404 | Session or directory not found. |
Was this page helpful?