The Browshot API v2 base URL is https://api.browshot.com/api/v2. Use it to capture screenshots with Chrome, Firefox, or Brave.
Find your API key in the Browshot dashboard. Set BROWSHOT_API_KEY in your shell, then use the X-API-KEY header or a key query parameter. If you send both, their values must match.
Submit a capture with screenshot/create. The endpoint example takes a 1440 × 900 screenshot from France.
Use the returned id with screenshot/info. Poll while the status is in_queue or in_process. A status of finished means the image is ready. A status of error means the capture failed.
Download the image with the screenshot_url from the response or screenshot/thumbnail. The download endpoint also accepts dimensions, crop, and image format settings.
Metadata responses use JSON. Downloads return the file content. Read the HTTP status and Content-Type before saving a response. The API error response includes an error code and message. The Simple API returns image responses for errors.
browser=chrome, firefox, brave (default chrome) — Browser engine used for the capture.
country=us, au, de, fi, fr, gb, in (default us) — Capture location, as a lowercase ISO 3166-1 alpha-2 code. United States (us), Australia (au), Germany (de), Finland (fi), France (fr), United Kingdom (gb), and India (in).
screen_width=1–5000 (default 1024) — Viewport width in CSS pixels. Omit when using device.
screen_height=1–5000 (default 768) — Viewport height in CSS pixels. Omit when using device.
mobile=0, 1 (default 0) — Use 0 for desktop or 1 for mobile emulation. Omit when using device.
device — Device key from device/list. It supplies the viewport, user agent, and mobile and touch settings. Browser and country can still be selected. At least 1 characters. At most 80 characters.
Send browser=brave to capture with Brave. Use browser/list to look up the supported browsers.
Browser and country can be combined with a named device. Omit screen_width, screen_height, and mobile when sending device. Use device/list for available device keys. A temporarily unavailable capture location returns HTTP 503. Requests stay in the selected country.
Retina. Set device_scale to 2 or 3. Image URLs and thumbnail downloads default to CSS-pixel dimensions. Use scale=1 on the download to get the original pixel dimensions.
Ad and overlay blocking. Use hide_popups=1 for popups, overlays, and cookie banners and hide_ads=1 for ad blocking. Brave uses its built-in ad blocker.
PDF. Set pdf=1 with Chrome or Brave and use optional paper size, margins, backgrounds, landscape, and single-page settings. Download the result from screenshot/pdf after the capture finishes.
Video. Set video=1 with Chrome or Brave and choose video_format=webm, mp4, or gif. Download the result from screenshot/video. An MP4 request can produce WebM when MP4 encoding is unavailable.
HTML. Set html=1 and retrieve the rendered HTML from screenshot/html.
Tags. Use tag=launch,marketing or repeat tag to organize captures. Use tag/list to get your tags, or pass tag to screenshot/list or screenshot/search to find tagged captures.
Screenshot, including mobile or a named device costs 1 credit per capture.
Rendered HTML adds 1 credit.
PDF adds 1 credit.
Multiple shots add 1 credit per additional shot.
Video or animated GIF adds 1 credit per started five seconds of requested duration.
Retina, ad blocking, and country selection are included in the capture price.
Free monthly credits cover every v2 capture option and are used before paid credits. The free allowance is shared with v1. Failed captures and unavailable optional artifacts return the corresponding credits.
Use simple to request a capture and receive the image in one call. Follow the HTTP 302 redirects through wait and simple/{id} while the capture is pending. The continuation keeps waiting for the same capture.
https://api.browshot.com/api/v2/simple?url=https%3A%2F%2Fexample.com%2F&country=in&device=iphone_15_pro&key=my_api_key
curl --fail --location --get 'https://api.browshot.com/api/v2/simple' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'url=https://example.com/' \
--data-urlencode 'country=in' \
--data-urlencode 'device=iphone_15_pro' \
--output 'capture.png'use strict;
use warnings;
use WebService::Browshot;
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
my ($status, $content) = $client->simple(url => 'https://example.com/', country => 'in', device => 'iphone_15_pro');
die "Capture failed (HTTP $status)\n" unless $status == 200;
open my $file, '>:raw', 'capture.png' or die $!;
print {$file} $content;
close $file;
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
$response = $client->simple(array(
'url' => 'https://example.com/',
'country' => 'in',
'device' => 'iphone_15_pro'
));
if ($response['code'] != 200) {
throw new RuntimeException('Capture failed: HTTP ' . $response['code']);
}
file_put_contents('capture.png', $response['image']);
from pathlib import Path
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
response = client.simple("https://example.com/", { "country": "in", "device": "iphone_15_pro" })
if response["code"] != 200:
raise RuntimeError(f"Capture failed: HTTP {response['code']}")
Path("capture.png").write_bytes(response["png"])
require "browshot"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
response = client.simple({ "url" => "https://example.com/", "country" => "in", "device" => "iphone_15_pro" })
raise "Capture failed: HTTP #{response[:code]}" unless response[:code].to_i == 200
File.binwrite("capture.png", response[:png])
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.simpleFile("capture.png", { "url": "https://example.com/", "country": "in", "device": "iphone_15_pro" }, result => {
if (result.code !== 200 || !result.file) throw new Error('Capture failed: HTTP ' + result.code);
console.log(result.file);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.simpleFile("capture.png", { "url": "https://example.com/", "country": "in", "device": "iphone_15_pro" }, result => {
if (result.code !== 200 || !result.file) throw new Error('Capture failed: HTTP ' + result.code);
console.log(result.file);
});
using System;
using System.Collections;
using System.Drawing.Imaging;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
using (var image = client.Simple("https://example.com/", new Hashtable { { "country", "in" }, { "device", "iphone_15_pro" } }))
{
if (image == null) throw new InvalidOperationException("Image download failed");
image.Save("capture.png", ImageFormat.Png);
}
}
}
When handling redirects yourself, follow the Location header and preserve authentication. The pending capture response includes Retry-After. Use the Full API when you need structured capture metadata or artifact download URLs.
screenshot/multiple accepts up to ten repeated url parameters. Optionally, supply one to ten capture settings objects in profiles to capture each URL with each profile. Put browser, country, viewport, mobile, and device settings inside the profiles. Other settings apply to all captures. The response is a JSON object keyed by screenshot ID.
For larger lists, upload a text file containing one URL per line with batch/create. Check batch/info and retrieve the finished ZIP from batch/download.
Use crawl/create to discover and capture pages on one domain. The crawl starts at the domain root by default. Supply url to start at a specific page. Track the crawl in crawl/info.
Like ScreenshotCenter apps, Browshot v2 apps save a destination on your account. Select saved apps when you request a capture. Each delivery runs independently. Check delivery status and S3 filenames in screenshot/info.
Enable ACLs for your Amazon S3 bucket and give Browshot’s canonical AWS ID permission to list and write objects. Use app/create with type=aws_s3 and set config.bucket. You can also set the bucket’s region and a pathTemplate. Browshot signs uploads with its AWS credentials and gives the bucket owner full control of uploaded objects.
bb0a612e19fe7a0ddbf01bd0a37391c7987a48318c6caff1f5cd6287d33e88d5
curl --fail-with-body 'https://api.browshot.com/api/v2/app/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"type":"aws_s3","app_id":"archive-acl","name":"Screenshot archive with Browshot ACL","config":{"bucket":"your-capture-bucket","region":"us-east-1","pathTemplate":"captures/{domain}/{id}-{shot}.png"}}'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_create(type => 'aws_s3', app_id => 'archive-acl', name => 'Screenshot archive with Browshot ACL', config => {
bucket => 'your-capture-bucket',
region => 'us-east-1',
pathTemplate => 'captures/{domain}/{id}-{shot}.png'
})), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_create(array(
'type' => 'aws_s3',
'app_id' => 'archive-acl',
'name' => 'Screenshot archive with Browshot ACL',
'config' => array(
'bucket' => 'your-capture-bucket',
'region' => 'us-east-1',
'pathTemplate' => 'captures/{domain}/{id}-{shot}.png'
)
)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_create({
"type": "aws_s3",
"app_id": "archive-acl",
"name": "Screenshot archive with Browshot ACL",
"config": {
"bucket": "your-capture-bucket",
"region": "us-east-1",
"pathTemplate": "captures/{domain}/{id}-{shot}.png"
}
}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_create({
"type" => "aws_s3",
"app_id" => "archive-acl",
"name" => "Screenshot archive with Browshot ACL",
"config" => {
"bucket" => "your-capture-bucket",
"region" => "us-east-1",
"pathTemplate" => "captures/{domain}/{id}-{shot}.png"
}
}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appCreate({
"type": "aws_s3",
"app_id": "archive-acl",
"name": "Screenshot archive with Browshot ACL",
"config": {
"bucket": "your-capture-bucket",
"region": "us-east-1",
"pathTemplate": "captures/{domain}/{id}-{shot}.png"
}
}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appCreate({
"type": "aws_s3",
"app_id": "archive-acl",
"name": "Screenshot archive with Browshot ACL",
"config": {
"bucket": "your-capture-bucket",
"region": "us-east-1",
"pathTemplate": "captures/{domain}/{id}-{shot}.png"
}
}, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppCreate(new Hashtable {
{ "type", "aws_s3" },
{ "app_id", "archive-acl" },
{ "name", "Screenshot archive with Browshot ACL" },
{ "config", new Hashtable {
{ "bucket", "your-capture-bucket" },
{ "region", "us-east-1" },
{ "pathTemplate", "captures/{domain}/{id}-{shot}.png" }
} }
});
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Use app/create with type=s3. Set the bucket, access key ID, and secret access key in config. Set region to the bucket’s region. It defaults to us-east-1. The access key must have s3:PutObject permission for the destination. You can also supply a public HTTPS endpoint for an S3-compatible provider. Browshot uses Amazon S3 when you omit the endpoint.
curl --fail-with-body 'https://api.browshot.com/api/v2/app/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"type":"s3","app_id":"archive","name":"Screenshot archive","config":{"bucket":"your-capture-bucket","region":"us-east-1","accessKeyId":"YOUR_ACCESS_KEY_ID","secretAccessKey":"YOUR_SECRET_ACCESS_KEY","pathTemplate":"captures/{domain}/{id}-{shot}.png"}}'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_create(type => 's3', app_id => 'archive', name => 'Screenshot archive', config => {
bucket => 'your-capture-bucket',
region => 'us-east-1',
accessKeyId => 'YOUR_ACCESS_KEY_ID',
secretAccessKey => 'YOUR_SECRET_ACCESS_KEY',
pathTemplate => 'captures/{domain}/{id}-{shot}.png'
})), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_create(array(
'type' => 's3',
'app_id' => 'archive',
'name' => 'Screenshot archive',
'config' => array(
'bucket' => 'your-capture-bucket',
'region' => 'us-east-1',
'accessKeyId' => 'YOUR_ACCESS_KEY_ID',
'secretAccessKey' => 'YOUR_SECRET_ACCESS_KEY',
'pathTemplate' => 'captures/{domain}/{id}-{shot}.png'
)
)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_create({
"type": "s3",
"app_id": "archive",
"name": "Screenshot archive",
"config": {
"bucket": "your-capture-bucket",
"region": "us-east-1",
"accessKeyId": "YOUR_ACCESS_KEY_ID",
"secretAccessKey": "YOUR_SECRET_ACCESS_KEY",
"pathTemplate": "captures/{domain}/{id}-{shot}.png"
}
}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_create({
"type" => "s3",
"app_id" => "archive",
"name" => "Screenshot archive",
"config" => {
"bucket" => "your-capture-bucket",
"region" => "us-east-1",
"accessKeyId" => "YOUR_ACCESS_KEY_ID",
"secretAccessKey" => "YOUR_SECRET_ACCESS_KEY",
"pathTemplate" => "captures/{domain}/{id}-{shot}.png"
}
}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appCreate({
"type": "s3",
"app_id": "archive",
"name": "Screenshot archive",
"config": {
"bucket": "your-capture-bucket",
"region": "us-east-1",
"accessKeyId": "YOUR_ACCESS_KEY_ID",
"secretAccessKey": "YOUR_SECRET_ACCESS_KEY",
"pathTemplate": "captures/{domain}/{id}-{shot}.png"
}
}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appCreate({
"type": "s3",
"app_id": "archive",
"name": "Screenshot archive",
"config": {
"bucket": "your-capture-bucket",
"region": "us-east-1",
"accessKeyId": "YOUR_ACCESS_KEY_ID",
"secretAccessKey": "YOUR_SECRET_ACCESS_KEY",
"pathTemplate": "captures/{domain}/{id}-{shot}.png"
}
}, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppCreate(new Hashtable {
{ "type", "s3" },
{ "app_id", "archive" },
{ "name", "Screenshot archive" },
{ "config", new Hashtable {
{ "bucket", "your-capture-bucket" },
{ "region", "us-east-1" },
{ "accessKeyId", "YOUR_ACCESS_KEY_ID" },
{ "secretAccessKey", "YOUR_SECRET_ACCESS_KEY" },
{ "pathTemplate", "captures/{domain}/{id}-{shot}.png" }
} }
});
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Browshot uploads a PNG for each shot after a successful capture. Set pathTemplate to organize the object keys. The default is {id}-{shot}.png. Use {id} and {shot} to give captures and shots distinct names. A batch delivers individual screenshots through the app. Retrieve the batch ZIP separately through batch/download.
Use app/create with type=webhook and a public HTTPS destination in config.url. When a capture finishes or fails, Browshot sends a JSON POST with the same fields as screenshot/info, including screenshot_url and any available pdf_url and video_url.
Use the download URLs as delivered. Each URL authorizes a single artifact for 24 hours. To download it after the URL expires, use the capture ID with screenshot/info.
Respond with a 2xx status to acknowledge delivery. Browshot can retry failed deliveries. Deduplicate using the screenshot ID and terminal status.
curl --fail-with-body 'https://api.browshot.com/api/v2/app/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"type":"webhook","app_id":"notify","name":"Capture notifications","config":{"url":"https://example.com/capture-events"}}'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_create(type => 'webhook', app_id => 'notify', name => 'Capture notifications', config => { url => 'https://example.com/capture-events' })), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_create(array(
'type' => 'webhook',
'app_id' => 'notify',
'name' => 'Capture notifications',
'config' => array('url' => 'https://example.com/capture-events')
)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_create({
"type": "webhook",
"app_id": "notify",
"name": "Capture notifications",
"config": { "url": "https://example.com/capture-events" }
}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_create({
"type" => "webhook",
"app_id" => "notify",
"name" => "Capture notifications",
"config" => { "url" => "https://example.com/capture-events" }
}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appCreate({
"type": "webhook",
"app_id": "notify",
"name": "Capture notifications",
"config": { "url": "https://example.com/capture-events" }
}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appCreate({
"type": "webhook",
"app_id": "notify",
"name": "Capture notifications",
"config": { "url": "https://example.com/capture-events" }
}, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppCreate(new Hashtable {
{ "type", "webhook" },
{ "app_id", "notify" },
{ "name", "Capture notifications" },
{ "config", new Hashtable { { "url", "https://example.com/capture-events" } } }
});
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Use the numeric id returned by app/create with app/test. The test writes browshot-test.txt to an S3 bucket or sends {"ping":"browshot"} to a webhook. Check lastVerifiedAt or lastError through app/info.
Use the slug in app_id to select an app. For example, send apps=archive&apps=notify with screenshot/create. You can also select apps for screenshot/multiple, batch/create, crawl/create, and simple.
https://api.browshot.com/api/v2/screenshot/create?url=https%3A%2F%2Fexample.com%2F&apps=archive&apps=notify&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'url=https://example.com/' \
--data-urlencode 'apps=archive' \
--data-urlencode 'apps=notify'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_create(url => 'https://example.com/', apps => ['archive', 'notify'])), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_create(array('url' => 'https://example.com/', 'apps' => array('archive', 'notify'))), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_create("https://example.com/", { "apps": ["archive", "notify"] }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_create("https://example.com/", { "apps" => ["archive", "notify"] }))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotCreate({ "url": "https://example.com/", "apps": ["archive", "notify"] }, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.screenshotCreate({ "url": "https://example.com/", "apps": ["archive", "notify"] })
.on('finished', screenshot => console.log(screenshot))
.on('failed', screenshot => { console.error(screenshot); process.exitCode = 1; })
.on('timeout', screenshot => { console.error(screenshot); process.exitCode = 1; });
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotCreate("https://example.com/", new Hashtable { { "apps", new[] { "archive", "notify" } } });
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
To override the S3 object key for one capture, send the URL-encoded form of apps[archive]=captures/{id}-{shot}.png. Choose one selection form per request. Use repeated apps values to select apps by slug or numeric ID, or use bracket notation for S3 filename overrides.
Use app/list to find your configured apps and app/run to run selected apps on an existing finished capture.
Keep your existing API key and owned screenshot IDs. Fetch new and historical IDs through screenshot/info.
Replace instance_id with browser, country, and viewport or device parameters. Dedicated instances remain available through v1.
Remove details and priority from v2 requests. Screenshot metadata has one response format, with the available values for the capture.
Save S3 and webhook destinations as apps and select them with apps. Use profiles for multiple capture configurations.
Calls that pass an instance ID still use v1. The examples below show that calling convention. See the v1 reference for other v1 requests.
https://api.browshot.com/api/v1/screenshot/create?url=https%3A%2F%2Fexample.com%2F&instance_id=373&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v1/screenshot/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'url=https://example.com/' \
--data-urlencode 'instance_id=373'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_create(url => 'https://example.com/', instance_id => 373)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_create(array('url' => 'https://example.com/', 'instance_id' => 373)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_create("https://example.com/", { "instance_id": 373 }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_create("https://example.com/", { "instance_id" => 373 }))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotCreate({ "url": "https://example.com/", "instance_id": 373 }, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.screenshotCreate({ "url": "https://example.com/", "instance_id": 373 })
.on('finished', screenshot => console.log(screenshot))
.on('failed', screenshot => { console.error(screenshot); process.exitCode = 1; })
.on('timeout', screenshot => { console.error(screenshot); process.exitCode = 1; });
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotCreate("https://example.com/", new Hashtable { { "instance_id", 373 } });
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Use GET with query parameters. simple, simple/{id}, screenshot/create, screenshot/multiple, crawl/create, and screenshot/pdf and screenshot/video also accept POST with the same parameters. Send form fields as application/x-www-form-urlencoded.
Use POST with multipart/form-data to upload a batch file. Use POST with an application/json body to create, update, delete, test, or run apps.
The SDK samples use the Browshot 2.0 library interfaces. Set BROWSHOT_API_KEY before running a sample and replace example IDs with values from your account.
The browshot-events samples use events for capture, promises for file downloads, and client.browshot for other SDK methods.
Screenshot API
Simple API
Batch API
Crawl API
Browser and Device API
App API
Account API
Submit a capture using the selected browser, country, and viewport or device. The response is the v1-shaped screenshot object with resolved capture settings.
Required parameters
url — URL of the page to get a screenshot for
Common parameters
browser=chrome, firefox, brave (default chrome) — Browser engine used for the capture.
country=us, au, de, fi, fr, gb, in (default us) — Capture location, as a lowercase ISO 3166-1 alpha-2 code. United States (us), Australia (au), Germany (de), Finland (fi), France (fr), United Kingdom (gb), and India (in).
screen_width=1–5000 (default 1024) — Viewport width in CSS pixels. Omit when using device.
screen_height=1–5000 (default 768) — Viewport height in CSS pixels. Omit when using device.
mobile=0, 1 (default 0) — Use 0 for desktop or 1 for mobile emulation. Omit when using device.
device — Device key from device/list. It supplies the viewport, user agent, and mobile and touch settings. Browser and country can still be selected. At least 1 characters. At most 80 characters.
size=screen, page (default screen) — screenshot size - "screen" (default) or "page"
cache (default 86400) — Reuse a recent capture with the same URL, render settings, and tags within this many seconds. Use 0 for a fresh capture. App selections apply to that request, including eligible cached captures.
delay=0–60 (default 5) — number of seconds to wait after the page has loaded. This is used to let JavaScript run longer before taking the screenshot. Use delay=0 to take screenshots faster.
hide_popups=0, 1 (default 0) — Hide popups, overlays, and cookie banners.
hide_ads=0, 1 (default 0) — Block advertising requests and hide matching ad elements. Brave uses its built-in ad blocker. Adds no credits.
tag (array of string) — Tags to apply to every screenshot in the request. Repeat tag or use comma-separated values. Each tag can contain up to 50 characters. At most 50 items. Repeat the parameter for each value.
Optional parameters
referer — use a custom referrer header
post_data — send a POST requests with post_data, useful for filling out forms
cookie — set a cookie for the URL requested (see Custom POST Data, Referer and Cookie) Cookies should be separated by a ;
script — URL of javascript file to execute after the page load event
html=0–1 (default 0) — saves the HTML of the rendered page which can be retrieved by the API call screenshot/html. This feature costs *1 credit* per screenshot.
max_wait=0–60 (default 0) — maximum number of seconds to wait before triggering the PageLoad event. Note that delay will still be used. (default: 0 = disabled)
headers — any custom HTTP headers. (Not supported with Internet Explorer)
shots=1–10 (default 1) — Take multiple screenshots of the same page. Each additional shot costs one credit.
shot_interval=1–10 (default 5) — number of seconds between 2 screenshots
device_scale=1, 2, 3 — Pixel density multiplier. Use 2 or 3 for retina output at the same CSS viewport size. Defaults to 1. The retina viewport is limited to 20 million physical pixels. Video requires a scale of 1.
pdf=0, 1 (default 0) — Generate a PDF in addition to the screenshot. Requires Chrome or Brave and adds one credit. Use pdf=1 when supplying pdf_* options.
pdf_format=letter, a4, legal — PDF paper size. Ignored when pdf_one_page is enabled. Defaults to letter.
pdf_background=0, 1 — Include background colors and images in the PDF. Defaults to 0.
pdf_one_page=0, 1 — Create one long PDF page using the viewport width and document height. Defaults to 0.
pdf_landscape=0, 1 — Use landscape orientation for the PDF. Defaults to 0.
pdf_margin — Set all four PDF margins to a nonnegative length. Units can be px, mm, cm, or in. A value without units is in pixels. Defaults to 0px. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_top — Override the top PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_bottom — Override the bottom PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_left — Override the left PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_right — Override the right PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
Video
video=0, 1 (default 0) — Record a video or animated GIF in addition to the screenshot. Requires Chrome or Brave at device scale 1. Adds one credit per started five seconds. Use video=1 when supplying video_* options.
video_format=webm, mp4, gif — Recording format. If MP4 encoding is unavailable, the capture can produce WebM. Defaults to webm.
video_duration=1–30 — Maximum recording duration in seconds. Charges are calculated from the requested duration. Defaults to 15 seconds.
video_quality=0–63 — Recording quality. Lower values mean higher quality. Defaults to 30.
video_fps=1–30 — Target frames per second for WebM and MP4. GIF uses 20 fps and ignores this value. Defaults to 30 for WebM and MP4.
video_scale=0.1–1 — Multiplier for recorded width and height. Defaults to 1 for WebM and MP4 and 0.5 for GIF.
Automation steps
You can create rich interactions with the browser and take multiple screenshots. See our blog post for more information and examples.
steps — JSON array of Browshot browser automation steps, in execution order.
Trackers
You can extract information from the web page such as search rank, prices, delivery dates, page titles, and more. See our blog post for more information.
trackers — JSON array of Browshot page data trackers.
Apps
See how to configure and select S3 and webhook apps.
apps (array of string) — Account-owned app IDs (slugs or numeric configuration IDs encoded as strings). Repeat apps for multiple IDs, for example apps=archive&apps=notify. As an alternative to repeated values, apps[archive]=captures/{id}.png supplies a per-capture S3 path template. Percent-encode brackets and template characters. App settings and credentials come from the saved configuration. An unknown, disabled, or foreign app is a validation error before any capture is submitted. At least 1 items. At most 10 items. Items must be unique. Repeat the parameter for each value.
https://api.browshot.com/api/v2/screenshot/create?url=https%3A%2F%2Fexample.com%2F&browser=chrome&country=fr&screen_width=1440&screen_height=900&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'url=https://example.com/' \
--data-urlencode 'browser=chrome' \
--data-urlencode 'country=fr' \
--data-urlencode 'screen_width=1440' \
--data-urlencode 'screen_height=900'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_create(url => 'https://example.com/', browser => 'chrome', country => 'fr', screen_width => 1440, screen_height => 900)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_create(array(
'url' => 'https://example.com/',
'browser' => 'chrome',
'country' => 'fr',
'screen_width' => 1440,
'screen_height' => 900
)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_create("https://example.com/", { "browser": "chrome", "country": "fr", "screen_width": 1440, "screen_height": 900 }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_create("https://example.com/", {
"browser" => "chrome",
"country" => "fr",
"screen_width" => 1440,
"screen_height" => 900
}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotCreate({
"url": "https://example.com/",
"browser": "chrome",
"country": "fr",
"screen_width": 1440,
"screen_height": 900
}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.screenshotCreate({
"url": "https://example.com/",
"browser": "chrome",
"country": "fr",
"screen_width": 1440,
"screen_height": 900
})
.on('finished', screenshot => console.log(screenshot))
.on('failed', screenshot => { console.error(screenshot); process.exitCode = 1; })
.on('timeout', screenshot => { console.error(screenshot); process.exitCode = 1; });
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotCreate("https://example.com/", new Hashtable {
{ "browser", "chrome" },
{ "country", "fr" },
{ "screen_width", 1440 },
{ "screen_height", 900 }
});
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Request accepted
Response body object
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Error
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
priority (number) — priority given to the screenshot - high (1) to low (3)
cost (number) — number of credits taken
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Supply up to ten repeated url values. By default, all URLs use one set of capture settings. Supply profiles to capture each URL with up to ten settings objects, for at most 100 captures. The response is keyed by screenshot ID.
Required parameters
url (array of string) — URLs of the pages to capture. Repeat the query parameter for multiple URLs. At most 10 items. Repeat the parameter for each value.
Common parameters
browser=chrome, firefox, brave (default chrome) — Browser engine used for the capture.
country=us, au, de, fi, fr, gb, in (default us) — Capture location, as a lowercase ISO 3166-1 alpha-2 code. United States (us), Australia (au), Germany (de), Finland (fi), France (fr), United Kingdom (gb), and India (in).
screen_width=1–5000 (default 1024) — Viewport width in CSS pixels. Omit when using device.
screen_height=1–5000 (default 768) — Viewport height in CSS pixels. Omit when using device.
mobile=0, 1 (default 0) — Use 0 for desktop or 1 for mobile emulation. Omit when using device.
device — Device key from device/list. It supplies the viewport, user agent, and mobile and touch settings. Browser and country can still be selected. At least 1 characters. At most 80 characters.
size=screen, page (default screen) — screenshot size - "screen" (default) or "page"
cache (default 86400) — Reuse a recent capture with the same URL, render settings, and tags within this many seconds. Use 0 for a fresh capture. App selections apply to that request, including eligible cached captures.
delay=0–60 (default 5) — number of seconds to wait after the page has loaded. This is used to let JavaScript run longer before taking the screenshot. Use delay=0 to take screenshots faster.
hide_popups=0, 1 (default 0) — Hide popups, overlays, and cookie banners.
hide_ads=0, 1 (default 0) — Block advertising requests and hide matching ad elements. Brave uses its built-in ad blocker. Adds no credits.
tag (array of string) — Tags to apply to every screenshot in the request. Repeat tag or use comma-separated values. Each tag can contain up to 50 characters. At most 50 items. Repeat the parameter for each value.
Optional parameters
profiles — URL-encoded JSON array of one to ten capture settings objects. Each object uses browser, country, screen_width, screen_height, mobile, and device with the same rules and defaults as screenshot/create. Dimensions and mobile are mutually exclusive with device within each object. When profiles is supplied, omit all six top-level capture settings. Other parameters, including apps, apply to every URL and settings pair.
referer — use a custom referrer header
post_data — send a POST requests with post_data, useful for filling out forms
cookie — set a cookie for the URL requested (see Custom POST Data, Referer and Cookie) Cookies should be separated by a ;
script — URL of javascript file to execute after the page load event
html=0–1 (default 0) — saves the HTML of the rendered page which can be retrieved by the API call screenshot/html. This feature costs *1 credit* per screenshot.
max_wait=0–60 (default 0) — maximum number of seconds to wait before triggering the PageLoad event. Note that delay will still be used. (default: 0 = disabled)
headers — any custom HTTP headers. (Not supported with Internet Explorer)
device_scale=1, 2, 3 — Pixel density multiplier. Use 2 or 3 for retina output at the same CSS viewport size. Defaults to 1. The retina viewport is limited to 20 million physical pixels. Video requires a scale of 1.
pdf=0, 1 (default 0) — Generate a PDF in addition to the screenshot. Requires Chrome or Brave and adds one credit. Use pdf=1 when supplying pdf_* options.
pdf_format=letter, a4, legal — PDF paper size. Ignored when pdf_one_page is enabled. Defaults to letter.
pdf_background=0, 1 — Include background colors and images in the PDF. Defaults to 0.
pdf_one_page=0, 1 — Create one long PDF page using the viewport width and document height. Defaults to 0.
pdf_landscape=0, 1 — Use landscape orientation for the PDF. Defaults to 0.
pdf_margin — Set all four PDF margins to a nonnegative length. Units can be px, mm, cm, or in. A value without units is in pixels. Defaults to 0px. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_top — Override the top PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_bottom — Override the bottom PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_left — Override the left PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_right — Override the right PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
Video
video=0, 1 (default 0) — Record a video or animated GIF in addition to the screenshot. Requires Chrome or Brave at device scale 1. Adds one credit per started five seconds. Use video=1 when supplying video_* options.
video_format=webm, mp4, gif — Recording format. If MP4 encoding is unavailable, the capture can produce WebM. Defaults to webm.
video_duration=1–30 — Maximum recording duration in seconds. Charges are calculated from the requested duration. Defaults to 15 seconds.
video_quality=0–63 — Recording quality. Lower values mean higher quality. Defaults to 30.
video_fps=1–30 — Target frames per second for WebM and MP4. GIF uses 20 fps and ignores this value. Defaults to 30 for WebM and MP4.
video_scale=0.1–1 — Multiplier for recorded width and height. Defaults to 1 for WebM and MP4 and 0.5 for GIF.
Automation steps
You can create rich interactions with the browser and take multiple screenshots. See our blog post for more information and examples.
steps — JSON array of Browshot browser automation steps, in execution order.
Trackers
You can extract information from the web page such as search rank, prices, delivery dates, page titles, and more. See our blog post for more information.
trackers — JSON array of Browshot page data trackers.
Apps
See how to configure and select S3 and webhook apps.
apps (array of string) — Account-owned app IDs (slugs or numeric configuration IDs encoded as strings). Repeat apps for multiple IDs, for example apps=archive&apps=notify. As an alternative to repeated values, apps[archive]=captures/{id}.png supplies a per-capture S3 path template. Percent-encode brackets and template characters. App settings and credentials come from the saved configuration. An unknown, disabled, or foreign app is a validation error before any capture is submitted. At least 1 items. At most 10 items. Items must be unique. Repeat the parameter for each value.
https://api.browshot.com/api/v2/screenshot/multiple?url=https%3A%2F%2Fexample.com%2F&url=https%3A%2F%2Fexample.org%2F&profiles=%5B%7B%22country%22%3A%22fr%22%2C%22screen_width%22%3A1440%2C%22screen_height%22%3A900%7D%2C%7B%22country%22%3A%22in%22%2C%22device%22%3A%22iphone_15_pro%22%7D%5D&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/multiple' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'url=https://example.com/' \
--data-urlencode 'url=https://example.org/' \
--data-urlencode 'profiles=[{"country":"fr","screen_width":1440,"screen_height":900},{"country":"in","device":"iphone_15_pro"}]'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_multiple(profiles => [
{ country => 'fr', screen_width => 1440, screen_height => 900 },
{ country => 'in', device => 'iphone_15_pro' }
], urls => ['https://example.com/', 'https://example.org/'])), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_multiple(array('https://example.com/', 'https://example.org/'), array(), array(
'profiles' => array(
array('country' => 'fr', 'screen_width' => 1440, 'screen_height' => 900),
array('country' => 'in', 'device' => 'iphone_15_pro')
)
)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_multiple({
"profiles": [
{ "country": "fr", "screen_width": 1440, "screen_height": 900 },
{ "country": "in", "device": "iphone_15_pro" }
],
"urls": ["https://example.com/", "https://example.org/"]
}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_multiple({
"profiles" => [
{ "country" => "fr", "screen_width" => 1440, "screen_height" => 900 },
{ "country" => "in", "device" => "iphone_15_pro" }
],
"urls" => ["https://example.com/", "https://example.org/"]
}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotMultiple({
"profiles": [
{ "country": "fr", "screen_width": 1440, "screen_height": 900 },
{ "country": "in", "device": "iphone_15_pro" }
],
"urls": ["https://example.com/", "https://example.org/"]
}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.screenshotMultiple({
"profiles": [
{ "country": "fr", "screen_width": 1440, "screen_height": 900 },
{ "country": "in", "device": "iphone_15_pro" }
],
"urls": ["https://example.com/", "https://example.org/"]
}, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotMultiple(new Hashtable {
{ "profiles", new[] {
new Hashtable {
{ "country", "fr" },
{ "screen_width", 1440 },
{ "screen_height", 900 }
},
new Hashtable { { "country", "in" }, { "device", "iphone_15_pro" } }
} },
{ "urls", new[] { "https://example.com/", "https://example.org/" } }
});
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Request accepted
Response body object of Screenshot values — An object keyed by screenshot ID. Each value is the screenshot for that ID.
Each value (object)
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Example response
{
"1103982291": {
"id": 1103982291,
"status": "in_process",
"url": "https://example.com/",
"browser": "chrome",
"country": "us"
},
"1103982292": {
"id": 1103982292,
"status": "in_process",
"url": "https://example.org/",
"browser": "chrome",
"country": "us"
}
} Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Error
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
priority (number) — priority given to the screenshot - high (1) to low (3)
cost (number) — number of credits taken
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Once a screenshot has been requested, its status must be checked until it is either "error" or "finished".
Required parameters
id — Screenshot ID returned when requesting a capture.
https://api.browshot.com/api/v2/screenshot/info?id=1103982291&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/info' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=1103982291'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_info(id => 1103982291)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_info(1103982291, array()), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_info(1103982291, {}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_info(1103982291, {}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotInfo(1103982291, {}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.screenshotInfo(1103982291, {}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotInfo(1103982291, null);
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Screenshot found
Response body object
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Example response (application/json)
{
"id": 1103982291,
"status": "finished",
"url": "https://example.com/",
"final_url": "https://example.com/",
"screenshot_url": "https://api.browshot.com/api/v2/screenshot/thumbnail?id=1103982291&key=YOUR_API_KEY&scale=1",
"browser": "chrome",
"country": "us",
"width": 1280,
"height": 1024,
"cost": 1
} Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Screenshot not found
Response body object
id (integer) — screenshot ID
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
Get information about the last 100 screenshots requested.
Optional parameters
limit=1–100 (default 100) — maximum number of screenshots' information to return
status=error, finished, in_process — get list of screenshot in a given status (error, finished, in_process)
tag (array of string) — Match screenshots with any of the specified tags. Tags are case-sensitive. Repeat tag or use comma-separated values. At most 50 items. Repeat the parameter for each value.
https://api.browshot.com/api/v2/screenshot/list?limit=10&status=finished&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/list' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'limit=10' \
--data-urlencode 'status=finished'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_list(limit => 10, status => 'finished')), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_list(array('limit' => 10, 'status' => 'finished')), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_list({ "limit": 10, "status": "finished" }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_list({ "limit" => 10, "status" => "finished" }))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotList({ "limit": 10, "status": "finished" }, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.screenshotList({ "limit": 10, "status": "finished" }, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotList(10, new Hashtable { { "status", "finished" } });
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
list of screenshot information
Response body object of Screenshot values — An object keyed by screenshot ID. Each value is the screenshot for that ID.
Each value (object)
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Example response
{
"1103982291": {
"id": 1103982291,
"status": "in_process",
"url": "https://example.com/",
"browser": "chrome",
"country": "us"
},
"1103982292": {
"id": 1103982292,
"status": "in_process",
"url": "https://example.org/",
"browser": "chrome",
"country": "us"
}
} Screenshot not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
priority (number) — priority given to the screenshot - high (1) to low (3)
cost (number) — number of credits taken
Search for screenshots of a specific URL.
Required parameters
url — look for a string matching the URL requested
Optional parameters
limit=1–100 (default 50) — maximum number of screenshots' information to return
status=error, finished, in_process — get list of screenshot in a given status (error, finished, in_process)
tag (array of string) — Match screenshots with any of the specified tags. Tags are case-sensitive. Repeat tag or use comma-separated values. At most 50 items. Repeat the parameter for each value.
https://api.browshot.com/api/v2/screenshot/search?url=https%3A%2F%2Fexample.com%2F&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/search' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'url=https://example.com/'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_search(url => 'https://example.com/')), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_search('https://example.com/', array()), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_search("https://example.com/", {}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_search("https://example.com/", {}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotSearch("https://example.com/", {}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.screenshotSearch("https://example.com/", {}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotSearch("https://example.com/", null);
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
list of screenshot information
Response body object of Screenshot values — An object keyed by screenshot ID. Each value is the screenshot for that ID.
Each value (object)
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Example response
{
"1103982291": {
"id": 1103982291,
"status": "in_process",
"url": "https://example.com/",
"browser": "chrome",
"country": "us"
},
"1103982292": {
"id": 1103982292,
"status": "in_process",
"url": "https://example.org/",
"browser": "chrome",
"country": "us"
}
} Screenshot not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
priority (number) — priority given to the screenshot - high (1) to low (3)
cost (number) — number of credits taken
Download a finished screenshot as PNG or JPEG. Use width, height, and the crop coordinates to generate a thumbnail. Browshot crops the image before resizing it.
Optional parameters
artifact_token — Download token supplied in a webhook artifact URL. Use the URL as delivered. The token authorizes only that file and expires after 24 hours. At most 1024 characters. Pattern ^[A-Za-z0-9_-]+$.
id — Screenshot ID. Required for requests authenticated by API key.
width=1–2000 — width of the thumbnail
height=1–15000 — height of the thumbnail
scale — Output scale. Without explicit dimensions, defaults to 1 divided by the capture device scale.
zoom=1–100 (default 100) — zoom 1 to 100 percent
ratio=fit, fill (default fit) — Use fit to keep the original page ration, and fill to get a thumbnail for the exact width and height. specified. If you provide both width and height, you need to specify the ratio: fit to keep the original width/height ratio (the thumbnail might be smaller than the specified width and height), or fill to crop the image if necessary.
left (default 0) — left edge of the area to be cropped Minimum 0.
right (default 0) — right edge of the area to be cropped Minimum 0.
top (default 0) — top edge of the area to be cropped Minimum 0.
bottom — bottom edge of the area to be cropped
format=png, jpeg (default png) — image as PNG or JPEG
shot=1–10 (default 1) — get the second or third screenshot if multiple screenshots were requested
quality=1–100 (default 100) — JPEG quality factor (for JPEG thumbnails only)
https://api.browshot.com/api/v2/screenshot/thumbnail?id=1103982291&width=640&key=my_api_key
curl --fail --get 'https://api.browshot.com/api/v2/screenshot/thumbnail' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=1103982291' \
--data-urlencode 'width=640' \
--output 'thumbnail.png'use strict;
use warnings;
use WebService::Browshot;
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
my $file = $client->screenshot_thumbnail_file(id => 1103982291, width => 640, file => 'thumbnail.png');
die "Download failed\n" unless $file;
print "$file\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
$file = $client->screenshot_thumbnail_file(1103982291, 'thumbnail.png', array('width' => 640));
if (!is_string($file) || $file === '') {
throw new RuntimeException('Download failed');
}
echo $file, PHP_EOL;
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
file = client.screenshot_thumbnail_file(1103982291, "thumbnail.png", { "width": 640 })
if not file:
raise RuntimeError("Download failed")
print(file)
require "browshot"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
file = client.screenshot_thumbnail_file(1103982291, "thumbnail.png", { "width" => 640 })
raise "Download failed" if file.to_s.empty?
puts file
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotThumbnailFile(1103982291, "thumbnail.png", { "width": 640 }, result => {
if (!result) throw new Error('Download failed');
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.saveThumbnail(1103982291, "thumbnail.png", { "width": 640 })
.then(file => console.log(file))
.catch(() => { console.error('Download failed'); process.exitCode = 1; });
using System;
using System.Collections;
using System.Drawing.Imaging;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
using (var image = client.Thumbnail(1103982291, new Hashtable { { "width", 640 } }))
{
if (image == null) throw new InvalidOperationException("Image download failed");
image.Save("thumbnail.png", ImageFormat.Png);
}
}
}
Content types image/png, image/jpeg, application/json
PNG or JPEG screenshot image.
Response body file
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key, or an invalid or expired webhook artifact token.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Screenshot was not found, is not finished, or has failed. The response may be a placeholder image or a JSON error.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Share a finished screenshot publicly, with an optional note.
Required parameters
id — screenshot ID
Optional parameters
note — note to add on the sharing page
Content types application/json
Public share URL
Response body object
id (integer, int64, required) — ID of the shared screenshot.Minimum 1.
status (string, required) — ok when the share succeeds.Values ok.
url (string, required) — Public URL of the shared screenshot.
Screenshot not found
Response body object
id (integer) — screenshot ID
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
You can delete details of your screenshots to remove any confidential information.
Required parameters
id — screenshot ID
Optional parameters
data (default image) — data to remove. You can specify multiple of them (separated by a ,): *image* (image files), *url* (url requested), *metadata* (time added, time finished, post data, cookie and referer used for the screenshot), *all* (all data and files)
https://api.browshot.com/api/v2/screenshot/delete?id=1103982291&data=image&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/delete' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=1103982291' \
--data-urlencode 'data=image'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->screenshot_delete(id => 1103982291, data => 'image')), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->screenshot_delete(1103982291, array('data' => 'image')), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.screenshot_delete(1103982291, { "data": "image" }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.screenshot_delete(1103982291, { "data" => "image" }))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotDelete(1103982291, { "data": "image" }, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.screenshotDelete(1103982291, { "data": "image" }, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.ScreenshotDelete(1103982291, new Hashtable { { "data", "image" } });
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Requested data deleted
Response body object
id (integer, int64, required) — ID of the screenshot whose data was deleted.Minimum 1.
status (string, required) — ok when deletion succeeds.Values ok.
Screenshot not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
priority (number) — priority given to the screenshot - high (1) to low (3)
cost (number) — number of credits taken
Retrieve the HTML code of the rendered page. This API call should be used when html=1 was specified in the screenshot request.
Required parameters
id — screenshot ID
https://api.browshot.com/api/v2/screenshot/html?id=1103982291&key=my_api_key
curl --fail --get 'https://api.browshot.com/api/v2/screenshot/html' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=1103982291' \
--output 'capture.html'use strict;
use warnings;
use WebService::Browshot;
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
my $content = $client->screenshot_html(id => 1103982291);
die "HTML download failed\n" unless length $content;
open my $file, '>:raw', 'capture.html' or die $!;
print {$file} $content;
close $file;
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
$html = $client->screenshot_html(1103982291, array());
if (!is_string($html) || $html === '') {
throw new RuntimeException('HTML download failed');
}
file_put_contents('capture.html', $html);
from pathlib import Path
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
html = client.screenshot_html(1103982291, {})
if not html:
raise RuntimeError("HTML download failed")
Path("capture.html").write_bytes(html)
require "browshot"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
html = client.screenshot_html(1103982291, {})
raise "HTML download failed" if html.to_s.empty?
File.binwrite("capture.html", html)
const Browshot = require('browshot');
const fs = require('fs');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotHtml(1103982291, {}, result => {
if (!result) throw new Error('HTML download failed');
fs.writeFileSync("capture.html", result);
});
const BrowshotEvents = require('browshot-events');
const fs = require('fs');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.screenshotHtml(1103982291, {}, result => {
if (!result) throw new Error('HTML download failed');
fs.writeFileSync("capture.html", result);
});
using System;
using System.IO;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var html = client.ScreenshotHtml(1103982291, null);
if (html == null) throw new InvalidOperationException("HTML download failed");
File.WriteAllText("capture.html", html);
}
}
Content types text/html, application/json
HTML code of the rendered page.
Response headers
Content-Disposition (string) — inline; filename="screenshot.html"
Response body string
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Download the PDF from a finished screenshot owned by your account. Enable pdf=1 when creating the capture and wait for screenshot/info to return status=finished. Error responses are JSON.
Optional parameters
id — Screenshot ID returned by screenshot/create or screenshot/info. Required for requests authenticated by API key. Minimum 1.
artifact_token — Download token supplied in a webhook artifact URL. Use the URL as delivered. The token authorizes only that file and expires after 24 hours. At most 1024 characters. Pattern ^[A-Za-z0-9_-]+$.
https://api.browshot.com/api/v2/screenshot/pdf?id=1103982291&key=my_api_key
curl --fail --get 'https://api.browshot.com/api/v2/screenshot/pdf' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=1103982291' \
--output 'capture.pdf'use strict;
use warnings;
use WebService::Browshot;
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
my $file = $client->screenshot_pdf_file(id => 1103982291, file => 'capture.pdf');
die "Download failed\n" unless $file;
print "$file\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
$file = $client->screenshot_pdf_file(1103982291, 'capture.pdf', array());
if (!is_string($file) || $file === '') {
throw new RuntimeException('Download failed');
}
echo $file, PHP_EOL;
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
file = client.screenshot_pdf_file(1103982291, "capture.pdf", {})
if not file:
raise RuntimeError("Download failed")
print(file)
require "browshot"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
file = client.screenshot_pdf_file(1103982291, "capture.pdf", {})
raise "Download failed" if file.to_s.empty?
puts file
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotPdfFile(1103982291, "capture.pdf", {}, result => {
if (!result) throw new Error('Download failed');
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.savePdf(1103982291, "capture.pdf", {})
.then(file => console.log(file))
.catch(() => { console.error('Download failed'); process.exitCode = 1; });
using System;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var file = client.ScreenshotPdfFile(1103982291, "capture.pdf");
if (file == null) throw new InvalidOperationException("Download failed");
Console.WriteLine(file);
}
}
Content types application/pdf, application/json
PDF file (application/pdf).
Response headers
Content-Disposition (string) — attachment; filename="screenshot.pdf"
Response body file
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key, or an invalid or expired webhook artifact token.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Download the video from a finished screenshot owned by your account. Enable video=1 when creating the capture and wait for screenshot/info to return status=finished. Error responses are JSON.
Optional parameters
id — Screenshot ID returned by screenshot/create or screenshot/info. Required for requests authenticated by API key. Minimum 1.
artifact_token — Download token supplied in a webhook artifact URL. Use the URL as delivered. The token authorizes only that file and expires after 24 hours. At most 1024 characters. Pattern ^[A-Za-z0-9_-]+$.
https://api.browshot.com/api/v2/screenshot/video?id=1103982291&key=my_api_key
curl --fail --get 'https://api.browshot.com/api/v2/screenshot/video' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=1103982291' \
--output 'capture.webm'use strict;
use warnings;
use WebService::Browshot;
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
my $file = $client->screenshot_video_file(id => 1103982291, file => 'capture.webm');
die "Download failed\n" unless $file;
print "$file\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
$file = $client->screenshot_video_file(1103982291, 'capture.webm', array());
if (!is_string($file) || $file === '') {
throw new RuntimeException('Download failed');
}
echo $file, PHP_EOL;
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
file = client.screenshot_video_file(1103982291, "capture.webm", {})
if not file:
raise RuntimeError("Download failed")
print(file)
require "browshot"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
file = client.screenshot_video_file(1103982291, "capture.webm", {})
raise "Download failed" if file.to_s.empty?
puts file
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.screenshotVideoFile(1103982291, "capture.webm", {}, result => {
if (!result) throw new Error('Download failed');
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.saveVideo(1103982291, "capture.webm", {})
.then(file => console.log(file))
.catch(() => { console.error('Download failed'); process.exitCode = 1; });
using System;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var file = client.ScreenshotVideoFile(1103982291, "capture.webm");
if (file == null) throw new InvalidOperationException("Download failed");
Console.WriteLine(file);
}
}
Content types video/webm, video/mp4, image/gif, application/json
WebM (video/webm), MP4 (video/mp4), or animated GIF (image/gif).
Response headers
Content-Disposition (string) — Attachment filename is screenshot.webm, screenshot.mp4, or screenshot.gif.
Response body file
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key, or an invalid or expired webhook artifact token.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Return screenshots owned by the caller, keyed by screenshot ID.
Optional parameters
limit=1–100 (default 100) — maximum number of screenshots' information to return
status=error, finished, in_process — get list of screenshot in a given status (error, finished, in_process)
tag (array of string) — Match screenshots with any of the specified tags. Tags are case-sensitive. Repeat tag or use comma-separated values. At most 50 items. Repeat the parameter for each value.
https://api.browshot.com/api/v2/screenshot/list/slow?limit=10&status=finished&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/screenshot/list/slow' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'limit=10' \
--data-urlencode 'status=finished'Content types application/json
list of screenshot information
Response body object of Screenshot values — An object keyed by screenshot ID. Each value is the screenshot for that ID.
Each value (object)
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Example response
{
"1103982291": {
"id": 1103982291,
"status": "in_process",
"url": "https://example.com/",
"browser": "chrome",
"country": "us"
},
"1103982292": {
"id": 1103982292,
"status": "in_process",
"url": "https://example.org/",
"browser": "chrome",
"country": "us"
}
} Screenshot not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
priority (number) — priority given to the screenshot - high (1) to low (3)
cost (number) — number of credits taken
Return the distinct tags on screenshots owned by the caller.
Content types application/json
Screenshot tags in alphabetical order
Response body object
tags (array of string, required) — Distinct tags on screenshots in the account.
Each item (string)
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Accepts the same capture parameters as screenshot/create, plus thumbnail options. When capture is pending, follow the same-host continuation URL until the image is ready.
Required parameters
url — URL of the page to get a screenshot for
Common parameters
browser=chrome, firefox, brave (default chrome) — Browser engine used for the capture.
country=us, au, de, fi, fr, gb, in (default us) — Capture location, as a lowercase ISO 3166-1 alpha-2 code. United States (us), Australia (au), Germany (de), Finland (fi), France (fr), United Kingdom (gb), and India (in).
screen_width=1–5000 (default 1024) — Viewport width in CSS pixels. Omit when using device.
screen_height=1–5000 (default 768) — Viewport height in CSS pixels. Omit when using device.
mobile=0, 1 (default 0) — Use 0 for desktop or 1 for mobile emulation. Omit when using device.
device — Device key from device/list. It supplies the viewport, user agent, and mobile and touch settings. Browser and country can still be selected. At least 1 characters. At most 80 characters.
size=screen, page (default screen) — screenshot size - "screen" (default) or "page"
cache (default 86400) — Reuse a recent capture with the same URL, render settings, and tags within this many seconds. Use 0 for a fresh capture. App selections apply to that request, including eligible cached captures.
delay=0–60 (default 5) — number of seconds to wait after the page has loaded. This is used to let JavaScript run longer before taking the screenshot. Use delay=0 to take screenshots faster.
hide_popups=0, 1 (default 0) — Hide popups, overlays, and cookie banners.
hide_ads=0, 1 (default 0) — Block advertising requests and hide matching ad elements. Brave uses its built-in ad blocker. Adds no credits.
tag (array of string) — Tags to apply to every screenshot in the request. Repeat tag or use comma-separated values. Each tag can contain up to 50 characters. At most 50 items. Repeat the parameter for each value.
Optional parameters
referer — use a custom referrer header
post_data — send a POST requests with post_data, useful for filling out forms
cookie — set a cookie for the URL requested (see Custom POST Data, Referer and Cookie) Cookies should be separated by a ;
script — URL of javascript file to execute after the page load event
html=0–1 (default 0) — saves the HTML of the rendered page which can be retrieved by the API call screenshot/html. This feature costs *1 credit* per screenshot.
max_wait=0–60 (default 0) — maximum number of seconds to wait before triggering the PageLoad event. Note that delay will still be used. (default: 0 = disabled)
headers — any custom HTTP headers. (Not supported with Internet Explorer)
shots=1–10 (default 1) — Take multiple screenshots of the same page. Each additional shot costs one credit.
shot_interval=1–10 (default 5) — number of seconds between 2 screenshots
device_scale=1, 2, 3 — Pixel density multiplier. Use 2 or 3 for retina output at the same CSS viewport size. Defaults to 1. The retina viewport is limited to 20 million physical pixels. Video requires a scale of 1.
width=0–2000 — Thumbnail width in pixels. Use 0 or omit to keep the original dimension.
height=0–15000 — Thumbnail height in pixels. Use 0 or omit to keep the original dimension.
scale — Output scale. Without explicit dimensions, defaults to 1 divided by the capture device scale.
zoom=1–100 (default 100) — zoom 1 to 100 percent
ratio=fit, fill (default fit) — Use fit to keep the original page ration, and fill to get a thumbnail for the exact width and height. specified. If you provide both width and height, you need to specify the ratio: fit to keep the original width/height ratio (the thumbnail might be smaller than the specified width and height), or fill to crop the image if necessary.
left (default 0) — left edge of the area to be cropped Minimum 0.
right (default 0) — right edge of the area to be cropped Minimum 0.
top (default 0) — top edge of the area to be cropped Minimum 0.
bottom — bottom edge of the area to be cropped
format=png, jpeg (default png) — image as PNG or JPEG
shot=1–10 (default 1) — get the second or third screenshot if multiple screenshots were requested
quality=1–100 (default 100) — JPEG quality factor (for JPEG thumbnails only)
pdf=0, 1 (default 0) — Generate a PDF in addition to the screenshot. Requires Chrome or Brave and adds one credit. Use pdf=1 when supplying pdf_* options.
pdf_format=letter, a4, legal — PDF paper size. Ignored when pdf_one_page is enabled. Defaults to letter.
pdf_background=0, 1 — Include background colors and images in the PDF. Defaults to 0.
pdf_one_page=0, 1 — Create one long PDF page using the viewport width and document height. Defaults to 0.
pdf_landscape=0, 1 — Use landscape orientation for the PDF. Defaults to 0.
pdf_margin — Set all four PDF margins to a nonnegative length. Units can be px, mm, cm, or in. A value without units is in pixels. Defaults to 0px. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_top — Override the top PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_bottom — Override the bottom PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_left — Override the left PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_right — Override the right PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
Video
video=0, 1 (default 0) — Record a video or animated GIF in addition to the screenshot. Requires Chrome or Brave at device scale 1. Adds one credit per started five seconds. Use video=1 when supplying video_* options.
video_format=webm, mp4, gif — Recording format. If MP4 encoding is unavailable, the capture can produce WebM. Defaults to webm.
video_duration=1–30 — Maximum recording duration in seconds. Charges are calculated from the requested duration. Defaults to 15 seconds.
video_quality=0–63 — Recording quality. Lower values mean higher quality. Defaults to 30.
video_fps=1–30 — Target frames per second for WebM and MP4. GIF uses 20 fps and ignores this value. Defaults to 30 for WebM and MP4.
video_scale=0.1–1 — Multiplier for recorded width and height. Defaults to 1 for WebM and MP4 and 0.5 for GIF.
Automation steps
You can create rich interactions with the browser and take multiple screenshots. See our blog post for more information and examples.
steps — JSON array of Browshot browser automation steps, in execution order.
Trackers
You can extract information from the web page such as search rank, prices, delivery dates, page titles, and more. See our blog post for more information.
trackers — JSON array of Browshot page data trackers.
Apps
See how to configure and select S3 and webhook apps.
apps (array of string) — Account-owned app IDs (slugs or numeric configuration IDs encoded as strings). Repeat apps for multiple IDs, for example apps=archive&apps=notify. As an alternative to repeated values, apps[archive]=captures/{id}.png supplies a per-capture S3 path template. Percent-encode brackets and template characters. App settings and credentials come from the saved configuration. An unknown, disabled, or foreign app is a validation error before any capture is submitted. At least 1 items. At most 10 items. Items must be unique. Repeat the parameter for each value.
See the synchronous capture example.
Content types image/png, image/jpeg, image/webp
Requested screenshot or thumbnail
Response body file
Capture is pending. Follow Location and preserve header authentication if used.
Response headers
Location (string) — Same-host continuation targeting the v2 Simple API.
Retry-After (integer) — Seconds before the next check.
PNG error image
Response headers
X-Error (string)
Response body file
PNG error image
Response headers
X-Error (string)
Response body file
PNG error image
Response headers
X-Error (string)
Response body file
Returns the image or a further continuation for an existing owned capture.
Required parameters
id (path) Minimum 1.
Optional parameters
width=0–2000 — Thumbnail width in pixels. Use 0 or omit to keep the original dimension.
height=0–15000 — Thumbnail height in pixels. Use 0 or omit to keep the original dimension.
scale — Output scale. Without explicit dimensions, defaults to 1 divided by the capture device scale.
zoom=1–100 (default 100) — zoom 1 to 100 percent
ratio=fit, fill (default fit) — Use fit to keep the original page ration, and fill to get a thumbnail for the exact width and height. specified. If you provide both width and height, you need to specify the ratio: fit to keep the original width/height ratio (the thumbnail might be smaller than the specified width and height), or fill to crop the image if necessary.
left (default 0) — left edge of the area to be cropped Minimum 0.
right (default 0) — right edge of the area to be cropped Minimum 0.
top (default 0) — top edge of the area to be cropped Minimum 0.
bottom — bottom edge of the area to be cropped
format=png, jpeg (default png) — image as PNG or JPEG
shot=1–10 (default 1) — get the second or third screenshot if multiple screenshots were requested
quality=1–100 (default 100) — JPEG quality factor (for JPEG thumbnails only)
shots=1–10 — Existing continuation shot count.
t — Server-provided continuation attempt. Minimum 0.
https://api.browshot.com/api/v2/simple/1103982291?key=my_api_key
curl --fail --location 'https://api.browshot.com/api/v2/simple/1103982291' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--output 'capture.png'Content types image/png, image/jpeg, image/webp
Requested screenshot or thumbnail
Response body file
Capture is pending. Follow Location and preserve header authentication if used.
Response headers
Location (string) — Same-host continuation targeting the v2 Simple API.
Retry-After (integer) — Seconds before the next check.
PNG error image
Response headers
X-Error (string)
Response body file
PNG error image
Response headers
X-Error (string)
Response body file
PNG error image
Response headers
X-Error (string)
Response body file
Follow a Simple API wait continuation
Required parameters
r — The relative v2 Simple API target from a previous redirect.
Optional parameters
s=0–240
t=0–100000
curl --fail --location --get 'https://api.browshot.com/api/v2/wait' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 's=20' \
--data-urlencode 't=1' \
--data-urlencode 'r=/api/v2/simple/1103982291' \
--output 'capture.png'Content types image/png
Continue polling the same capture.
Response headers
Location (string)
PNG error image
Response body file
PNG error image
Response body file
Upload a text file with one URL per line as multipart/form-data. All URLs use the same capture settings and apps. The v1 batch ZIP remains available independently of app execution. Failed captures may be retried up to three times.
Required parameters
file — text file to use
Common parameters
browser=chrome, firefox, brave (default chrome) — Browser engine used for the capture.
country=us, au, de, fi, fr, gb, in (default us) — Capture location, as a lowercase ISO 3166-1 alpha-2 code. United States (us), Australia (au), Germany (de), Finland (fi), France (fr), United Kingdom (gb), and India (in).
screen_width=1–5000 (default 1024) — Viewport width in CSS pixels. Omit when using device.
screen_height=1–5000 (default 768) — Viewport height in CSS pixels. Omit when using device.
mobile=0, 1 (default 0) — Use 0 for desktop or 1 for mobile emulation. Omit when using device.
device — Device key from device/list. It supplies the viewport, user agent, and mobile and touch settings. Browser and country can still be selected. At least 1 characters. At most 80 characters.
size=screen, page (default screen) — screenshots size - "screen" (default) or "page"
delay=0–60 (default 5) — number of seconds to wait after the page has loaded. This is used to let JavaScript run longer before taking the screenshot. Use delay=0 to take screenshots faster.
hide_popups=0, 1 (default 0) — Hide popups, overlays, and cookie banners.
hide_ads=0, 1 (default 0) — Block advertising requests and hide matching ad elements. Brave uses its built-in ad blocker. Adds no credits.
tag (array of string) — Tags to apply to every screenshot in the request. Repeat tag or use comma-separated values. Each tag can contain up to 50 characters. At most 50 items. Repeat the parameter for each value.
Optional parameters
name — name of the batch
width=1–2000 (default 1024) — thumbnail width.
height=1–15000 — thumbnail height
referer — use a custom referrer header
post_data — send a POST requests with post_data, useful for filling out forms
cookie — set a cookie for the URL requested (see Custom POST Data, Referer and Cookie) Cookies should be separated by a ;
script — URL of javascript file to execute after the page load event
html=0–1 (default 0) — saves the HTML of the rendered page which can be retrieved by the API call screenshot/html. This feature costs *1 credit* per screenshot.
max_wait=0–60 (default 0) — maximum number of seconds to wait before triggering the PageLoad event. Note that delay will still be used. (default: 0 = disabled)
headers — any custom HTTP headers. (Not supported with Internet Explorer)
format=png, jpeg (default png) — image as PNG or JPEG
device_scale=1, 2, 3 — Pixel density multiplier. Use 2 or 3 for retina output at the same CSS viewport size. Defaults to 1. The retina viewport is limited to 20 million physical pixels. Video requires a scale of 1.
pdf=0, 1 (default 0) — Generate a PDF in addition to the screenshot. Requires Chrome or Brave and adds one credit. Use pdf=1 when supplying pdf_* options.
pdf_format=letter, a4, legal — PDF paper size. Ignored when pdf_one_page is enabled. Defaults to letter.
pdf_background=0, 1 — Include background colors and images in the PDF. Defaults to 0.
pdf_one_page=0, 1 — Create one long PDF page using the viewport width and document height. Defaults to 0.
pdf_landscape=0, 1 — Use landscape orientation for the PDF. Defaults to 0.
pdf_margin — Set all four PDF margins to a nonnegative length. Units can be px, mm, cm, or in. A value without units is in pixels. Defaults to 0px. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_top — Override the top PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_bottom — Override the bottom PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_left — Override the left PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_right — Override the right PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
Video
video=0, 1 (default 0) — Record a video or animated GIF in addition to the screenshot. Requires Chrome or Brave at device scale 1. Adds one credit per started five seconds. Use video=1 when supplying video_* options.
video_format=webm, mp4, gif — Recording format. If MP4 encoding is unavailable, the capture can produce WebM. Defaults to webm.
video_duration=1–30 — Maximum recording duration in seconds. Charges are calculated from the requested duration. Defaults to 15 seconds.
video_quality=0–63 — Recording quality. Lower values mean higher quality. Defaults to 30.
video_fps=1–30 — Target frames per second for WebM and MP4. GIF uses 20 fps and ignores this value. Defaults to 30 for WebM and MP4.
video_scale=0.1–1 — Multiplier for recorded width and height. Defaults to 1 for WebM and MP4 and 0.5 for GIF.
Automation steps
You can create rich interactions with the browser and take multiple screenshots. See our blog post for more information and examples.
steps — JSON array of Browshot browser automation steps, in execution order.
Trackers
You can extract information from the web page such as search rank, prices, delivery dates, page titles, and more. See our blog post for more information.
trackers — JSON array of Browshot page data trackers.
Apps
See how to configure and select S3 and webhook apps.
apps (array of string) — Account-owned app IDs (slugs or numeric configuration IDs encoded as strings). Repeat apps for multiple IDs, for example apps=archive&apps=notify. As an alternative to repeated values, apps[archive]=captures/{id}.png supplies a per-capture S3 path template. Percent-encode brackets and template characters. App settings and credentials come from the saved configuration. An unknown, disabled, or foreign app is a validation error before any capture is submitted. At least 1 items. At most 10 items. Items must be unique. Repeat the parameter for each value.
curl --fail-with-body 'https://api.browshot.com/api/v2/batch/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--form 'file=@urls.txt' \
--form 'country=fr'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->batch_create(file => 'urls.txt', country => 'fr')), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->batch_create('urls.txt', array('country' => 'fr')), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.batch_create("urls.txt", { "country": "fr" }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.batch_create("urls.txt", { "country" => "fr" }))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.batchCreate("urls.txt", { "country": "fr" }, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.batchCreate("urls.txt", { "country": "fr" }, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.BatchCreate("urls.txt", new Hashtable { { "country", "fr" } });
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
batch information
Response body object
id (integer) — batch ID
status (string) — Batch status.Values in_queue, in_process, finished, error.
started (integer) — time of processing (UNIX timestamp)
finished (integer) — time of batch completed (UNIX timestamp)
count (integer) — number of unique URLs in the batch
processed (integer) — number of screenshots finishe
failed (integer) — number of screenshots failed
zip_url (string) — Authenticated URL to download the ZIP archive when the batch is finished.
urls (array of string) — URLs to download the batch
Each item (string)
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Batch not created
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
Get the status of a batch requested through the API or through the dashboard.
Required parameters
id — batch ID
https://api.browshot.com/api/v2/batch/info?id=42&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/batch/info' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=42'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->batch_info(id => 42)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->batch_info(42, array()), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.batch_info(42, {}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.batch_info(42, {}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.batchInfo(42, {}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.batchInfo(42, {}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.BatchInfo(42, null);
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
batch information
Response body object
id (integer) — batch ID
status (string) — Batch status.Values in_queue, in_process, finished, error.
started (integer) — time of processing (UNIX timestamp)
finished (integer) — time of batch completed (UNIX timestamp)
count (integer) — number of unique URLs in the batch
processed (integer) — number of screenshots finishe
failed (integer) — number of screenshots failed
zip_url (string) — Authenticated URL to download the ZIP archive when the batch is finished.
urls (array of string) — URLs to download the batch
Each item (string)
Batch not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - "in_queue", "processing", "finished", "error"
Download a finished batch ZIP
Required parameters
id — Batch ID from batch/create or batch/info. Minimum 1.
https://api.browshot.com/api/v2/batch/download?id=42&key=my_api_key
curl --fail --get 'https://api.browshot.com/api/v2/batch/download' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=42' \
--output 'batch.zip'Content types application/octet-stream, application/json
Batch ZIP attachment
Response headers
Content-Disposition (string)
Response body file
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Crawl a domain starting from a URL. The same capture settings and apps apply to every page found through links on that domain.
Required parameters
domain — Domain to crawl. At most 255 characters.
Common parameters
browser=chrome, firefox, brave (default chrome) — Browser engine used for the capture.
country=us, au, de, fi, fr, gb, in (default us) — Capture location, as a lowercase ISO 3166-1 alpha-2 code. United States (us), Australia (au), Germany (de), Finland (fi), France (fr), United Kingdom (gb), and India (in).
screen_width=1–5000 (default 1024) — Viewport width in CSS pixels. Omit when using device.
screen_height=1–5000 (default 768) — Viewport height in CSS pixels. Omit when using device.
mobile=0, 1 (default 0) — Use 0 for desktop or 1 for mobile emulation. Omit when using device.
device — Device key from device/list. It supplies the viewport, user agent, and mobile and touch settings. Browser and country can still be selected. At least 1 characters. At most 80 characters.
size=screen, page (default screen) — Capture the viewport or the full page.
hide_popups=0, 1 (default 0) — Hide popups, overlays, and cookie banners.
hide_ads=0, 1 (default 0) — Block advertising requests and hide matching ad elements. Brave uses its built-in ad blocker. Adds no credits.
tag (array of string) — Tags to apply to every screenshot in the request. Repeat tag or use comma-separated values. Each tag can contain up to 50 characters. At most 50 items. Repeat the parameter for each value.
Optional parameters
url — Starting URL. Defaults to the root URL of the domain.
max=1–1000 (default 100) — Maximum number of pages to crawl.
name — Name of the crawl.
device_scale=1, 2, 3 — Pixel density multiplier. Use 2 or 3 for retina output at the same CSS viewport size. Defaults to 1. The retina viewport is limited to 20 million physical pixels. Video requires a scale of 1.
pdf=0, 1 (default 0) — Generate a PDF in addition to the screenshot. Requires Chrome or Brave and adds one credit. Use pdf=1 when supplying pdf_* options.
pdf_format=letter, a4, legal — PDF paper size. Ignored when pdf_one_page is enabled. Defaults to letter.
pdf_background=0, 1 — Include background colors and images in the PDF. Defaults to 0.
pdf_one_page=0, 1 — Create one long PDF page using the viewport width and document height. Defaults to 0.
pdf_landscape=0, 1 — Use landscape orientation for the PDF. Defaults to 0.
pdf_margin — Set all four PDF margins to a nonnegative length. Units can be px, mm, cm, or in. A value without units is in pixels. Defaults to 0px. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_top — Override the top PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_bottom — Override the bottom PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_left — Override the left PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
pdf_margin_right — Override the right PDF margin. Defaults to pdf_margin. At most 32 characters. Pattern ^\d+(\.\d+)?(px|mm|cm|in)?$.
Video
video=0, 1 (default 0) — Record a video or animated GIF in addition to the screenshot. Requires Chrome or Brave at device scale 1. Adds one credit per started five seconds. Use video=1 when supplying video_* options.
video_format=webm, mp4, gif — Recording format. If MP4 encoding is unavailable, the capture can produce WebM. Defaults to webm.
video_duration=1–30 — Maximum recording duration in seconds. Charges are calculated from the requested duration. Defaults to 15 seconds.
video_quality=0–63 — Recording quality. Lower values mean higher quality. Defaults to 30.
video_fps=1–30 — Target frames per second for WebM and MP4. GIF uses 20 fps and ignores this value. Defaults to 30 for WebM and MP4.
video_scale=0.1–1 — Multiplier for recorded width and height. Defaults to 1 for WebM and MP4 and 0.5 for GIF.
Automation steps
You can create rich interactions with the browser and take multiple screenshots. See our blog post for more information and examples.
steps — JSON array of Browshot browser automation steps, in execution order.
Trackers
You can extract information from the web page such as search rank, prices, delivery dates, page titles, and more. See our blog post for more information.
trackers — JSON array of Browshot page data trackers.
Apps
See how to configure and select S3 and webhook apps.
apps (array of string) — Account-owned app IDs (slugs or numeric configuration IDs encoded as strings). Repeat apps for multiple IDs, for example apps=archive&apps=notify. As an alternative to repeated values, apps[archive]=captures/{id}.png supplies a per-capture S3 path template. Percent-encode brackets and template characters. App settings and credentials come from the saved configuration. An unknown, disabled, or foreign app is a validation error before any capture is submitted. At least 1 items. At most 10 items. Items must be unique. Repeat the parameter for each value.
https://api.browshot.com/api/v2/crawl/create?domain=example.com&url=https%3A%2F%2Fexample.com%2F&country=fr&max=10&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/crawl/create' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'domain=example.com' \
--data-urlencode 'url=https://example.com/' \
--data-urlencode 'country=fr' \
--data-urlencode 'max=10'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->crawl_create(domain => 'example.com', url => 'https://example.com/', country => 'fr', max => 10)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->crawl_create(array(
'domain' => 'example.com',
'url' => 'https://example.com/',
'country' => 'fr',
'max' => 10
)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.crawl_create("example.com", "https://example.com/", { "country": "fr", "max": 10 }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.crawl_create("example.com", { "url" => "https://example.com/", "country" => "fr", "max" => 10 }))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.crawlCreate("example.com", "https://example.com/", { "country": "fr", "max": 10 }, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.crawlCreate("example.com", "https://example.com/", { "country": "fr", "max": 10 }, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.CrawlCreate(new Hashtable {
{ "domain", "example.com" },
{ "url", "https://example.com/" },
{ "country", "fr" },
{ "max", 10 }
});
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Crawl accepted
Response body object
id (integer, int64) — Crawl ID.
status (string) — Current crawl status.Values in_queue, in_process, finished, error.
started (integer) — Start time as a Unix timestamp.
finished (integer) — Completion time as a Unix timestamp, or 0 while pending.
count (integer) — Number of URLs discovered.
processed (integer) — Number of screenshots processed.
failed (integer) — Number of failed screenshots.
urls (array of Screenshot) — Screenshot results for the URLs discovered in the crawl.
Each item (object)
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Get crawl status and screenshots
Required parameters
id — Crawl ID returned by crawl/create. Minimum 1.
https://api.browshot.com/api/v2/crawl/info?id=42&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/crawl/info' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=42'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->crawl_info(id => 42)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->crawl_info(42, array()), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.crawl_info(42, {}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.crawl_info(42, {}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.crawlInfo(42, {}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.crawlInfo(42, {}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.CrawlInfo(42, null);
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Crawl status and screenshot details
Response body object
id (integer, int64) — Crawl ID.
status (string) — Current crawl status.Values in_queue, in_process, finished, error.
started (integer) — Start time as a Unix timestamp.
finished (integer) — Completion time as a Unix timestamp, or 0 while pending.
count (integer) — Number of URLs discovered.
processed (integer) — Number of screenshots processed.
failed (integer) — Number of failed screenshots.
urls (array of Screenshot) — Screenshot results for the URLs discovered in the crawl.
Each item (object)
id (integer, required) — screenshot ID
status (string, required) — status of the request: "in_queue", "in_process", "finished", "error" Values in_queue, in_process, finished, error.
tag (array of string) — Tags associated with the screenshot, when supplied with the capture.
Each item (string)At most 50 characters.
screenshot_url (string) — URL to download the screenshot at CSS-pixel dimensions. Empty until the capture finishes successfully.
pdf (integer) — Present with value 1 when the PDF was requested or is available.Values 1.
pdf_url (string) — Authenticated PDF download URL, or an empty string while unavailable.
video (integer) — Present with value 1 when video was requested or is available.Values 1.
video_url (string) — Authenticated video or GIF download URL, or an empty string while unavailable.
device_scale (integer) — Present with value 2 or 3 for a retina capture.Values 2, 3.
hide_ads (integer) — Present with value 1 when ad blocking was enabled.Values 1.
error (string) — description of the problem that occurred
priority (integer) — priority given to the screenshot: high (1) to low (3)Minimum 1. Maximum 3.
url (string, required) — original URL requested
size (string) — screenshot size requestedValues screen, page.
width (integer) — screenshot width
height (integer) — screenshot height
final_url (string) — URL of the screenshot (redirections can occur)
final_urls (array of string) — Final URL of the page at each capture in the sequence.
Each item (string)
html (integer) — Whether HTML was requested. Use screenshot/html to retrieve it.Values 0, 1.
shots (integer) — Number of screenshots requested.
shot_interval (integer) — Time in seconds between consecutive screenshots.
time_added (integer) — UNIX timestamp in seconds when the capture was requested.
scale (number, double) — image scale. Always 1 for desktop browsers; mobiles may change the scale (zoom in or zoom out) to fit the page on the screen
cost (integer) — number of credits spent for the screenshot
delay (integer) — number of seconds to wait after page load
browser (string) — Resolved browser for the capture. May be absent for historical records.Values chrome, firefox, brave.
country (string) — Resolved country for the capture. Historical records can show other countries.Pattern ^[a-z]{2}$.
screen_width (integer) — Resolved screen width for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
screen_height (integer) — Resolved screen height for the capture. May be absent for historical records.Minimum 1. Maximum 20000.
mobile (integer) — Resolved mobile for the capture. May be absent for historical records.Values 0, 1.
device (string) — Named device selected for the capture, when supplied.At least 1 characters. At most 80 characters.
trackers (array of object) — Results of configured page data trackers, when available.
Each item (object)
apps (array of AppStatus) — Separate status for each requested app, when available.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Look up a capture browser by its engine name or its existing numeric browser ID. Supply exactly one of browser or id.
Optional parameters
id — browser ID
browser=chrome, firefox, brave
https://api.browshot.com/api/v2/browser/info?browser=chrome&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/browser/info' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'browser=chrome'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->browser_info(browser => 'chrome')), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->browser_info('chrome'), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.browser_info("chrome"), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.browser_info("chrome"))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.browserInfo("chrome", result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.browserInfo("chrome", result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.BrowserInfo("chrome");
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Browser information
Response body object
id (integer, required) — browser ID
name (string, required) — Display name of the browser engine.
javascript (integer) — JavaScript support: 1 if enabled, 0 if disabledMinimum 0. Maximum 1.
mobile (integer) — Mobile browser: 1 if true, 0 if falseMinimum 0. Maximum 1.
browser (string, required) — Value to send as browser on capture requests.Values chrome, firefox, brave.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Browser not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - error
List available capture browsers in the existing browser-ID-keyed format.
https://api.browshot.com/api/v2/browser/list?key=my_api_key
curl --fail-with-body 'https://api.browshot.com/api/v2/browser/list' \
-H "X-API-KEY: $BROWSHOT_API_KEY"use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->browser_list()), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->browser_list(), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.browser_list(), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.browser_list())
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.browserList(result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.browserList(result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.BrowserList();
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Browser definitions
Response body object of Browser values
default (integer) — ID of the default browser. The other keys are browser IDs.
Each value (object)
id (integer, required) — browser ID
name (string, required) — Display name of the browser engine.
javascript (integer) — JavaScript support: 1 if enabled, 0 if disabledMinimum 0. Maximum 1.
mobile (integer) — Mobile browser: 1 if true, 0 if falseMinimum 0. Maximum 1.
browser (string, required) — Value to send as browser on capture requests.Values chrome, firefox, brave.
Account not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - error
List named capture devices
Pass a device key to select its viewport and emulation settings.
iPhone 15 Pro iphone_15_pro
iPhone 15 Pro landscape iphone_15_pro_landscape
iPad Pro 11 ipad_pro_11
Pixel 5 pixel_5
Galaxy S9+ galaxy_s9
Galaxy Tab S4 galaxy_tab_s4
https://api.browshot.com/api/v2/device/list?key=my_api_key
curl --fail-with-body 'https://api.browshot.com/api/v2/device/list' \
-H "X-API-KEY: $BROWSHOT_API_KEY"use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->device_list()), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->device_list(), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.device_list(), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.device_list())
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.deviceList(result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.deviceList(result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.DeviceList();
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Available device presets
Response body object
devices (array of Device, required) — Device presets available for capture requests.
Each item (object)
device (string, required) — Device key to use in a capture request.At least 1 characters. At most 80 characters.
screen_width (integer, required) — Preset viewport width in CSS pixels.Minimum 1. Maximum 5000.
screen_height (integer, required) — Preset viewport height in CSS pixels.Minimum 1. Maximum 5000.
mobile (integer, required) — Whether mobile emulation is enabled. 1 means enabled.Values 0, 1.
name (string, required) — Display name of the device.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
List configured apps
https://api.browshot.com/api/v2/app/list?key=my_api_key
curl --fail-with-body 'https://api.browshot.com/api/v2/app/list' \
-H "X-API-KEY: $BROWSHOT_API_KEY"use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_list()), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_list(), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_list(), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_list())
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appList(result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appList(result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppList();
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Apps owned by the authenticated account
Response body object
apps (array of App, required) — App configurations belonging to the account.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier to pass in the apps parameter of capture requests.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type. Use s3 for access keys, aws_s3 for access granted to Browshot, or webhook for HTTPS delivery.Values s3, aws_s3, webhook.
name (string, required) — Display name of the app.
isActive (boolean, required) — Whether the app is enabled for captures.
status (string, required) — Current app setup or connectivity check status.Values active, processing, error.
config (object) — App configuration safe to return in API responses.
bucket (string) — Required for both s3 and aws_s3.
region (string) — Defaults to us-east-1 for s3 and to Browshot’s configured region for aws_s3.
endpoint (string, uri) — Optional public HTTPS endpoint for s3. The aws_s3 type uses Amazon S3.
pathTemplate (string) — Optional S3 path and filename template. Include a screenshot ID or other unique value to avoid replacing objects.
url (string, uri) — Destination HTTPS URL. Required for webhook.Pattern ^https://.
lastError (string) — Latest app setup or connectivity error, if any.
lastVerifiedAt (string, date-time) — Last successful connectivity check, if any.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Get app configuration
Required parameters
id — Numeric app configuration ID returned by app/list or app/create. Minimum 1.
https://api.browshot.com/api/v2/app/info?id=42&key=my_api_key
curl --fail-with-body --get 'https://api.browshot.com/api/v2/app/info' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
--data-urlencode 'id=42'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_info(id => 42)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_info(42, array()), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_info(42, {}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_info(42, {}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appInfo(42, {}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appInfo(42, {}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppInfo(42, null);
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
App configuration with sensitive fields omitted
Response body object
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier to pass in the apps parameter of capture requests.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type. Use s3 for access keys, aws_s3 for access granted to Browshot, or webhook for HTTPS delivery.Values s3, aws_s3, webhook.
name (string, required) — Display name of the app.
isActive (boolean, required) — Whether the app is enabled for captures.
status (string, required) — Current app setup or connectivity check status.Values active, processing, error.
config (object) — App configuration safe to return in API responses.
bucket (string) — Required for both s3 and aws_s3.
region (string) — Defaults to us-east-1 for s3 and to Browshot’s configured region for aws_s3.
endpoint (string, uri) — Optional public HTTPS endpoint for s3. The aws_s3 type uses Amazon S3.
pathTemplate (string) — Optional S3 path and filename template. Include a screenshot ID or other unique value to avoid replacing objects.
url (string, uri) — Destination HTTPS URL. Required for webhook.Pattern ^https://.
lastError (string) — Latest app setup or connectivity error, if any.
lastVerifiedAt (string, date-time) — Last successful connectivity check, if any.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Save a reusable app configuration under an account-owned app_id. Webhook apps POST the WebhookDelivery body when captures finish or fail. S3 apps upload screenshot images after successful captures.
Required parameters
body (JSON body)
type (string, required) Values s3, aws_s3, webhook.
app_id (string, required) At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
name (string, required)
config (object, required)
See the AWS S3 ACL, S3 access keys, and webhook configuration examples.
Content types application/json
Created app
Response body object
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier to pass in the apps parameter of capture requests.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type. Use s3 for access keys, aws_s3 for access granted to Browshot, or webhook for HTTPS delivery.Values s3, aws_s3, webhook.
name (string, required) — Display name of the app.
isActive (boolean, required) — Whether the app is enabled for captures.
status (string, required) — Current app setup or connectivity check status.Values active, processing, error.
config (object) — App configuration safe to return in API responses.
bucket (string) — Required for both s3 and aws_s3.
region (string) — Defaults to us-east-1 for s3 and to Browshot’s configured region for aws_s3.
endpoint (string, uri) — Optional public HTTPS endpoint for s3. The aws_s3 type uses Amazon S3.
pathTemplate (string) — Optional S3 path and filename template. Include a screenshot ID or other unique value to avoid replacing objects.
url (string, uri) — Destination HTTPS URL. Required for webhook.Pattern ^https://.
lastError (string) — Latest app setup or connectivity error, if any.
lastVerifiedAt (string, date-time) — Last successful connectivity check, if any.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
The resource or requested operation conflicts with its current state.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Update fields of an owned app. A supplied config replaces the previous config. Omit config for metadata-only updates. The app type is fixed.
Required parameters
body (JSON body)
id (integer, required) Numeric app configuration ID returned by app/list or app/create. Minimum 1.
app_id (string) At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
name (string)
isActive (boolean)
config (object)
curl --fail-with-body 'https://api.browshot.com/api/v2/app/update' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"id":42,"name":"Website capture notifications","isActive":true}'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_update(id => 42, name => 'Website capture notifications', isActive => 1)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_update(42, array('name' => 'Website capture notifications', 'isActive' => true)), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_update(42, { "name": "Website capture notifications", "isActive": True }), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_update(42, { "name" => "Website capture notifications", "isActive" => true }))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appUpdate(42, { "name": "Website capture notifications", "isActive": true }, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appUpdate(42, { "name": "Website capture notifications", "isActive": true }, result => {
console.log(result);
});
using System;
using System.Collections;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppUpdate(42, new Hashtable { { "name", "Website capture notifications" }, { "isActive", true } });
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Updated app
Response body object
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier to pass in the apps parameter of capture requests.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type. Use s3 for access keys, aws_s3 for access granted to Browshot, or webhook for HTTPS delivery.Values s3, aws_s3, webhook.
name (string, required) — Display name of the app.
isActive (boolean, required) — Whether the app is enabled for captures.
status (string, required) — Current app setup or connectivity check status.Values active, processing, error.
config (object) — App configuration safe to return in API responses.
bucket (string) — Required for both s3 and aws_s3.
region (string) — Defaults to us-east-1 for s3 and to Browshot’s configured region for aws_s3.
endpoint (string, uri) — Optional public HTTPS endpoint for s3. The aws_s3 type uses Amazon S3.
pathTemplate (string) — Optional S3 path and filename template. Include a screenshot ID or other unique value to avoid replacing objects.
url (string, uri) — Destination HTTPS URL. Required for webhook.Pattern ^https://.
lastError (string) — Latest app setup or connectivity error, if any.
lastVerifiedAt (string, date-time) — Last successful connectivity check, if any.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
The resource or requested operation conflicts with its current state.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Remove an owned app from future capture requests. Previous deliveries and uploaded objects remain available according to destination retention.
Required parameters
body (JSON body)
id (integer, required) Numeric app configuration ID returned by app/list or app/create. Minimum 1.
curl --fail-with-body 'https://api.browshot.com/api/v2/app/delete' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"id":42}'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_delete(id => 42)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_delete(42, array()), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_delete(42, {}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_delete(42, {}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appDelete(42, {}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appDelete(42, {}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppDelete(42, null);
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Deleted app
Response body object
id (integer, int64, required) — ID of the deleted app configuration.Minimum 1.
status (string, required) — ok when deletion succeeds.Values ok.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Queue a test delivery to the owned app destination. For S3, this writes browshot-test.txt in the bucket. Read the result with app/info.
Required parameters
body (JSON body)
id (integer, required) Numeric app configuration ID returned by app/list or app/create. Minimum 1.
curl --fail-with-body 'https://api.browshot.com/api/v2/app/test' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"id":42}'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_test(id => 42)), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_test(42, array()), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_test(42, {}), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_test(42, {}))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appTest(42, {}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appTest(42, {}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppTest(42, null);
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Test queued
Response body object
id (integer, int64, required) — ID of the app being tested.Minimum 1.
status (string, required) — processing while the app check is queued.Values processing.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Queue configured apps for an owned finished screenshot. Use screenshot/info to read delivery results. An app failure is reported separately from capture status.
Required parameters
body (JSON body)
screenshot_id (integer, required) Minimum 1.
apps (array of string, required) At least 1 items. At most 10 items. Items must be unique.
curl --fail-with-body 'https://api.browshot.com/api/v2/app/run' \
-H "X-API-KEY: $BROWSHOT_API_KEY" \
-H 'Content-Type: application/json' \
--data '{"screenshot_id":1103982291,"apps":["archive","notify"]}'use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->app_run(screenshot_id => 1103982291, apps => ['archive', 'notify'])), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->app_run(1103982291, array('archive', 'notify')), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.app_run(1103982291, ["archive", "notify"]), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.app_run(1103982291, ["archive", "notify"]))
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.appRun(1103982291, ["archive", "notify"], result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.appRun(1103982291, ["archive", "notify"], result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AppRun(1103982291, new[] { "archive", "notify" });
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Apps accepted
Response body object
id (integer, int64, required) — ID of the screenshot the apps will process.Minimum 1.
apps (array of AppStatus, required) — Current run status for each requested app.
Each item (object)
id (integer, int64, required) — Numeric app configuration ID.Minimum 1.
app_id (string, required) — App identifier used in the capture request.At least 1 characters. At most 40 characters. Pattern ^[a-z0-9-]+$.
type (string, required) — Destination type.Values s3, aws_s3, webhook.
name (string) — Display name of the app.
status (string, required) — State of this app run for the screenshot.Values pending, queued, processing, finished, error.
filename (string) — S3 object key written by a successful upload.
error (string) — Delivery error, when available.
output_url (string) — URL of the app output, when returned.
updated_at (string, date-time) — Time of the latest app run update.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Resource is missing or belongs to another account. Downloads also return 404 if the capture is unfinished or the artifact is missing or deleted.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
The resource or requested operation conflicts with its current state.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Get account status and credit balances.
https://api.browshot.com/api/v2/account/info?key=my_api_key
curl --fail-with-body 'https://api.browshot.com/api/v2/account/info' \
-H "X-API-KEY: $BROWSHOT_API_KEY"use strict;
use warnings;
use WebService::Browshot;
use JSON qw(encode_json);
my $client = WebService::Browshot->new(key => $ENV{BROWSHOT_API_KEY});
print encode_json($client->account_info()), "\n";
<?php
require 'vendor/autoload.php';
$client = new Browshot(getenv('BROWSHOT_API_KEY'));
echo json_encode($client->account_info(), JSON_PRETTY_PRINT), PHP_EOL;
import json
import os
from browshot import BrowshotClient
client = BrowshotClient(os.environ["BROWSHOT_API_KEY"])
print(json.dumps(client.account_info(), indent=2))
require "browshot"
require "json"
client = Browshot.new(ENV.fetch("BROWSHOT_API_KEY"))
puts JSON.pretty_generate(client.account_info())
const Browshot = require('browshot');
const client = new Browshot(process.env.BROWSHOT_API_KEY);
client.accountInfo({}, result => {
console.log(result);
});
const BrowshotEvents = require('browshot-events');
const client = new BrowshotEvents(process.env.BROWSHOT_API_KEY);
client.browshot.accountInfo({}, result => {
console.log(result);
});
using System;
using System.Web.Script.Serialization;
using Browshot;
class Example
{
static void Main()
{
var client = new BrowshotClient(Environment.GetEnvironmentVariable("BROWSHOT_API_KEY"));
var result = client.AccountInfo();
Console.WriteLine(new JavaScriptSerializer().Serialize(result));
}
}
Content types application/json
Account information
Response body object
active (integer) — Account is active. A successful response contains 1.Values 1.
balance (integer, required) — number of credits left on your account
free_screenshots_left (integer, required) — Remaining free monthly allowance, shared with v1.
free_credits_left (integer, required) — Remaining free monthly credits usable with any v2 capture option.
Invalid request parameters or insufficient credits. For downloads, check the screenshot ID.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Account not found
Response body object
error (string) — description of the problem that occurred
status (string) — status of the request - error
Returns plain text OK. If supplied, the customer key is validated.
Optional parameters
key
X-API-KEY (header)
https://api.browshot.com/api/v2/ping
curl --fail-with-body 'https://api.browshot.com/api/v2/ping'Content types text/plain, application/json
API is available
Response body string Values OK.
Missing or invalid API key.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.
Unable to process the request or retrieve the file temporarily.
Response body object
success (boolean, required) — Always false for an error response.Values false.
error (string, required) — Machine-readable error code.Values INVALID_REQUEST, UNAUTHORIZED, NOT_FOUND, CONFLICT, API_UNAVAILABLE.
message (string, required) — Human-readable error message.