cURL
curl --request POST \
--url https://api.doczilla.app/v1/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"page": {
"url": "<string>",
"html": "<string>",
"htmlTemplate": "<string>",
"templateData": {},
"waitUntil": "auto",
"waitForMilliseconds": 2500,
"waitForSelector": {
"selector": "<string>",
"options": {
"visible": false,
"hidden": false,
"timeout": 10000
}
},
"waitForFunction": {
"pageFunction": "window.innerWidth < 100",
"options": {
"polling": "raf",
"timeout": 10000
}
},
"headers": {
"x-foo": "bar"
},
"adblock": true,
"javascript": true,
"cookies": [
{
"name": "<string>",
"value": "<string>",
"domain": "<string>",
"url": "<string>",
"path": "<string>",
"secure": true,
"httpOnly": true,
"expires": 123
}
],
"authentication": {
"username": "<string>",
"password": "<string>"
},
"colorScheme": "<string>",
"timezone": "<string>"
},
"screenshot": {
"type": "png",
"device": "Macbook Pro 16",
"viewport": {
"width": 2240,
"height": 1260,
"deviceScaleFactor": 1,
"isMobile": false,
"hasTouch": false,
"isLandscape": false
},
"fullPage": false,
"fromSurface": true,
"omitBackground": false,
"optimizeForSpeed": true,
"quality": 50,
"captureBeyondViewport": false,
"clip": {
"width": 2240,
"height": 1260,
"x": 123,
"y": 123,
"scale": 1
},
"element": "<string>",
"overlay": {
"background": "<string>",
"filter": "none",
"margin": 0.2,
"screenshotBorderRadius": 0
}
}
}
'import requests
url = "https://api.doczilla.app/v1/screenshot"
payload = {
"page": {
"url": "<string>",
"html": "<string>",
"htmlTemplate": "<string>",
"templateData": {},
"waitUntil": "auto",
"waitForMilliseconds": 2500,
"waitForSelector": {
"selector": "<string>",
"options": {
"visible": False,
"hidden": False,
"timeout": 10000
}
},
"waitForFunction": {
"pageFunction": "window.innerWidth < 100",
"options": {
"polling": "raf",
"timeout": 10000
}
},
"headers": { "x-foo": "bar" },
"adblock": True,
"javascript": True,
"cookies": [
{
"name": "<string>",
"value": "<string>",
"domain": "<string>",
"url": "<string>",
"path": "<string>",
"secure": True,
"httpOnly": True,
"expires": 123
}
],
"authentication": {
"username": "<string>",
"password": "<string>"
},
"colorScheme": "<string>",
"timezone": "<string>"
},
"screenshot": {
"type": "png",
"device": "Macbook Pro 16",
"viewport": {
"width": 2240,
"height": 1260,
"deviceScaleFactor": 1,
"isMobile": False,
"hasTouch": False,
"isLandscape": False
},
"fullPage": False,
"fromSurface": True,
"omitBackground": False,
"optimizeForSpeed": True,
"quality": 50,
"captureBeyondViewport": False,
"clip": {
"width": 2240,
"height": 1260,
"x": 123,
"y": 123,
"scale": 1
},
"element": "<string>",
"overlay": {
"background": "<string>",
"filter": "none",
"margin": 0.2,
"screenshotBorderRadius": 0
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
page: {
url: '<string>',
html: '<string>',
htmlTemplate: '<string>',
templateData: {},
waitUntil: 'auto',
waitForMilliseconds: 2500,
waitForSelector: {selector: '<string>', options: {visible: false, hidden: false, timeout: 10000}},
waitForFunction: {
pageFunction: 'window.innerWidth < 100',
options: {polling: 'raf', timeout: 10000}
},
headers: {'x-foo': 'bar'},
adblock: true,
javascript: true,
cookies: [
{
name: '<string>',
value: '<string>',
domain: '<string>',
url: '<string>',
path: '<string>',
secure: true,
httpOnly: true,
expires: 123
}
],
authentication: {username: '<string>', password: '<string>'},
colorScheme: '<string>',
timezone: '<string>'
},
screenshot: {
type: 'png',
device: 'Macbook Pro 16',
viewport: {
width: 2240,
height: 1260,
deviceScaleFactor: 1,
isMobile: false,
hasTouch: false,
isLandscape: false
},
fullPage: false,
fromSurface: true,
omitBackground: false,
optimizeForSpeed: true,
quality: 50,
captureBeyondViewport: false,
clip: {width: 2240, height: 1260, x: 123, y: 123, scale: 1},
element: '<string>',
overlay: {background: '<string>', filter: 'none', margin: 0.2, screenshotBorderRadius: 0}
}
})
};
fetch('https://api.doczilla.app/v1/screenshot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.doczilla.app/v1/screenshot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'page' => [
'url' => '<string>',
'html' => '<string>',
'htmlTemplate' => '<string>',
'templateData' => [
],
'waitUntil' => 'auto',
'waitForMilliseconds' => 2500,
'waitForSelector' => [
'selector' => '<string>',
'options' => [
'visible' => false,
'hidden' => false,
'timeout' => 10000
]
],
'waitForFunction' => [
'pageFunction' => 'window.innerWidth < 100',
'options' => [
'polling' => 'raf',
'timeout' => 10000
]
],
'headers' => [
'x-foo' => 'bar'
],
'adblock' => true,
'javascript' => true,
'cookies' => [
[
'name' => '<string>',
'value' => '<string>',
'domain' => '<string>',
'url' => '<string>',
'path' => '<string>',
'secure' => true,
'httpOnly' => true,
'expires' => 123
]
],
'authentication' => [
'username' => '<string>',
'password' => '<string>'
],
'colorScheme' => '<string>',
'timezone' => '<string>'
],
'screenshot' => [
'type' => 'png',
'device' => 'Macbook Pro 16',
'viewport' => [
'width' => 2240,
'height' => 1260,
'deviceScaleFactor' => 1,
'isMobile' => false,
'hasTouch' => false,
'isLandscape' => false
],
'fullPage' => false,
'fromSurface' => true,
'omitBackground' => false,
'optimizeForSpeed' => true,
'quality' => 50,
'captureBeyondViewport' => false,
'clip' => [
'width' => 2240,
'height' => 1260,
'x' => 123,
'y' => 123,
'scale' => 1
],
'element' => '<string>',
'overlay' => [
'background' => '<string>',
'filter' => 'none',
'margin' => 0.2,
'screenshotBorderRadius' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.doczilla.app/v1/screenshot"
payload := strings.NewReader("{\n \"page\": {\n \"url\": \"<string>\",\n \"html\": \"<string>\",\n \"htmlTemplate\": \"<string>\",\n \"templateData\": {},\n \"waitUntil\": \"auto\",\n \"waitForMilliseconds\": 2500,\n \"waitForSelector\": {\n \"selector\": \"<string>\",\n \"options\": {\n \"visible\": false,\n \"hidden\": false,\n \"timeout\": 10000\n }\n },\n \"waitForFunction\": {\n \"pageFunction\": \"window.innerWidth < 100\",\n \"options\": {\n \"polling\": \"raf\",\n \"timeout\": 10000\n }\n },\n \"headers\": {\n \"x-foo\": \"bar\"\n },\n \"adblock\": true,\n \"javascript\": true,\n \"cookies\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"domain\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": \"<string>\",\n \"secure\": true,\n \"httpOnly\": true,\n \"expires\": 123\n }\n ],\n \"authentication\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"colorScheme\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"screenshot\": {\n \"type\": \"png\",\n \"device\": \"Macbook Pro 16\",\n \"viewport\": {\n \"width\": 2240,\n \"height\": 1260,\n \"deviceScaleFactor\": 1,\n \"isMobile\": false,\n \"hasTouch\": false,\n \"isLandscape\": false\n },\n \"fullPage\": false,\n \"fromSurface\": true,\n \"omitBackground\": false,\n \"optimizeForSpeed\": true,\n \"quality\": 50,\n \"captureBeyondViewport\": false,\n \"clip\": {\n \"width\": 2240,\n \"height\": 1260,\n \"x\": 123,\n \"y\": 123,\n \"scale\": 1\n },\n \"element\": \"<string>\",\n \"overlay\": {\n \"background\": \"<string>\",\n \"filter\": \"none\",\n \"margin\": 0.2,\n \"screenshotBorderRadius\": 0\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.doczilla.app/v1/screenshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"page\": {\n \"url\": \"<string>\",\n \"html\": \"<string>\",\n \"htmlTemplate\": \"<string>\",\n \"templateData\": {},\n \"waitUntil\": \"auto\",\n \"waitForMilliseconds\": 2500,\n \"waitForSelector\": {\n \"selector\": \"<string>\",\n \"options\": {\n \"visible\": false,\n \"hidden\": false,\n \"timeout\": 10000\n }\n },\n \"waitForFunction\": {\n \"pageFunction\": \"window.innerWidth < 100\",\n \"options\": {\n \"polling\": \"raf\",\n \"timeout\": 10000\n }\n },\n \"headers\": {\n \"x-foo\": \"bar\"\n },\n \"adblock\": true,\n \"javascript\": true,\n \"cookies\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"domain\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": \"<string>\",\n \"secure\": true,\n \"httpOnly\": true,\n \"expires\": 123\n }\n ],\n \"authentication\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"colorScheme\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"screenshot\": {\n \"type\": \"png\",\n \"device\": \"Macbook Pro 16\",\n \"viewport\": {\n \"width\": 2240,\n \"height\": 1260,\n \"deviceScaleFactor\": 1,\n \"isMobile\": false,\n \"hasTouch\": false,\n \"isLandscape\": false\n },\n \"fullPage\": false,\n \"fromSurface\": true,\n \"omitBackground\": false,\n \"optimizeForSpeed\": true,\n \"quality\": 50,\n \"captureBeyondViewport\": false,\n \"clip\": {\n \"width\": 2240,\n \"height\": 1260,\n \"x\": 123,\n \"y\": 123,\n \"scale\": 1\n },\n \"element\": \"<string>\",\n \"overlay\": {\n \"background\": \"<string>\",\n \"filter\": \"none\",\n \"margin\": 0.2,\n \"screenshotBorderRadius\": 0\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.doczilla.app/v1/screenshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page\": {\n \"url\": \"<string>\",\n \"html\": \"<string>\",\n \"htmlTemplate\": \"<string>\",\n \"templateData\": {},\n \"waitUntil\": \"auto\",\n \"waitForMilliseconds\": 2500,\n \"waitForSelector\": {\n \"selector\": \"<string>\",\n \"options\": {\n \"visible\": false,\n \"hidden\": false,\n \"timeout\": 10000\n }\n },\n \"waitForFunction\": {\n \"pageFunction\": \"window.innerWidth < 100\",\n \"options\": {\n \"polling\": \"raf\",\n \"timeout\": 10000\n }\n },\n \"headers\": {\n \"x-foo\": \"bar\"\n },\n \"adblock\": true,\n \"javascript\": true,\n \"cookies\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"domain\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": \"<string>\",\n \"secure\": true,\n \"httpOnly\": true,\n \"expires\": 123\n }\n ],\n \"authentication\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"colorScheme\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"screenshot\": {\n \"type\": \"png\",\n \"device\": \"Macbook Pro 16\",\n \"viewport\": {\n \"width\": 2240,\n \"height\": 1260,\n \"deviceScaleFactor\": 1,\n \"isMobile\": false,\n \"hasTouch\": false,\n \"isLandscape\": false\n },\n \"fullPage\": false,\n \"fromSurface\": true,\n \"omitBackground\": false,\n \"optimizeForSpeed\": true,\n \"quality\": 50,\n \"captureBeyondViewport\": false,\n \"clip\": {\n \"width\": 2240,\n \"height\": 1260,\n \"x\": 123,\n \"y\": 123,\n \"scale\": 1\n },\n \"element\": \"<string>\",\n \"overlay\": {\n \"background\": \"<string>\",\n \"filter\": \"none\",\n \"margin\": 0.2,\n \"screenshotBorderRadius\": 0\n }\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"message": "Validations failed!",
"code": "api.validation",
"fields": {
"page.url": "must be a URL address"
}
}{
"message": "Unauthorized"
}{
"message": "Reached subscription limit!"
}{
"message": "Token has no active subscription!"
}{
"message": "Request body is too large"
}{
"message": "Too Many Requests!"
}{
"message": "Internal server error"
}Screenshot
Create screenshot
Create a screenshot and directly return the raw result.
POST
/
v1
/
screenshot
cURL
curl --request POST \
--url https://api.doczilla.app/v1/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"page": {
"url": "<string>",
"html": "<string>",
"htmlTemplate": "<string>",
"templateData": {},
"waitUntil": "auto",
"waitForMilliseconds": 2500,
"waitForSelector": {
"selector": "<string>",
"options": {
"visible": false,
"hidden": false,
"timeout": 10000
}
},
"waitForFunction": {
"pageFunction": "window.innerWidth < 100",
"options": {
"polling": "raf",
"timeout": 10000
}
},
"headers": {
"x-foo": "bar"
},
"adblock": true,
"javascript": true,
"cookies": [
{
"name": "<string>",
"value": "<string>",
"domain": "<string>",
"url": "<string>",
"path": "<string>",
"secure": true,
"httpOnly": true,
"expires": 123
}
],
"authentication": {
"username": "<string>",
"password": "<string>"
},
"colorScheme": "<string>",
"timezone": "<string>"
},
"screenshot": {
"type": "png",
"device": "Macbook Pro 16",
"viewport": {
"width": 2240,
"height": 1260,
"deviceScaleFactor": 1,
"isMobile": false,
"hasTouch": false,
"isLandscape": false
},
"fullPage": false,
"fromSurface": true,
"omitBackground": false,
"optimizeForSpeed": true,
"quality": 50,
"captureBeyondViewport": false,
"clip": {
"width": 2240,
"height": 1260,
"x": 123,
"y": 123,
"scale": 1
},
"element": "<string>",
"overlay": {
"background": "<string>",
"filter": "none",
"margin": 0.2,
"screenshotBorderRadius": 0
}
}
}
'import requests
url = "https://api.doczilla.app/v1/screenshot"
payload = {
"page": {
"url": "<string>",
"html": "<string>",
"htmlTemplate": "<string>",
"templateData": {},
"waitUntil": "auto",
"waitForMilliseconds": 2500,
"waitForSelector": {
"selector": "<string>",
"options": {
"visible": False,
"hidden": False,
"timeout": 10000
}
},
"waitForFunction": {
"pageFunction": "window.innerWidth < 100",
"options": {
"polling": "raf",
"timeout": 10000
}
},
"headers": { "x-foo": "bar" },
"adblock": True,
"javascript": True,
"cookies": [
{
"name": "<string>",
"value": "<string>",
"domain": "<string>",
"url": "<string>",
"path": "<string>",
"secure": True,
"httpOnly": True,
"expires": 123
}
],
"authentication": {
"username": "<string>",
"password": "<string>"
},
"colorScheme": "<string>",
"timezone": "<string>"
},
"screenshot": {
"type": "png",
"device": "Macbook Pro 16",
"viewport": {
"width": 2240,
"height": 1260,
"deviceScaleFactor": 1,
"isMobile": False,
"hasTouch": False,
"isLandscape": False
},
"fullPage": False,
"fromSurface": True,
"omitBackground": False,
"optimizeForSpeed": True,
"quality": 50,
"captureBeyondViewport": False,
"clip": {
"width": 2240,
"height": 1260,
"x": 123,
"y": 123,
"scale": 1
},
"element": "<string>",
"overlay": {
"background": "<string>",
"filter": "none",
"margin": 0.2,
"screenshotBorderRadius": 0
}
}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
page: {
url: '<string>',
html: '<string>',
htmlTemplate: '<string>',
templateData: {},
waitUntil: 'auto',
waitForMilliseconds: 2500,
waitForSelector: {selector: '<string>', options: {visible: false, hidden: false, timeout: 10000}},
waitForFunction: {
pageFunction: 'window.innerWidth < 100',
options: {polling: 'raf', timeout: 10000}
},
headers: {'x-foo': 'bar'},
adblock: true,
javascript: true,
cookies: [
{
name: '<string>',
value: '<string>',
domain: '<string>',
url: '<string>',
path: '<string>',
secure: true,
httpOnly: true,
expires: 123
}
],
authentication: {username: '<string>', password: '<string>'},
colorScheme: '<string>',
timezone: '<string>'
},
screenshot: {
type: 'png',
device: 'Macbook Pro 16',
viewport: {
width: 2240,
height: 1260,
deviceScaleFactor: 1,
isMobile: false,
hasTouch: false,
isLandscape: false
},
fullPage: false,
fromSurface: true,
omitBackground: false,
optimizeForSpeed: true,
quality: 50,
captureBeyondViewport: false,
clip: {width: 2240, height: 1260, x: 123, y: 123, scale: 1},
element: '<string>',
overlay: {background: '<string>', filter: 'none', margin: 0.2, screenshotBorderRadius: 0}
}
})
};
fetch('https://api.doczilla.app/v1/screenshot', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.doczilla.app/v1/screenshot",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'page' => [
'url' => '<string>',
'html' => '<string>',
'htmlTemplate' => '<string>',
'templateData' => [
],
'waitUntil' => 'auto',
'waitForMilliseconds' => 2500,
'waitForSelector' => [
'selector' => '<string>',
'options' => [
'visible' => false,
'hidden' => false,
'timeout' => 10000
]
],
'waitForFunction' => [
'pageFunction' => 'window.innerWidth < 100',
'options' => [
'polling' => 'raf',
'timeout' => 10000
]
],
'headers' => [
'x-foo' => 'bar'
],
'adblock' => true,
'javascript' => true,
'cookies' => [
[
'name' => '<string>',
'value' => '<string>',
'domain' => '<string>',
'url' => '<string>',
'path' => '<string>',
'secure' => true,
'httpOnly' => true,
'expires' => 123
]
],
'authentication' => [
'username' => '<string>',
'password' => '<string>'
],
'colorScheme' => '<string>',
'timezone' => '<string>'
],
'screenshot' => [
'type' => 'png',
'device' => 'Macbook Pro 16',
'viewport' => [
'width' => 2240,
'height' => 1260,
'deviceScaleFactor' => 1,
'isMobile' => false,
'hasTouch' => false,
'isLandscape' => false
],
'fullPage' => false,
'fromSurface' => true,
'omitBackground' => false,
'optimizeForSpeed' => true,
'quality' => 50,
'captureBeyondViewport' => false,
'clip' => [
'width' => 2240,
'height' => 1260,
'x' => 123,
'y' => 123,
'scale' => 1
],
'element' => '<string>',
'overlay' => [
'background' => '<string>',
'filter' => 'none',
'margin' => 0.2,
'screenshotBorderRadius' => 0
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.doczilla.app/v1/screenshot"
payload := strings.NewReader("{\n \"page\": {\n \"url\": \"<string>\",\n \"html\": \"<string>\",\n \"htmlTemplate\": \"<string>\",\n \"templateData\": {},\n \"waitUntil\": \"auto\",\n \"waitForMilliseconds\": 2500,\n \"waitForSelector\": {\n \"selector\": \"<string>\",\n \"options\": {\n \"visible\": false,\n \"hidden\": false,\n \"timeout\": 10000\n }\n },\n \"waitForFunction\": {\n \"pageFunction\": \"window.innerWidth < 100\",\n \"options\": {\n \"polling\": \"raf\",\n \"timeout\": 10000\n }\n },\n \"headers\": {\n \"x-foo\": \"bar\"\n },\n \"adblock\": true,\n \"javascript\": true,\n \"cookies\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"domain\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": \"<string>\",\n \"secure\": true,\n \"httpOnly\": true,\n \"expires\": 123\n }\n ],\n \"authentication\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"colorScheme\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"screenshot\": {\n \"type\": \"png\",\n \"device\": \"Macbook Pro 16\",\n \"viewport\": {\n \"width\": 2240,\n \"height\": 1260,\n \"deviceScaleFactor\": 1,\n \"isMobile\": false,\n \"hasTouch\": false,\n \"isLandscape\": false\n },\n \"fullPage\": false,\n \"fromSurface\": true,\n \"omitBackground\": false,\n \"optimizeForSpeed\": true,\n \"quality\": 50,\n \"captureBeyondViewport\": false,\n \"clip\": {\n \"width\": 2240,\n \"height\": 1260,\n \"x\": 123,\n \"y\": 123,\n \"scale\": 1\n },\n \"element\": \"<string>\",\n \"overlay\": {\n \"background\": \"<string>\",\n \"filter\": \"none\",\n \"margin\": 0.2,\n \"screenshotBorderRadius\": 0\n }\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.doczilla.app/v1/screenshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"page\": {\n \"url\": \"<string>\",\n \"html\": \"<string>\",\n \"htmlTemplate\": \"<string>\",\n \"templateData\": {},\n \"waitUntil\": \"auto\",\n \"waitForMilliseconds\": 2500,\n \"waitForSelector\": {\n \"selector\": \"<string>\",\n \"options\": {\n \"visible\": false,\n \"hidden\": false,\n \"timeout\": 10000\n }\n },\n \"waitForFunction\": {\n \"pageFunction\": \"window.innerWidth < 100\",\n \"options\": {\n \"polling\": \"raf\",\n \"timeout\": 10000\n }\n },\n \"headers\": {\n \"x-foo\": \"bar\"\n },\n \"adblock\": true,\n \"javascript\": true,\n \"cookies\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"domain\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": \"<string>\",\n \"secure\": true,\n \"httpOnly\": true,\n \"expires\": 123\n }\n ],\n \"authentication\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"colorScheme\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"screenshot\": {\n \"type\": \"png\",\n \"device\": \"Macbook Pro 16\",\n \"viewport\": {\n \"width\": 2240,\n \"height\": 1260,\n \"deviceScaleFactor\": 1,\n \"isMobile\": false,\n \"hasTouch\": false,\n \"isLandscape\": false\n },\n \"fullPage\": false,\n \"fromSurface\": true,\n \"omitBackground\": false,\n \"optimizeForSpeed\": true,\n \"quality\": 50,\n \"captureBeyondViewport\": false,\n \"clip\": {\n \"width\": 2240,\n \"height\": 1260,\n \"x\": 123,\n \"y\": 123,\n \"scale\": 1\n },\n \"element\": \"<string>\",\n \"overlay\": {\n \"background\": \"<string>\",\n \"filter\": \"none\",\n \"margin\": 0.2,\n \"screenshotBorderRadius\": 0\n }\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.doczilla.app/v1/screenshot")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"page\": {\n \"url\": \"<string>\",\n \"html\": \"<string>\",\n \"htmlTemplate\": \"<string>\",\n \"templateData\": {},\n \"waitUntil\": \"auto\",\n \"waitForMilliseconds\": 2500,\n \"waitForSelector\": {\n \"selector\": \"<string>\",\n \"options\": {\n \"visible\": false,\n \"hidden\": false,\n \"timeout\": 10000\n }\n },\n \"waitForFunction\": {\n \"pageFunction\": \"window.innerWidth < 100\",\n \"options\": {\n \"polling\": \"raf\",\n \"timeout\": 10000\n }\n },\n \"headers\": {\n \"x-foo\": \"bar\"\n },\n \"adblock\": true,\n \"javascript\": true,\n \"cookies\": [\n {\n \"name\": \"<string>\",\n \"value\": \"<string>\",\n \"domain\": \"<string>\",\n \"url\": \"<string>\",\n \"path\": \"<string>\",\n \"secure\": true,\n \"httpOnly\": true,\n \"expires\": 123\n }\n ],\n \"authentication\": {\n \"username\": \"<string>\",\n \"password\": \"<string>\"\n },\n \"colorScheme\": \"<string>\",\n \"timezone\": \"<string>\"\n },\n \"screenshot\": {\n \"type\": \"png\",\n \"device\": \"Macbook Pro 16\",\n \"viewport\": {\n \"width\": 2240,\n \"height\": 1260,\n \"deviceScaleFactor\": 1,\n \"isMobile\": false,\n \"hasTouch\": false,\n \"isLandscape\": false\n },\n \"fullPage\": false,\n \"fromSurface\": true,\n \"omitBackground\": false,\n \"optimizeForSpeed\": true,\n \"quality\": 50,\n \"captureBeyondViewport\": false,\n \"clip\": {\n \"width\": 2240,\n \"height\": 1260,\n \"x\": 123,\n \"y\": 123,\n \"scale\": 1\n },\n \"element\": \"<string>\",\n \"overlay\": {\n \"background\": \"<string>\",\n \"filter\": \"none\",\n \"margin\": 0.2,\n \"screenshotBorderRadius\": 0\n }\n }\n}"
response = http.request(request)
puts response.read_body"<string>"{
"message": "Validations failed!",
"code": "api.validation",
"fields": {
"page.url": "must be a URL address"
}
}{
"message": "Unauthorized"
}{
"message": "Reached subscription limit!"
}{
"message": "Token has no active subscription!"
}{
"message": "Request body is too large"
}{
"message": "Too Many Requests!"
}{
"message": "Internal server error"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Response
Raw image
Was this page helpful?
⌘I