Skip to main content

Screenshot

Scraping Fish API allows you to retrieve a screenshot of a webpage as a PNG image file. To do so, you need to provide the screenshot query parameter and set it to true.

note

When a screenshot is returned, no HTML content will be returned.

Example​

To get a screenshot of the website example.com, you send a request with screenshot=true query parameter.

import requests

payload = {
"api_key": "[your API key]",
"url": "https://www.example.com",
"screenshot": "true",
}

response = requests.get("https://scraping.narf.ai/api/v1/", params=payload)
with open("./screenshot.png", "wb") as f:
f.write(response.content)

The resulting website screenshot will be saved to screenshot.png.