Screenshot API
With this API you can take screenshots of any page. You just have to send a GET request to https://api.scrapingdog.com/screenshot with the below-given parameters.
Each successful request to this API will cost 5 credits.
Parameters
Parameter
Description
api_key required
Your personal API key. Available on your dashboard. Type: String
url required
This is the URL of the page for which you want to take a screenshot. Type: String
fullPage
This is a boolean that tells our server to take a full-page screenshot or just the part that is visible without scrolling. Type: Boolean
API Example
curl "https://api.scrapingdog.com/screenshot?api_key=6103077e467766765f5803ed2df7bc8&url=https://www.scrapingdog.com"import requests
api_key = "6103077e467766765f5803ed2df7bc8"
url = "https://api.scrapingdog.com/screenshot"
params = {
"api_key": api_key,
"url": "https://www.scrapingdog.com"
}
response = requests.get(url, params=params)
if response.status_code == 200:
with open("screenshot.png", "wb") as f:
f.write(response.content)
else:
print("Failed to capture a screenshot.")
const axios = require('axios');
const fs = require('fs');
const apiKey = '6103077e467766765f5803ed2df7bc8';
const url = 'https://api.scrapingdog.com/screenshot';
const params = {
api_key: apiKey,
url: 'https://www.scrapingdog.com',
};
axios
.get(url, { params, responseType: 'stream' })
.then((response) => {
if (response.status === 200) {
response.data.pipe(fs.createWriteStream('screenshot.png'));
} else {
console.error('Failed to capture a screenshot.');
}
})
.catch((error) => {
console.error('Error:', error.message);
});
Response

Last updated