Skip to main content

Webpage screenshots

How to take a screenshot of the webpage.

url param

url (string, required) - The full URL of a public webpage, e.g., https://httpbin.org. This refers to a complete URL for a public webpage. If provided, it will supersede the html parameter and produce a screenshot of the specified URL.

ms_delay param

ms_delay (number, optional) - Additional delay to ensure completion of JavaScript execution. This option is useful if you encounter blank images while using JavaScript. The default setting is 100, but you can begin with a 500-millisecond delay if necessary.

import requests

api_key = 'YOUR_API_KEY'
base_url = 'https://api.canvasflare.com/screenshot'
params = {
'api_key': api_key,
'url': 'https://httpbin.org',
'ms_delay': 500
}

response = requests.get(base_url, params=params)
if response.status_code == 200:
print('Image created:', response.json())
else:
print('Error creating image:', response.text)