Skip to content

Documentation

Get page snapshot

GET /api/v1/sites/{site}/artifacts/{uuid}

Download a page snapshot or image by UUID after site ownership is checked.

Access

A Bearer API key for this workspace is required; a read-only key is sufficient. The server also checks the owner’s permission for this resource and action. An inaccessible object is not disclosed.

Parameters

Path parameters: site, uuid. Use IDs from your own installation.

No request body is required.

This is not JSON. Content-Type depends on the artifact; save its bytes to a file. Removed content returns 410. Do not execute downloaded HTML in a trusted context of your application.

Response 200

The example is shortened; actual responses may include more fields. Sample IDs are placeholders.

This endpoint returns the requested content or an operation result.

Send the request

Set BASE to your installation URL without a trailing slash and API_KEY to a secret stored on your server. Client setup and browser JavaScript.

curl

curl --fail-with-body -X GET "$BASE/api/v1/sites/1/artifacts/11111111-1111-4111-8111-111111111111" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Accept: application/json" \
  --output result.bin

Node.js · server

// Node.js server example. Save as request.mjs.
import { writeFile } from "node:fs/promises";
const response = await fetch(process.env.BASE + "/api/v1/sites/1/artifacts/11111111-1111-4111-8111-111111111111", {
  method: "GET",
  headers: {
    Authorization: `Bearer ${process.env.API_KEY}`,
    Accept: "application/json"
  },
  signal: AbortSignal.timeout(120000)
});
if (!response.ok) throw new Error(`${response.status}: ${await response.text()}`);
await writeFile("result.bin", Buffer.from(await response.arrayBuffer()));

Python

import json
import os
import urllib.request
import urllib.error

request = urllib.request.Request(
    os.environ["BASE"] + "/api/v1/sites/1/artifacts/11111111-1111-4111-8111-111111111111",
    method="GET",
    headers={"Authorization": "Bearer " + os.environ["API_KEY"],
             "Accept": "application/json"},
)
try:
    with urllib.request.urlopen(request, timeout=120) as response:
        with open("result.bin", "wb") as target:
            target.write(response.read())
except urllib.error.HTTPError as error:
    print(error.code, error.read().decode("utf-8", errors="replace"))
    raise

PHP · external client

<?php
$handle = curl_init(getenv("BASE") . "/api/v1/sites/1/artifacts/11111111-1111-4111-8111-111111111111");
curl_setopt_array($handle, [
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 120,
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("API_KEY"),
        "Accept: application/json",
    ],
]);
$content = curl_exec($handle);
$status = curl_getinfo($handle, CURLINFO_RESPONSE_CODE);
if ($content === false) {
    throw new RuntimeException(curl_error($handle));
}
curl_close($handle);
if ($status < 200 || $status >= 300) {
    throw new RuntimeException("HTTP $status: $content");
}
file_put_contents("result.bin", $content);

Go

package main

import (
    "fmt"
    "io"
    "net/http"
    "os"
    "time"
)

func main() {
    request, err := http.NewRequest("GET", os.Getenv("BASE") + "/api/v1/sites/1/artifacts/11111111-1111-4111-8111-111111111111", nil)
    if err != nil { panic(err) }
    request.Header.Set("Authorization", "Bearer " + os.Getenv("API_KEY"))
    request.Header.Set("Accept", "application/json")
    client := &http.Client{Timeout: 120 * time.Second}
    response, err := client.Do(request)
    if err != nil { panic(err) }
    defer response.Body.Close()
    content, err := io.ReadAll(response.Body)
    if err != nil { panic(err) }
    if response.StatusCode < 200 || response.StatusCode >= 300 {
        panic(fmt.Sprintf("HTTP %d: %s", response.StatusCode, content))
    }
    if err := os.WriteFile("result.bin", content, 0600); err != nil { panic(err) }
}

If the request fails

401: check the key and its expiry. 403: check permissions, read/write scope, and 2FA. 404: check the ID and workspace. 422: check fields and resource state. 429: respect Retry-After. Errors and retries.