Screenshots
Kick off a screenshot run across browsers and fetch the images when it finishes.
- Endpoint
- api.testingbot.com
- Version
- v1
- Format
- JSON
- Auth
- HTTP Basic
POST
/v1/screenshots
Capture a new screenshot batch
Queues a cross-browser screenshot of a given URL at a specified resolution. Rendering is asynchronous: this returns the batch ID only, so poll GET /v1/screenshots/:id until itsstate is done to collect the images.
Arguments
-
urlstring required - Page URL to screenshot.
-
resolutionstring required - Browser viewport (e.g. "1920x1080").
-
browsersarray required -
Array of
{ browser, version, os }triples (orbrowser_ids) to render with. -
wait_timeinteger - Seconds to wait after page load before snapping.
-
fullpageboolean - Capture the entire scrollable page instead of just the viewport.
-
callback_urlstring - POST callback URL invoked when the batch finishes processing.
Request
$ curl -H 'Content-Type: application/json' -X POST "https://api.testingbot.com/v1/screenshots" \
-u key:secret \
-d '{
"url": "https://www.google.com",
"resolution": "1280x1024",
"browsers": [
{ "browserName": "chrome", "version": 134, "os": "WIN10" },
{ "browserName": "safari", "version": "17.2", "platformName": "iOS", "deviceName": "iPhone 15" }
]
}'
var client = new TestingBotClient(key, secret);
var batch = await client.Screenshots.CaptureAsync(new ScreenshotRequest
{
Url = "https://www.google.com",
Resolution = "1280x1024",
BrowserIds = new[] { 1, 22 }
});
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.take_screenshots({ url: 'https://www.google.com', resolution: '1280x1024', browsers: [{ browserName: 'chrome', version: 134, os: 'WIN10' }] })
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.screenshots.take_screenshots('https://www.google.com', '1280x1024', [1, 22])
$client = new TestingBot\Client($key, $secret);
$batch = $client->screenshots()->create('https://example.com', [1, 2], [
'resolution' => '1920x1080',
]);
TestingbotREST restApi = new TestingbotREST(key, secret);
Map<String, Object> params = new HashMap<>();
params.put("url", "https://www.google.com");
params.put("resolution", "1280x1024");
TestingbotScreenshot screenshots = restApi.createScreenshots(params);
const TestingBot = require('testingbot-api');
const api = new TestingBot({
api_key: "your-tb-key",
api_secret: "your-tb-secret"
});
const screenshots = await api.takeScreenshot(
'https://example.com',
[{ browserName: 'chrome', version: 'latest', os: 'WIN11' }],
'1920x1080'
);
Response
{
"id": 3454,
"wait_time": 0,
"resolution": "1280x1024",
"url": "https://www.google.com"
}
GET
/v1/screenshots/{id}
Get screenshot batch detail
Returns per-browser screenshot results for a single batch, including thumbnail/image URLs and processing state.Arguments
-
idinteger required - Numeric screenshot batch ID.
-
excludeIdsstring - Comma-separated screenshot IDs to exclude (useful for delta-fetch).
Response fields
-
idinteger - Unique screenshot batch ID.
-
urlstring - URL the screenshots were taken from.
-
resolutionstring - Browser viewport resolution.
-
statestring -
Batch state:
processinguntil every browser has finished, thendone. -
created_attimestamp - —
-
screenshotsarray of screenshot result objects - Per-browser results with download URLs.
Request
$ curl "https://api.testingbot.com/v1/screenshots/{id}" -u key:secret
var client = new TestingBotClient(key, secret);
var batch = await client.Screenshots.GetAsync(batchId);
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_screenshots(screenshot_id)
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.screenshots.get_screenshot(screenshot_id)
$client = new TestingBot\Client($key, $secret);
$batch = $client->screenshots()->get($screenshotId);
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotScreenshot screenshot = restApi.getScreenshot(screenshotId);
const TestingBot = require('testingbot-api');
const api = new TestingBot({
api_key: "your-tb-key",
api_secret: "your-tb-secret"
});
const screenshotResult = await api.retrieveScreenshots(screenshotJobId);
Response
{
"id": 3454,
"url": "https://www.google.com",
"resolution": "1280x1024",
"created_at": "2017-10-13T14:47:41.000Z",
"state": "done",
"screenshots": [
{
"image_url": "https://....",
"thumb_url": "https://....",
"state": "done",
"id": "9c7deea4-6f23-4041-842b-39cccee447fa",
"session_id": 0,
"created_at": "2017-10-13T14:47:44.000Z",
"os": "SEQUOIA",
"browser_name": "googlechrome",
"browser_version": "138",
"browser_id": 1146,
"device_name": null,
"platform_name": null
}
]
}
GET
/v1/screenshots
List screenshot batches
Returns batches of cross-browser screenshots the account has queued historically.Arguments
-
offsetinteger - Skip this many batches.
-
countinteger - Number of batches to return.
Response fields
-
dataarray of screenshot summary objects - Screenshot batches for this page.
-
metameta object - —
Request
$ curl "https://api.testingbot.com/v1/screenshots" -u key:secret
var client = new TestingBotClient(key, secret);
var history = await client.Screenshots.ListAsync();
require 'testingbot'
api = TestingBot::Api.new(key, secret)
api.get_screenshots_history(0, 10)
import testingbotclient
tb = testingbotclient.TestingBotClient(key, secret)
tb.screenshots.get_screenshots(offset=0, limit=10)
$client = new TestingBot\Client($key, $secret);
$batches = $client->screenshots()->list(0, 10);
TestingbotREST restApi = new TestingbotREST(key, secret);
TestingbotScreenshotCollection screenshots = restApi.getScreenshots();
const TestingBot = require('testingbot-api');
const api = new TestingBot({
api_key: "your-tb-key",
api_secret: "your-tb-secret"
});
const screenshots = await api.getScreenshotList();
Response
{
"data": [
{ "id": 3454, "url": "https://google.com", "resolution": "1280x1024", "created_at": "2017-10-13T14:47:41.000Z" },
{ "id": 3452, "url": "https://testingbot.com", "resolution": "1280x1024", "created_at": "2017-10-12T09:22:03.000Z" }
],
"meta": { "offset": 0, "count": 3, "total": 3 }
}