Screenshots and PDFs
Stealth mode and bot checks
Many sites put Cloudflare, DataDome, PerimeterX, Akamai or similar in front of their pages. A plain headless browser often gets a “Just a moment…” check or a CAPTCHA instead of the page. shotsmith handles this in three steps.
1. Bot checks are never billed
Every capture is checked for bot-protection pages. When one is showing, the request fails with blocked_by_bot_protection and the vendor in error_details, instead of returning a screenshot of the check. Failed renders don’t count toward your quota. Set fail_if_challenged=false if you want the check page captured anyway, for example to audit your own protection.
2. Stealth mode (every plan)
Stealth is automatic: when you don’t set stealth, a render that hits a bot check is retried once with stealth, within the same request and time limit. Normal pages stay fast, and protected pages still come back. The response metadata shows stealth.automatic: true when the retry was used. Send stealth=true to use it from the start, which saves the first attempt on sites you know are protected, or stealth=false to turn it off. Stealth:
- Presents as desktop Chrome on Windows: matching user agent, client hints, platform and languages, with no headless markers.
- Hides automation flags and fills in what real Chrome exposes, such as
window.chrome, a realistic CPU count, consistent permissions and a real-looking graphics card. - Waits up to
stealth_challenge_waitseconds (default 15) for JavaScript checks to clear themselves, then captures the real page. - Adds human-like pointer movement and pauses.
It adds about a second per render. Device presets and your own user_agent are respected. Monitors, the MCP server and the homepage demo use stealth by default.
// npm install @shotsmith/sdk
import { Shotsmith, TakeOptions } from '@shotsmith/sdk';
import { writeFile } from 'node:fs/promises';
const shotsmith = new Shotsmith({
accessKey: 'YOUR_ACCESS_KEY',
});
const options = TakeOptions.url('https://shotsmith.dev/sample')
.stealth()
.blockCookieBanners();
await writeFile('capture.jpg', await shotsmith.take(options));
<?php
// composer require shotsmith/shotsmith-php
require 'vendor/autoload.php';
use Shotsmith\Client;
use Shotsmith\Options\TakeOptions;
$shotsmith = new Client('YOUR_ACCESS_KEY');
$options = TakeOptions::url('https://shotsmith.dev/sample')
->stealth()
->blockCookieBanners();
file_put_contents('capture.jpg', $shotsmith->take($options));
// In Laravel: Shotsmith::take($options) with SHOTSMITH_ACCESS_KEY in .env
curl -G "https://shotsmith.dev/v1/take" \ --data-urlencode "access_key=YOUR_ACCESS_KEY" \ --data-urlencode "url=https://shotsmith.dev/sample" \ --data-urlencode "stealth=true" \ --data-urlencode "block_cookie_banners=true" \ -o capture.jpg
import { writeFile } from 'node:fs/promises';
const params = new URLSearchParams({
access_key: 'YOUR_ACCESS_KEY',
url: 'https://shotsmith.dev/sample',
stealth: 'true',
block_cookie_banners: 'true',
});
const res = await fetch(`https://shotsmith.dev/v1/take?${params}`);
if (!res.ok) throw new Error((await res.json()).error_message);
await writeFile('capture.jpg', Buffer.from(await res.arrayBuffer()));
import urllib.request
from urllib.parse import urlencode
params = {
"access_key": "YOUR_ACCESS_KEY",
"url": "https://shotsmith.dev/sample",
"stealth": "true",
"block_cookie_banners": "true"
}
url = "https://shotsmith.dev/v1/take?" + urlencode(params, doseq=True)
# Raises urllib.error.HTTPError on a 4xx/5xx response
with urllib.request.urlopen(url, timeout=120) as res, open("capture.jpg", "wb") as f:
f.write(res.read())
<?php
$query = http_build_query([
'access_key' => 'YOUR_ACCESS_KEY',
'url' => 'https://shotsmith.dev/sample',
'stealth' => 'true',
'block_cookie_banners' => 'true',
], '', '&', PHP_QUERY_RFC3986);
$ch = curl_init('https://shotsmith.dev/v1/take?' . $query);
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 120,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
if ($status !== 200) {
throw new RuntimeException(json_decode($body, true)['error_message'] ?? "HTTP {$status}");
}
file_put_contents('capture.jpg', $body);
package main
import (
"io"
"net/http"
"os"
)
func main() {
res, err := http.Get("https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&stealth=true&block_cookie_banners=true")
if err != nil {
panic(err)
}
defer res.Body.Close()
if res.StatusCode != http.StatusOK {
body, _ := io.ReadAll(res.Body)
panic(string(body))
}
out, err := os.Create("capture.jpg")
if err != nil {
panic(err)
}
defer out.Close()
io.Copy(out, res.Body)
}
require "net/http"
require "uri"
uri = URI("https://shotsmith.dev/v1/take")
uri.query = URI.encode_www_form([
["access_key", "YOUR_ACCESS_KEY"],
["url", "https://shotsmith.dev/sample"],
["stealth", "true"],
["block_cookie_banners", "true"]
])
res = Net::HTTP.get_response(uri)
raise res.body unless res.is_a?(Net::HTTPSuccess)
File.binwrite("capture.jpg", res.body)
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.nio.file.Path;
public class Capture {
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var request = HttpRequest.newBuilder(URI.create(
"https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&stealth=true&block_cookie_banners=true"
)).build();
var res = client.send(request, HttpResponse.BodyHandlers.ofFile(Path.of("capture.jpg")));
if (res.statusCode() != 200) {
throw new RuntimeException("HTTP " + res.statusCode());
}
}
}
using System;
using System.IO;
using System.Net.Http;
using var http = new HttpClient { Timeout = TimeSpan.FromSeconds(120) };
// Throws HttpRequestException on a 4xx/5xx response
var bytes = await http.GetByteArrayAsync(
"https://shotsmith.dev/v1/take?access_key=YOUR_ACCESS_KEY&url=https%3A%2F%2Fshotsmith.dev%2Fsample&stealth=true&block_cookie_banners=true"
);
await File.WriteAllBytesAsync("capture.jpg", bytes);
Content-Type: image/jpeg
X-Capture-Id: 01m8kvpk6jsmeykdfs0wy6awbn
X-Cache: MISS
X-Render-Time: 1796
X-Quota-Limit: 15000
X-Quota-Remaining: 14998
X-RateLimit-Limit: 80
X-RateLimit-Remaining: 79
(the JPEG image)
3. Your own residential proxy
Some checks look mainly at where the request comes from, and block data-centre addresses no matter how real the browser looks. Akamai on large news and retail sites is the usual example. If stealth=true still returns blocked_by_bot_protection, send a residential proxy with the proxy option alongside stealth. Proxies explains the setup and which providers to consider.
What it won’t do
It doesn’t solve CAPTCHAs, get past logins or paywalls, or defeat a site that blocks every automated visitor. Use it to capture pages you’re allowed to see, as the acceptable use policy describes.