APIVoid logo

Screenshot API Reference

Capture a screenshot of any web page in a real browser, with full-page capture, device emulation, dark mode, custom viewport and headers, and many other options.

Service details and pricing: Screenshot API

POSThttps://api.apivoid.com/v2/screenshot
20 credits per successful requestCan take up to 150 secondsPOST · JSON

Request example

Query the endpoint via an HTTPS POST request (replace YOUR_API_KEY_HERE with your API key):

curl
curl -X POST "https://api.apivoid.com/v2/screenshot" \
     -H "Content-Type: application/json" \
     -H "X-API-Key: YOUR_API_KEY_HERE" \
     -d '{"url": "https://apple.com/"}' 

The same request in PHP:

php
$url = 'https://apple.com/';

$apiKey = 'YOUR_API_KEY_HERE';

$curl = curl_init('https://api.apivoid.com/v2/screenshot');
curl_setopt($curl, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($curl, CURLOPT_POST, true);
curl_setopt($curl, CURLOPT_POSTFIELDS, json_encode(['url' => $url]));
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($curl);
$httpCode = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);

if ($httpCode === 200) {
    $responseData = json_decode($response, true);

    // Save the "base64_file" data as a PNG file
    if (isset($responseData['rendered_file']['base64_file'])) {
        $saveAs = __DIR__ . '/screenshot.png';
        file_put_contents($saveAs, base64_decode($responseData['rendered_file']['base64_file']));
    }
} else {
    print_r('An error occurred: '.$response);
}

Request parameters

Required

urlstringRequired

URL to submit, e.g. https://apple.com/.

Optional

image_typestringDefault: png

Screenshot image type: png, jpeg, webp, avif.

full_pagebooleanDefault: false

Take a full page screenshot (max 15000px height).

viewport_widthintegerDefault: 1920

Browser viewport width in pixels (max 5000).

viewport_heightintegerDefault: 1080

Browser viewport height in pixels (max 10000).

image_widthinteger

Thumbnail image width in pixels (max 5000).

image_heightinteger

Thumbnail image height in pixels (max 10000).

add_url_barbooleanDefault: falseNew

Include the browser's address bar in the screenshot.

user_agentstringDefault: desktop

Can be desktop (default, a random desktop user agent) or mobile.

accept_languagestringDefault: en-US

Change the Accept-Language HTTP header, format like en-US.

basic_auth_usernamestring

Set username for Basic Authentication.

basic_auth_passwordstring

Set password for Basic Authentication.

authorization_bearerstring

Set the authorization bearer token.

custom_headerstring

A custom header, e.g. X-key: 690d1f9e-5a53-45ad-997d-a23143a0d068.

disable_jsbooleanDefault: false

Disable JavaScript.

disable_popupsbooleanDefault: true

Disable alerts, cookie consents and confirmation dialogs.

disable_imagesbooleanDefault: false

Disable loading of images.

disable_adsbooleanDefault: true

Disable advertisements.

disable_fontsbooleanDefault: false

Disable loading of custom fonts.

omit_backgroundbooleanDefault: false

Omit the page background.

grayscalebooleanDefault: false

The screenshot image will be grayscaled.

emulate_devicestring

Can be ipad, ipad_landscape, iphone5, iphone5_landscape, iphone8, iphone8_landscape, iphone13, iphone13_landscape.

dark_modebooleanDefault: false

Enable dark mode, if available on the web page.

delayintegerDefault: 0

Wait N seconds (max 10) before taking the screenshot.

Response example

A successful request returns HTTP 200 with a JSON body:

json · 200
{
    "url": "https://apple.com/",
    "rendered_file": {
        "format": "PNG",
        "date_time_utc": "2024-11-29 19:00:32",
        "base64_file": "iVBORw0KGgoAAAANSUhEUgAAB4AAAAQ4CAIAAABnsVYUAAAAAXNSR0IArs4c6QAAIABJREFUeJzs3XdUFNfbB/C7dJbeu4ICQUERBLEgWLA37KKoEbFrrKiINbH3rlhQsWHABhqxgQiKCg...",
        "image_width": 1920,
        "image_height": 1080,
        "file_size_readable": "344.53 KB",
        "file_size_bytes": 352795
    },
    "http_response": {
        "final_url": "https://www.apple.com/",
        "status_code": 200,
        "content_type": "text/html",
        "page_content_empty": false,
        "ip": "69.192.160.210"
    },
    "html_info": {
        "title": "Apple",
        "description": "Discover the innovative world of Apple and shop everything iPhone, iPad, Apple Watch, Mac, and Apple TV, plus explore accessories, entertainment, and expert device support.",
        "og_image": "https://www.apple.com/ac/structured-data/images/open_graph_logo.png?202110180743",
        "icon": "",
        "og_site_name": "Apple",
        "ld_organization": "Apple",
        "canonical": "https://www.apple.com/",
        "robots": "",
        "twitter_site": "",
        "lang": "en-US"
    },
    "elapsed_ms": 5763
}

Response fields

The fields returned in the JSON response:

urlstring

URL submitted for the screenshot.

rendered_file → formatstring

Format of the rendered file, e.g. PNG.

rendered_file → date_time_utcstring

Date and time (UTC) of when the screenshot was captured.

rendered_file → base64_filestring

The screenshot image encoded in base64.

rendered_file → image_widthinteger

Width of the screenshot in pixels.

rendered_file → image_heightinteger

Height of the screenshot in pixels.

rendered_file → file_size_readablestring

File size in human-readable format, e.g. 344.53 KB.

rendered_file → file_size_bytesinteger

File size in bytes.

http_response → final_urlstring

Final URL after following redirects.

http_response → status_codeinteger

HTTP status code returned by the server.

http_response → content_typestring

Content type of the page, e.g. text/html.

http_response → page_content_emptyboolean

Returns true if the page content is empty.

http_response → ipstring

IP address of the server that served the page.

html_info → titlestring

Title of the page.

html_info → descriptionstring

Meta description of the page.

html_info → og_imagestring

Open Graph image URL of the page.

html_info → iconstring

Favicon URL of the page.

html_info → og_site_namestring

Open Graph site name of the page.

html_info → ld_organizationstring

Organization name found in JSON-LD structured data.

html_info → canonicalstring

Canonical URL of the page.

html_info → robotsstring

Robots meta tag of the page.

html_info → twitter_sitestring

Twitter site handle of the page.

html_info → langstring

Language declared by the page, e.g. en-US.

elapsed_msinteger

Time taken to process the request, in milliseconds.