Download an artifact's bytes
The node side of artifact URLs. People and agents use the artifact's `url`, `https://usercontent.b3os.org/a/<artifact host id>/<name>?node=<node>&exp=<exp>&sig=<sig>`; the usercontent Worker checks the signature and serves the bytes from storage, or, until the upload has finished, from this route through the tunnel (with the same `node`, `exp` and `sig`). beta-api.b3os.org and beta.b3os.org never serve this route (`x-b3os-host: usercontent`). **Signature.** `sig` is the base64url (no padding) Ed25519 signature, made with the node key (the one that signs usage batches; the edge holds its public key), over the UTF-8 bytes of ``` "b3os-url-v1 " + node + " " + method + " " + path + " " + exp ``` `node` is the signing node's ID (`n1`, also the `node` query parameter), `method` is `GET` (a `HEAD` request is checked as `GET`), `path` is this route's path, `/v1/render/artifacts/<artifact_id>/content/<name>`, with the ID in `art_` form (not the host-safe `art-` form of the usercontent path), and `exp` is the expiry in Unix seconds, written in decimal without leading zeros. Other query parameters are not signed and are ignored. The Worker and the node both check the signature (`verify_strict`) and that `exp` has not passed; the node also checks that `node` is its own ID. A refused URL is `403 signed_url_invalid` with `reason`. `name` is the artifact's file name as it appears in `url`; any other name is `404 artifact_not_found`. **Response.** The artifact's bytes with its content type, `Content-Security-Policy: sandbox` (so a page or SVG never runs scripts or reads the origin) and `X-Content-Type-Options: nosniff`. One byte range per request (`Range: bytes=…`) is answered with `206`; an unsatisfiable or multi-part range is ignored and the whole artifact is returned. The response starts within 65 seconds; large videos then stream at the speed of the node's uplink.
/v1/render/artifacts/{artifact_id}/content/{name}
Path Parameters
artifact_id
string
required
path
"art_01m5t41x77fg4pdnm2ryq73wgs"name
string
required
path
"screenshot.webp"Query Parameters
node
string
required
query
"n1"exp
integer
required
query
1793040000sig
string
required
query
"qOxWOOryXIikfgvLdKZ3rjxZyxuO_eFCf-VXOHy2Zf5AEuXtOr-JsyyXTvIPP8joM4Rbp519aKjyAkMMxVAvAQ"Header Parameters
Range
string
optional
header
Responses
image/*curl -X GET 'https://beta-api.b3os.org/v1/render/artifacts/art_01m5t41x77fg4pdnm2ryq73wgs/content/screenshot.webp?node=n1&exp=1793040000&sig=qOxWOOryXIikfgvLdKZ3rjxZyxuO_eFCf-VXOHy2Zf5AEuXtOr-JsyyXTvIPP8joM4Rbp519aKjyAkMMxVAvAQ' \ -H 'Authorization: Bearer YOUR_API_TOKEN'
const response = await fetch('https://beta-api.b3os.org/v1/render/artifacts/art_01m5t41x77fg4pdnm2ryq73wgs/content/screenshot.webp?node=n1&exp=1793040000&sig=qOxWOOryXIikfgvLdKZ3rjxZyxuO_eFCf-VXOHy2Zf5AEuXtOr-JsyyXTvIPP8joM4Rbp519aKjyAkMMxVAvAQ', { method: 'GET', headers: { "Authorization": "Bearer YOUR_API_TOKEN" }});const data = await response.json();console.log(data);
import requestsheaders = { 'Authorization': 'Bearer YOUR_API_TOKEN'}response = requests.get('https://beta-api.b3os.org/v1/render/artifacts/art_01m5t41x77fg4pdnm2ryq73wgs/content/screenshot.webp?node=n1&exp=1793040000&sig=qOxWOOryXIikfgvLdKZ3rjxZyxuO_eFCf-VXOHy2Zf5AEuXtOr-JsyyXTvIPP8joM4Rbp519aKjyAkMMxVAvAQ', headers=headers)print(response.json())
"<binary>"
Try this endpoint
/v1/render/artifacts/{artifact_id}/content/{name}