
| 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=http://xkcd.com |
| viewport | WIDTHxHEIGHT | Sets the size of the virtual screen rendering the page. Default: smart width, full height | viewport=1980x1080 |
| js | true|false | Allows you to enable/disable JavaScript in the rendered Website. Default value: yes | js=false |
| fullpage | true|false | Capture the full page height instead of just the viewport. Useful for long pages and LLM analysis. Default: false | fullpage=true |
| maxheight | 1–30000 | Maximum pixel height when using fullpage=true. Default: 15000 | maxheight=20000 |
<?php
$url = 'http://www.xkcd.com';
$query = 'viewport=1200x330&url='.rawurlencode($url);
$img="https://http2pic.haschek.at/api/?$query";
echo "<img src='$img' />";
<?php
$targeturl = 'http://www.xkcd.com';
$url = 'https://http2pic.haschek.at/api/?url='.rawurlencode($targeturl);
$ch = curl_init($url);
$fp = fopen('xkcd.jpg', 'wb');
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_exec($ch);
curl_close($ch);
fclose($fp);