Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To capture a website in PHP with Abstract’s Screenshot API, send an HTTPS GET request to https://screenshot.abstractapi.com/v1/ with your API key and the target URL, then save the successful response body as image bytes. Abstract describes this as a hosted REST API—not a PHP screenshot library—and the official material reviewed does not provide a PHP-specific example. The cURL implementation below shows how to make the documented request and safely handle its response.

What the Abstract Screenshot API does

Abstract’s Website Screenshot API renders a URL or submitted raw HTML and returns an image. Its product page lists JPEG, PNG, and GIF output, along with options for dimensions or viewport, custom CSS, resizing or cropping, and capture delays. These are vendor-described capabilities; check the live API reference for the current parameter names and accepted values before adding optional settings to a request. Abstract’s product page and its documentation index are the relevant starting points.

Abstract’s examples of potential uses include device QA, recurring snapshots, embedded previews, monitoring placements, and security previews. Those are examples from the vendor, not independent validation of capture quality or performance.

Make a website screenshot request from PHP

Set your Abstract API key in the server environment as ABSTRACT_API_KEY. The following is an article implementation of the documented HTTP request, not an official Abstract PHP sample. It uses PHP’s cURL extension, sends the key and target URL as query parameters, applies a timeout, checks the HTTP status and response content type, and writes the response only if it appears to be a successful image response.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
#1 Best Overall
Sale
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Auto-Light Balance: RightLight boosts brightness by up to 50%, reducing shadows so you look your best—compared to previous-generation Logitech webcams (1)
  • Privacy with a Slide: The integrated webcam cover makes it easy to get total, reliable privacy when you're not on a video call
  • Built-In Mic: The built-in microphone lets others hear you clearly during video calls
  • Easy Plug-And-Play: The Brio 101 works with most video calling platforms, including Microsoft Teams, Zoom and Google Meet—no hassle; it just works
<?php

$apiKey = getenv('ABSTRACT_API_KEY');
if ($apiKey === false || $apiKey === '') {
    throw new RuntimeException('Set the ABSTRACT_API_KEY environment variable.');
}

$targetUrl = 'https://example.com/';
$query = http_build_query([
    'api_key' => $apiKey,
    'url' => $targetUrl,
], '', '&', PHP_QUERY_RFC3986);
$endpoint = 'https://screenshot.abstractapi.com/v1/?' . $query;

$ch = curl_init($endpoint);
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_FOLLOWLOCATION => true,
    CURLOPT_CONNECTTIMEOUT => 10,
    CURLOPT_TIMEOUT => 90,
]);

$body = curl_exec($ch);
if ($body === false) {
    $error = curl_error($ch);
    curl_close($ch);
    throw new RuntimeException('Screenshot request failed: ' . $error);
}

$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$contentType = curl_getinfo($ch, CURLINFO_CONTENT_TYPE) ?: '';
curl_close($ch);

if ($status < 200 || $status >= 300) {
    throw new RuntimeException('Screenshot API returned HTTP ' . $status . ': ' . substr($body, 0, 1000));
}

$allowedTypes = ['image/jpeg', 'image/png', 'image/gif'];
$mimeType = strtolower(trim(explode(';', $contentType)[0]));
if (!in_array($mimeType, $allowedTypes, true)) {
    throw new RuntimeException('Expected an image response; received Content-Type: ' . $contentType);
}

$outputPath = __DIR__ . '/website-screenshot.' . match ($mimeType) {
    'image/jpeg' => 'jpg',
    'image/png' => 'png',
    'image/gif' => 'gif',
};

if (file_put_contents($outputPath, $body) === false) {
    throw new RuntimeException('Could not write screenshot to ' . $outputPath);
}

echo 'Saved screenshot to ' . $outputPath . PHP_EOL;

The endpoint and basic api_key and url parameters follow the request shown by Abstract. The code deliberately uses the response’s content type to choose a file extension rather than assuming an output format. Confirm that any optional output-format parameter you choose is supported by the current API reference.

Run it

  1. Enable PHP’s cURL extension and set the key in the server environment. For a local shell, for example: export ABSTRACT_API_KEY='your_key'. Avoid putting a real key in source code or browser-side JavaScript.
  2. Save the example as screenshot.php and replace https://example.com/ with the page you are authorized to capture.
  3. Run php screenshot.php. On a successful image response, the script writes a file named website-screenshot.jpg, .png, or .gif in the script’s directory.

Handle keys, errors, and image responses safely

Protect the API key

