API Reference

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

url

(required) URL to capture.

format

png, jpg, webp, or pdf.

fullPage

Capture entire scroll height.

device

desktop or mobile fixed viewport.

width / height

Viewport size override.

delay

Milliseconds to wait before capture.

waitFor

Selector or network idle.

selector

CSS selector to clip.

cookies / headers

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

400

Invalid parameters

401

Invalid API key

429

Rate limit exceeded

500

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())