Screenshot API
The Screenshot API lets you capture screenshots of any webpage by sending a simple GET request. Control the viewport size, output format, image quality, and when the browser considers the page fully loaded. Each successful request costs 5 credits.
Endpoint:
https://api.scrapingdog.com/screenshotAPI Parameters
π
Scrapingdog Parameters
api_keyRequiredYour personal API key. Available on your dashboard.
Type: String
π
Query Parameters
urlRequiredThe URL of the page for which you want to take a screenshot.
Type: String
π
Full Page
fullPageOptionalBoolean that tells the server to take a full-page screenshot or just the visible portion without scrolling.
Type: Boolean
π
Viewport
widthOptionalThe width of the browser viewport in pixels.
Type: StringheightOptionalThe height of the browser viewport in pixels.
Type: String
β³
Wait Until
wait_untilOptionalDetermines when navigation is considered complete before taking a screenshot.
Default Value -domcontentloaded
Options: load, domcontentloaded, networkidle
Type: String
πΌ
οΈ Format
formatOptionalScreenshot format option. Available: png, jpg, webp.
Default Value -png
Type: StringqualityOptionalImage quality setting (0-100 range).
Default Value -80
Type: String
API Examples

Code to Integrate
curl "https://api.scrapingdog.com/screenshot?api_key=APIKEY&url=https://www.scrapingdog.com" --output screenshot.png
import requests params = { "api_key": "APIKEY", "url": "https://www.scrapingdog.com" } response = requests.get("https://api.scrapingdog.com/screenshot", params=params) if response.status_code == 200: with open("screenshot.png", "wb") as f: f.write(response.content) print("Screenshot saved as screenshot.png") else: print("Failed to capture a screenshot.")
const axios = require('axios'); const fs = require('fs'); const params = { api_key: 'APIKEY', url: 'https://www.scrapingdog.com', }; axios.get('https://api.scrapingdog.com/screenshot', { params, responseType: 'stream' }) .then((response) => { if (response.status === 200) { response.data.pipe(fs.createWriteStream('screenshot.png')); console.log('Screenshot saved as screenshot.png'); } else { console.error('Failed to capture a screenshot.'); } }) .catch((error) => console.error('Error:', error.message));
<?php $queryParams = [ 'api_key' => 'APIKEY', 'url' => 'https://www.scrapingdog.com', ]; $fullUrl = 'https://api.scrapingdog.com/screenshot?' . http_build_query($queryParams); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $fullUrl); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($curl); if ($response === false) { echo 'Error: ' . curl_error($curl); } else { file_put_contents('screenshot.png', $response); echo 'Screenshot saved as screenshot.png'; } curl_close($curl);
require 'net/http' require 'uri' uri = URI('https://api.scrapingdog.com/screenshot') uri.query = URI.encode_www_form( 'api_key' => 'APIKEY', 'url' => 'https://www.scrapingdog.com' ) response = Net::HTTP.get_response(uri) if response.code.to_i == 200 File.open('screenshot.png', 'wb') { |f| f.write(response.body) } puts 'Screenshot saved as screenshot.png' else puts "Error: #{response.code} - #{response.message}" end
import java.io.*; import java.net.*; public class Main { public static void main(String[] args) throws Exception { String url = "https://api.scrapingdog.com/screenshot?api_key=APIKEY&url=https://www.scrapingdog.com"; HttpURLConnection conn = (HttpURLConnection) new URL(url).openConnection(); conn.setRequestMethod("GET"); if (conn.getResponseCode() == 200) { try (InputStream is = conn.getInputStream(); FileOutputStream fos = new FileOutputStream("screenshot.png")) { int b; while ((b = is.read()) != -1) fos.write(b); } System.out.println("Screenshot saved as screenshot.png"); } else { System.out.println("Error: " + conn.getResponseCode()); } conn.disconnect(); } }