Abstract’s shown request places api_key in the query string. Keep requests server-side, restrict access to the environment variable, and avoid logging the full request URL: URLs in application, proxy, or web-server logs can expose query-string credentials. Do not return the key to a browser client.

Rank #2
Sale
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • Crisp HD 720p/30 fps video calls with diagonal 55° field of view and auto light correction. Compatible with popular platforms including Skype and Zoom.
  • The built-in noise-reducing mic makes sure your voice comes across clearly up to 1.5 meters away, even if you’re in busy surroundings.
  • C270’s RightLight 2 feature adjusts to lighting conditions, producing brighter, contrasted images to help you look good in all your conference calls.
  • The adjustable universal clip lets you attach the camera securely to your screen or laptop, or fold the clip and set the webcam on a shelf. You’re always ready for your next video call.

Distinguish transport, API, and file errors

  • cURL returns false: this indicates a transport-level failure, such as a connection or TLS problem. Check network access, certificate configuration, and the timeout, then inspect the cURL error message.
  • Non-2xx HTTP status: the API did not return a successful response. The example includes a limited portion of the body in its exception to aid diagnosis; in production, redact secrets and avoid recording sensitive target URLs.
  • Unexpected content type: do not save an error page or other non-image body with an image extension. Inspect the status and response body safely, and consult the live API documentation for expected response behavior.
  • File write failure: check the PHP process’s permissions and the destination directory. Use a controlled storage location rather than a publicly writable path.

Timeouts and operational expectations

The example uses a 10-second connection timeout and a 90-second total timeout as implementation choices, not Abstract requirements or measured service timings. A slow target, rendering delay, or network issue may exceed your application’s own request budget. For a user-facing feature, consider running captures in a background job and returning a job or status identifier to your application rather than holding an interactive request open. No independent latency or reliability test is established here.

Capture options and geographic limits

The vendor describes controls for image format, viewport or dimensions, CSS injection, resizing or cropping, and delayed capture. Raw HTML is also described as an input. Confirm the exact request syntax and values in the live documentation before relying on a particular option; the basic PHP example intentionally sends only the endpoint’s documented key and URL parameters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Sale
NexiGo N60 1080P Webcam with Microphone, Software Control & Privacy Cover, USB HD Computer Web Camera, Plug and Play, for Zoom/Skype/Teams, Conferencing and Video Calling
  • 【Full HD 1080P Webcam】Powered by a 1080p FHD two-MP CMOS, the NexiGo N60 Webcam produces exceptionally sharp and clear videos at resolutions up to 1920 x 1080 with 30fps. The 3.6mm glass lens provides a crisp image at fixed distances and is optimized between 19.6 inches to 13 feet, making it ideal for almost any indoor use.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 8, 10 & 11 / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.
  • 【Built-in Noise-Cancelling Microphone】The built-in noise-canceling microphone reduces ambient noise to enhance the sound quality of your video. Great for Zoom / Facetime / Video Calling / OBS / Twitch / Facebook / YouTube / Conferencing / Gaming / Streaming / Recording / Online School.
  • 【USB Webcam with Privacy Protection Cover】The privacy cover blocks the lens when the webcam is not in use. It's perfect to help provide security and peace of mind to anyone, from individuals to large companies. 【Note:】Please contact our support for firmware update if you have noticed any audio delays.
  • 【Wide Compatibility】Works with USB 2.0/3.0, no additional drivers required. Ready to use in approximately one minute or less on any compatible device. Compatible with Mac OS X 10.7 and higher / Windows 7, 10 & 11, Pro / Android 4.0 or higher / Linux 2.6.24 / Chrome OS 29.0.1547 / Ubuntu Version 10.04 or above. Not compatible with XBOX/PS4/PS5.

Abstract’s product FAQ says captures from different locations are not supported at present and are planned for a future version. This is a changeable limitation, so check the product page before designing a location-dependent workflow.

Abstract plan limits and price caveat

Abstract’s product page shows Free at $0 with 100 requests and a limit of 1 request per second. The Standard figures conflict across billing displays: the monthly display shows $99 per month, paid annually, with 60,000 requests per month and a 3-request-per-second limit, while the yearly display shows 60,000 requests per year. Do not assume a Standard quota from one display without checking the current pricing view and your account. Enterprise pricing is custom; the product page lists a 99.99% uptime SLA and enterprise support features. These are vendor-published plan figures, not independently audited performance results.

