🚀 Experience the new and improved APIVoid! Check out what's new

Screenshot API: Take pixel-perfect website screenshots

A JSON API to take screenshots of any website or web page. Use this API to take pixel-perfect web page screenshots, set custom viewport size, full-page screenshot, disable ads, disable cookie banners, and more.

Consumes 20 credits per API call

# Example Curl request from the command line:
                          
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/"}'

# Example JSON output for a 200 HTTP status code:

{
    "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
}
Code analysis

Key Features

Take screenshots of websites, convert URLs into PNG images

Businesses and startups use this Screenshot API to effortlessly take screenshots of websites homepage, pricing pages, news articles, seasonal newsletters and much more.

High-Quality Screenshots

Our API is focused into rendering screenshots in a high-quality and clean PNG image file.

PNG, JPEG, WEBP, AVIF

The generated image file can be in different formats, such as PNG (default), JPEG, WEBP, AVIF.

Configurable Options

Set viewport size, enable full-page screenshot, disable ads, disable cookie banners, disable images.

Web Page Metadata

Gain additional insights of the web page: page title, meta description, keywords, og image, etc.

Common Use Cases

Take a look at some real-world use cases of this API service

Our API can be used in many ways, from cybersecurity tasks to marketing-specific tasks. Here we showcase the most popular use cases according to our customers usage:

URL to PNG Image

Convert any website or web page into high-quality PNG, JPG, WEBP image for testing how it looks.

Homepage Thumbnail

Need to take a screenshot of the homepage of a list of websites? Easy! Our API allows you to do that.

Show Evidences

Convert any news article into a PNG image, serve it has a evidence or easily share it with colleagues.

Automate Tasks

Use this API to effortlessly automate any manual task of converting web pages to images in no time.

Use cases

EVERYTHING YOU GET

Do it all with one screenshot request

One request renders the page in a real browser and returns the image in PNG, JPEG, WEBP or AVIF, plus full-page capture, device emulation, custom viewports and the page metadata behind it.

Mobile device emulation

  • Just set the device, e.g. iphone13
  • iPhone 5, iPhone 8 and iPhone 13
  • iPad in portrait and landscape
  • Landscape variant for every device
  • Change user agent (desktop or mobile)
  • Dark mode where supported

Image output and sizing

  • PNG, JPEG, WEBP and AVIF output
  • Smart full-page capture
  • Custom viewport up to 5000 × 10000
  • Thumbnail resizing to any dimensions
  • Grayscale the screenshot image
  • Browser address bar in the screenshot
  • Get image dimensions and file size

Clean, uncluttered captures

  • Ads disabled by default
  • Cookie banners disabled by default
  • Alerts and dialogs suppressed
  • Optionally disable images and fonts
  • Optionally disable JavaScript
  • Wait up to 10s before capturing
  • Pixel-perfect page screenshots

Headers and authentication

  • Basic Authentication
  • Authorization bearer token
  • Accept-Language override, e.g. en-US
  • Custom request header
  • Screenshot staging and internal tools

Page metadata and HTTP

  • Page title and meta description
  • Open Graph image and site name
  • Favicon and canonical URL
  • Robots meta tag and declared language
  • Organisation from JSON-LD data
  • Final URL after redirects
  • Status code and content type
  • Server IP and empty-page flag

Built for developers

  • Real browser and JS rendering
  • Plain JSON over HTTPS
  • Base64 image ready to decode and save
  • UTC capture timestamp in every response
  • Up to 120s allowed for heavy pages
  • 20 credits per successful request
  • Simple integration

USAGE EXAMPLE

Learn how seamless it is to add and use Screenshot API anywhere you want

All it takes is a HTTPS POST request with JSON payload to our endpoint, and you’ll receive the response within seconds, usually within 10-20 seconds. Here are a few code examples to use the API:

$url = 'https://www.apivoid.com';

$apiUrl = 'https://api.apivoid.com/v2/screenshot';
$apiKey = 'your_api_key_here';

$ch = curl_init($apiUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json', 'X-API-Key: ' . $apiKey]);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['url' => $url, 'full_page' => true]));
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

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

    print_r($responseData);

    // Save the "base64_file" data as PNG file
    if (isset($responseData['rendered_file']['base64_file'])) {
        $save_as = realpath(dirname(__FILE__)) . "/screenshot.png";
    
        file_put_contents($save_as, base64_decode($responseData['rendered_file']['base64_file']));
    
        if (file_exists($save_as)) {
            echo '<p><img src="screenshot.png" alt="screenshot" class="img-responsive" /></p>';
        } else {
            echo '<p>Failed to create screenshot.png file.</p>';
        }
    }
} else {
    print_r('An error occurred: '.$response);
}

Start using our API services, it takes just a few minutes

Create your account, pick a subscription plan, and make your first API call instantly with your API key, simple as that!

Get started now