🚀 Experience the new and improved APIVoid! Check out what's new
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,
"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
}
Key Features
Businesses and startups use this Screenshot API to effortlessly take screenshots of websites homepage, pricing pages, news articles, seasonal newsletters and much more.
Our API is focused into rendering screenshots in a high-quality and clean PNG image file.
The generated image file can be in different formats, such as PNG (default), JPEG, WEBP, AVIF.
Set viewport size, enable full-page screenshot, disable ads, disable cookie banners, disable images.
Gain additional insights of the web page: page title, meta description, keywords, og image, etc.
Common Use Cases
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:
Convert any website or web page into high-quality PNG, JPG, WEBP image for testing how it looks.
Need to take a screenshot of the homepage of a list of websites? Easy! Our API allows you to do that.
Convert any news article into a PNG image, serve it has a evidence or easily share it with colleagues.
Use this API to effortlessly automate any manual task of converting web pages to images in no time.
USAGE EXAMPLE
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>';
}
}
}
Create your account, pick a subscription plan, and make your first API call instantly with your API key—simple as that!
Get started now