Rank #4
Sale
EMEET C960 1080P Webcam with Microphone, 2 Mics, 90° FOV, Computer Camera
  • 1080P Webcam with Cover for Video Calls - EMEET computer webcam provides design and Optimization for professional video streaming. Realistic 1920 x 1080p video, 5-layer anti-glare lens, providing smooth video. C960 computer camera delivers 1920x1080 video with fixed focus (11.8–118.1 inches), so as to provide a clearer image. C960 USB webcam has a cover and can be removed automatically to meet your needs for privacy. For optimal image performance, use the webcam in a well-lit environment.
  • Built-in 2 Omnidirectional Mics - EMEET webcam with microphone for desktop features 2 built-in omnidirectional microphones, picking up your voice to create clear audio for communication. When installing the webcam, select EMEET C960 as the default microphone input device in your computer and video applications and select C960 as the default device in Zoom/Teams and ensure microphone permissions are enabled for proper use. Please note that C960 does not include built-in speakers.
  • Automatic Light Adjustment - Automatic exposure adjustment is applied in EMEET HD webcam 1080p so that the streaming webcam can deliver stable image performance. EMEET C960 camera for computer also features color adjustment and exposure optimization to help you look your best. For optimal video quality, it is recommended to use the webcam in normal or well-lit environments and select suitable video settings in your application. Proper lighting helps achieve a clearer and more balanced image.
  • Plug-and-Play & Upgraded USB Connectivity - New C960 webcam features both USB Type-A & A-to-C adapter connections for wider compatibility. For stable performance, connect the webcam directly to the computer's main USB port and ensure the device is recognized correctly. If a hub or docking station is used, please ensure it provides sufficient power and stable data transmission, as limited ports may affect performance. 90° wide-angle lens captures more participants without frequent adjustments.
  • High Compatibility & Multi Application - C960 webcam for laptop is compatible with Windows 10/11, macOS 10.14+, and Android TV 7.0+. Not supported: Windows Hello, TVs, tablets, or game consoles. It works with Zoom, Teams, Facetime, Google Meet, YouTube and more. Please select C960 webcam as the default camera and microphone device in your application and ensure camera/microphone permissions are enabled, especially on macOS. (Tips: Incompatible with Windows Hello)
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Or skip the browser setup

If you want a screenshot API without setting up browser infrastructure, ScreenshotNeo is a hosted alternative. Its one-call endpoint accepts a URL and returns an image or PDF. See the ScreenshotNeo API documentation for parameters and response details.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp

ScreenshotNeo removes cookie banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are never billed. It also offers an MCP server so AI agents can take screenshots. The free plan includes 1,000 screenshots a month with no card, and paid plans start at $5 for 3,000. Sign up for ScreenshotNeo’s free plan.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

FAQ

Is there an official Abstract PHP SDK or PHP example?

The official material reviewed establishes the REST endpoint but does not provide a PHP-specific example. The cURL code above implements the documented GET request using general PHP HTTP handling.

Best Value
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
  • Compatible with Nintendo Switch 2’s new GameChat mode
  • HD lighting adjustment and autofocus: The Logitech webcam automatically fine-tunes the lighting, producing bright, razor-sharp images even in low-light settings. This makes it a great webcam for streaming and an ideal web camera for laptop use
  • Advanced capture software: Easily create and share video content with this Logitech camera that is suitable for use as a desktop computer camera or a monitor webcam
  • Stereo audio with dual mics: Capture natural sound during calls and recorded videos with this 1080p webcam, great as a video conference camera or a computer webcam
  • Full HD 1080p video calling and recording at 30 fps. You'll make a strong impression with this PC webcam that features crisp, clearly detailed, and vibrantly colored video

Can the API return a PDF?

The Abstract product material covered here describes image output, including JPEG, PNG, and GIF. It does not establish PDF output for this API.

Does Abstract sell submitted data?

Abstract’s product FAQ states that it earns revenue from API subscriptions rather than selling user data. That is the vendor’s own privacy statement; review its current privacy policy and terms for details relevant to your use.

Quick Recap

SaleBestseller No. 1
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Logitech Brio 101 Full HD 1080p Webcam for Streaming and Meetings - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Built-In Mic: The built-in microphone lets others hear you clearly during video calls
$35.90
SaleBestseller No. 2
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Logitech C270 720p Webcam Plug-and-Play Wide Screen Video Calling - Black
Compatible with Nintendo Switch 2’s new GameChat mode
$16.89
Bestseller No. 5
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Logitech C920x HD Pro PC Webcam Full 1080p/30fps Video - Black
Compatible with Nintendo Switch 2’s new GameChat mode; Fully compatible with Windows 11
$69.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.