No browser runtime to maintain
Avoid provisioning Chrome and long-running browser processes in PHP web or queue workers.
URL to PNG with PHP
No browser management required
Capture public webpages from PHP without installing Chrome, running a PHP headless-browser wrapper, or maintaining screenshot storage and delivery.
PHP workflow
Choose the URL and browser state here, then use the PHP example below instead of rebuilding the screenshot workflow locally.
Managed screenshots
Keep the application code focused on the request and response while HCTI manages Chromium, page loading, render isolation, retries, and hosted output.
Avoid provisioning Chrome and long-running browser processes in PHP web or queue workers.
Set the viewport, full-page mode, selector, timing, color scheme, and browser state as request parameters instead of browser scripts.
Receive the hosted .png result without building a separate pipeline for temporary files, uploads, storage, and delivery.
URL screenshot API
POST the webpage URL, capture settings, and format from PHP. HCTI handles the browser lifecycle and returns the generated .png URL.
Send the URL to load, including webpages whose final state depends on browser-rendered JavaScript.
Set format to png and use the hosted .png URL returned by the API.
Set viewport dimensions, capture the full page, or crop the result to a CSS selector.
Choose color scheme, timezone, mobile behavior, timing, and other page-loading controls.
How it works
Submit a public URL with format set to png and any viewport, selector, or browser settings.
The API runs the webpage, styles, fonts, images, and JavaScript in a managed browser environment.
Embed the hosted result, download the file, or save it in your own storage and application records.
Output formats
Keep the same URL and capture settings. Choose lossless detail, compact compatibility, modern web delivery, or a paginated document.
Looking to convert HTML & CSS to PNG? Explore HTML to PNG in PHPSmaller files and broad compatibility for photographic and content-heavy webpages.
Explore JPEGStrong visual quality with modern compression for web delivery.
Explore WebPPaginated webpage captures with page sizing, margins, backgrounds, and print styles.
Explore PDFExample code
Copy a complete PHP request. Authentication, the webpage URL, viewport settings, output format, and response handling are shown together.
<?php
$request = [
"url" => "https://example.com",
"format" => "png",
"viewport_height" => 630,
"viewport_width" => 1200,
];
$curl = curl_init("https://hcti.io/v1/image");
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_USERPWD => sprintf("%s:%s", getenv("HCTI_API_ID"), getenv("HCTI_API_KEY")),
CURLOPT_HTTPHEADER => ["Content-Type: application/json"],
CURLOPT_POSTFIELDS => json_encode($request, JSON_THROW_ON_ERROR),
CURLOPT_RETURNTRANSFER => true,
]);
$response = curl_exec($curl);
if ($response === false) {
throw new RuntimeException(curl_error($curl));
}
$status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
curl_close($curl);
if ($status >= 400) {
throw new RuntimeException(sprintf("HCTI request failed (%d): %s", $status, $response));
}
$result = json_decode($response, true, 512, JSON_THROW_ON_ERROR);
printf("%s\n", $result["url"]);
Ready to capture?
Send a public URL to the API and receive a hosted .png image without running browser infrastructure.