Screenshot a URL (ephemeral browser)
curl --request POST \
--url https://api.webcompute.dev/v1/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"proxy": "<string>",
"waitFor": "<string>",
"timeout": 30000,
"policy": {},
"fullPage": false,
"format": "png",
"quality": 80,
"selector": "<string>",
"hideSelectors": [
"<string>"
],
"maskSelectors": [
"<string>"
],
"maskColor": "<string>",
"style": "<string>"
}
'import requests
url = "https://api.webcompute.dev/v1/screenshot"
payload = {
"url": "<string>",
"proxy": "<string>",
"waitFor": "<string>",
"timeout": 30000,
"policy": {},
"fullPage": False,
"format": "png",
"quality": 80,
"selector": "<string>",
"hideSelectors": ["<string>"],
"maskSelectors": ["<string>"],
"maskColor": "<string>",
"style": "<string>"
}
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({
url: '<string>',
proxy: '<string>',
waitFor: '<string>',
timeout: 30000,
policy: {},
fullPage: false,
format: 'png',
quality: 80,
selector: '<string>',
hideSelectors: ['<string>'],
maskSelectors: ['<string>'],
maskColor: '<string>',
style: '<string>'
})
};
fetch('https://api.webcompute.dev/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.webcompute.dev/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([
'url' => '<string>',
'proxy' => '<string>',
'waitFor' => '<string>',
'timeout' => 30000,
'policy' => [
],
'fullPage' => false,
'format' => 'png',
'quality' => 80,
'selector' => '<string>',
'hideSelectors' => [
'<string>'
],
'maskSelectors' => [
'<string>'
],
'maskColor' => '<string>',
'style' => '<string>'
]),
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.webcompute.dev/v1/screenshot"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"proxy\": \"<string>\",\n \"waitFor\": \"<string>\",\n \"timeout\": 30000,\n \"policy\": {},\n \"fullPage\": false,\n \"format\": \"png\",\n \"quality\": 80,\n \"selector\": \"<string>\",\n \"hideSelectors\": [\n \"<string>\"\n ],\n \"maskSelectors\": [\n \"<string>\"\n ],\n \"maskColor\": \"<string>\",\n \"style\": \"<string>\"\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.webcompute.dev/v1/screenshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"proxy\": \"<string>\",\n \"waitFor\": \"<string>\",\n \"timeout\": 30000,\n \"policy\": {},\n \"fullPage\": false,\n \"format\": \"png\",\n \"quality\": 80,\n \"selector\": \"<string>\",\n \"hideSelectors\": [\n \"<string>\"\n ],\n \"maskSelectors\": [\n \"<string>\"\n ],\n \"maskColor\": \"<string>\",\n \"style\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.webcompute.dev/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 \"url\": \"<string>\",\n \"proxy\": \"<string>\",\n \"waitFor\": \"<string>\",\n \"timeout\": 30000,\n \"policy\": {},\n \"fullPage\": false,\n \"format\": \"png\",\n \"quality\": 80,\n \"selector\": \"<string>\",\n \"hideSelectors\": [\n \"<string>\"\n ],\n \"maskSelectors\": [\n \"<string>\"\n ],\n \"maskColor\": \"<string>\",\n \"style\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAPI reference
Screenshot a URL (ephemeral browser)
POST
/
v1
/
screenshot
Screenshot a URL (ephemeral browser)
curl --request POST \
--url https://api.webcompute.dev/v1/screenshot \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"proxy": "<string>",
"waitFor": "<string>",
"timeout": 30000,
"policy": {},
"fullPage": false,
"format": "png",
"quality": 80,
"selector": "<string>",
"hideSelectors": [
"<string>"
],
"maskSelectors": [
"<string>"
],
"maskColor": "<string>",
"style": "<string>"
}
'import requests
url = "https://api.webcompute.dev/v1/screenshot"
payload = {
"url": "<string>",
"proxy": "<string>",
"waitFor": "<string>",
"timeout": 30000,
"policy": {},
"fullPage": False,
"format": "png",
"quality": 80,
"selector": "<string>",
"hideSelectors": ["<string>"],
"maskSelectors": ["<string>"],
"maskColor": "<string>",
"style": "<string>"
}
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({
url: '<string>',
proxy: '<string>',
waitFor: '<string>',
timeout: 30000,
policy: {},
fullPage: false,
format: 'png',
quality: 80,
selector: '<string>',
hideSelectors: ['<string>'],
maskSelectors: ['<string>'],
maskColor: '<string>',
style: '<string>'
})
};
fetch('https://api.webcompute.dev/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.webcompute.dev/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([
'url' => '<string>',
'proxy' => '<string>',
'waitFor' => '<string>',
'timeout' => 30000,
'policy' => [
],
'fullPage' => false,
'format' => 'png',
'quality' => 80,
'selector' => '<string>',
'hideSelectors' => [
'<string>'
],
'maskSelectors' => [
'<string>'
],
'maskColor' => '<string>',
'style' => '<string>'
]),
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.webcompute.dev/v1/screenshot"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"proxy\": \"<string>\",\n \"waitFor\": \"<string>\",\n \"timeout\": 30000,\n \"policy\": {},\n \"fullPage\": false,\n \"format\": \"png\",\n \"quality\": 80,\n \"selector\": \"<string>\",\n \"hideSelectors\": [\n \"<string>\"\n ],\n \"maskSelectors\": [\n \"<string>\"\n ],\n \"maskColor\": \"<string>\",\n \"style\": \"<string>\"\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.webcompute.dev/v1/screenshot")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"proxy\": \"<string>\",\n \"waitFor\": \"<string>\",\n \"timeout\": 30000,\n \"policy\": {},\n \"fullPage\": false,\n \"format\": \"png\",\n \"quality\": 80,\n \"selector\": \"<string>\",\n \"hideSelectors\": [\n \"<string>\"\n ],\n \"maskSelectors\": [\n \"<string>\"\n ],\n \"maskColor\": \"<string>\",\n \"style\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.webcompute.dev/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 \"url\": \"<string>\",\n \"proxy\": \"<string>\",\n \"waitFor\": \"<string>\",\n \"timeout\": 30000,\n \"policy\": {},\n \"fullPage\": false,\n \"format\": \"png\",\n \"quality\": 80,\n \"selector\": \"<string>\",\n \"hideSelectors\": [\n \"<string>\"\n ],\n \"maskSelectors\": [\n \"<string>\"\n ],\n \"maskColor\": \"<string>\",\n \"style\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
application/json
Target URL to navigate to
Proxy URL (protocol://user:pass@host:port)
CSS selector to wait for before action
Action timeout in milliseconds (1-60000)
Browser navigation policy for this action
Capture the full scrollable page
Image format
Available options:
png, jpeg, webp Image quality (1-100). Only applies to jpeg/webp.
CSS selector of a specific element to capture
CSS selectors hidden with visibility:hidden only during capture
CSS selectors covered by screenshot masks during capture
Mask color for maskSelectors
Required string length:
1 - 100Advanced temporary screenshot-only CSS
Response
Screenshot result (base64 in JSON)
⌘I