1. Go to this page and download the library: Download hqapi/hqapi-client library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
hqapi / hqapi-client example snippets
use HQAPI\ScreenshotClient;
use HQAPI\Exceptions\ApiException;
try {
$response = $client->create(
url: "https://hqapi.com/",
theme: "dark",
full_page: true
);
// Get raw content (image data)
$imageData = $response->getContent();
// Save to disk
file_put_contents("screenshot.png", $imageData);
echo "Screenshot saved successfully!";
} catch (ApiException $e) {
echo "API error: " . $e->getMessage();
}