Download Routes
Use these endpoints to download raw XML, minified XML, or plain text artifacts for a specific work version.
GET /work/:workId/:version/download
// Download work artifacts (raw XML, minified XML, plain text)
Download work artifacts
Downloads work artifacts in various formats. Returns a pre-signed URL redirect or saves the file locally.
curl https://api.drylab.bio/v1/work/medrxiv:2025.08.07.25333034/v1/download \
-H "Authorization: Bearer <YOUR_API_KEY>"
Path parameters
workId
string
Work identifier (public ID or external ID)
version
string
Version label (v1, v2, etc.) or published
Query parameters
Download options
kind
string
Artifact type (raw, minxml, plain) (default: raw)
disposition
string
Content disposition (inline, attachment) (default: inline)
File handling
saveTo
string
Local file path to save the download (optional)
Artifact types
raw
Original JATS XML from source
.xml.gz
minxml
Minified XML version
.xml.gz
plain
Plain text extraction
.txt.gz
Response
When saveTo
is not provided, returns a 307 Redirect to a pre-signed download URL. When saveTo
is provided, returns:
{
"success": true,
"filePath": "./downloads/work-medrxiv-2025.08.07.25333034_v1_raw.xml.gz",
"size": 1024000,
"contentType": "application/gzip",
"message": "File saved to ./downloads/work-medrxiv-2025.08.07.25333034_v1_raw.xml.gz"
}
When saveTo is not provided, the API responds with a 307 Redirect to a pre-signed S3 URL. That URL includes a Content-Disposition header (e.g. work-<public_id><version>_<kind>.xml.gz). Most download tools will pick this up automatically. Curl does if you add -OJ.
Example downloads
Example usages of this endpoint.
# Download raw XML (redirects to presigned URL)
curl https://api.drylab.bio/v1/work/8144206641/v1/download?kind=raw \
-H "Authorization: Bearer <YOUR_API_KEY>"
# Download minimal XML as attachment
curl https://api.drylab.bio/v1/work/8144206641/v1/download?kind=minxml&disposition=attachment \
-H "Authorization: Bearer <YOUR_API_KEY>"
# Download plain text and save locally
curl https://api.drylab.bio/v1/work/8144206641/v1/download?kind=plain&saveTo=./paper.txt.gz \
-H "Authorization: Bearer <YOUR_API_KEY>"
# Download published version
curl https://api.drylab.bio/v1/work/8144206641/v1/published/download?kind=raw \
-H "Authorization: Bearer <YOUR_API_KEY>"
curl -OJ https://api.drylab.bio/v1/work/8144206641/v1/download \
-H "Authorization: Bearer <YOUR_API_KEY>"
Last updated