Fork me on GitHub



Give it a try!

How the API works[OPTIONS]&url=[WEBSITE_URL]


Option Values Description Example
url http://.. The URL of the webpage you'd like to take a screenshot of. Make sure to encode the URL! url=
width WIDTH Resizes the screenshot to a specified maximum width. Default value is the original size width=400
viewport WIDTHxHEIGHT Sets the size of the virtual screen rendering the page. Default: smart width, full height viewport=1980x1080
js yes|no Allows you to enable/disable JavaScript in the rendered Website. Default value: yes js=yes
type jpg|png Sets the output file format of the rendered screenshot. Default value: jpg type=png
onfail [url of .jpg] If the page can't be reached, this image will be displayed instead
ondomainfail [url of .jpg] If the web server can't be reached, this image will be displayed instead
cache [any alphanumeric string] If provided, caches the rendered image (based on the URL) so it loads faster on next request. The same cache id with the same url will return the cached image. Change cache id to re-render f01d0


Simple link via img tag

    $url = '';
    $query = 'type=jpg&viewport=1200x330&url='.rawurlencode($url);

    echo "<img src='$img' />";

Proxy script to download the image via curl

    $targeturl = '';
    $url = ''.rawurlencode($targeturl);
    $ch = curl_init($url);
    $fp = fopen('xkcd.jpg', 'wb');
    curl_setopt($ch, CURLOPT_FILE, $fp);
    curl_setopt($ch, CURLOPT_HEADER, 0);