DocsWorx Documentation
Quickstart, authentication, endpoint shape, and examples for generating website screenshots via API.
Quickstart
Authenticate with your bearer token and send a POST to create a screenshot.
curl -X POST "https://api.docsworx.com/v1/screenshot" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"url":"https://example.com","format":"png","fullPage":true}'
API endpoint
POST https://api.docsworx.com/v1/screenshot
Returns a ready-to-use image URL or async job ID depending on request mode.
Authentication
Send your API key as a bearer token on every request.
Authorization: Bearer YOUR_API_KEY
Request parameters
(required) URL to capture.
png, jpg, webp, or pdf.
Capture entire scroll height.
desktop or mobile fixed viewport.
Viewport size override.
Milliseconds to wait before capture.
Selector or network idle.
CSS selector to clip.
Send authenticated sessions securely.
Request & response example
Request body
{
"url": "https://example.com",
"format": "png",
"fullPage": true,
"device": "desktop",
"delay": 500
}
Response
{
"status": "success",
"imageUrl": "https://cdn.docsworx.com/jobs/123.png",
"jobId": "job_123",
"meta": { "width": 1920, "height": 1080 }
}
Error codes
Invalid parameters
Invalid API key
Rate limit exceeded
Server error
Language examples
Node.js
import fetch from 'node-fetch';
const res = await fetch('https://api.docsworx.com/v1/screenshot', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: 'https://example.com', format: 'png' })
});
console.log(await res.json());
Python
import requests
payload = {"url": "https://example.com", "fullPage": True, "format": "pdf"}
res = requests.post(
"https://api.docsworx.com/v1/screenshot",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json=payload,
timeout=30
)
print(res.json())