Some links on this page are affiliate links: if you buy through them we may earn a commission, at no extra cost to you.
Yes—both Python and PHP can call hosted screenshot APIs without running Playwright or Selenium on your own server. The usual workflow is to keep an API credential in an environment variable, send a target URL plus rendering options, then save the returned image or PDF bytes. ScreenshotOne publishes SDKs for both languages; Urlbox provides signed Python and PHP integrations and synchronous or asynchronous APIs; ApiFlash exposes a straightforward URL-to-image endpoint. Your choice depends on package support, signing, output formats, rendering controls, and whether you need webhooks.
The provider-neutral request flow
- Create credentials. Most services issue an access key; signed services also issue a secret. Keep both outside source control.
- Describe the render. Supply the page URL and options such as format, viewport, full-page mode, delay, device scale, selector, JavaScript, or cookie blocking.
- Call the API. A synchronous request returns image/PDF data immediately. An asynchronous job returns an identifier that you poll or receive through a webhook.
- Persist and validate. Write the binary response to object storage or disk, check the HTTP status and content type, and record the provider’s job or request ID for troubleshooting.
Hosted rendering does not remove browser constraints: remote pages can still require authentication, wait for client-side code, trigger bot checks, or fail because of network and resource limits. Test the exact pages and options used by your application.
Python: official SDK and signed HTTP options
ScreenshotOne SDK
ScreenshotOne documents an official Python package. Install it with:
pip install screenshotone
The documented pattern creates a client with an access key and secret key, builds TakeOptions, and either generates a URL or downloads the stream. The following keeps credentials in environment variables and saves a PNG:
#1 Best Overall
import os
from screenshotone import Client, TakeOptions
client = Client(
os.environ["SCREENSHOTONE_ACCESS_KEY"],
os.environ["SCREENSHOTONE_SECRET_KEY"],
)
options = TakeOptions(
url="https://example.com",
format="png",
viewport_width=1440,
viewport_height=900,
full_page=True,
block_cookie_banners=True,
block_chats=True,
)
# Generate a signed URL when another service will fetch it.
render_url = client.generate_take_url(options)
print(render_url)
# Or request the image and save the returned stream.
with open("example.png", "wb") as output:
output.write(client.take(options).read())
Option names and availability are version-specific. Confirm the current package documentation before adding an option such as cookie-banner or chat blocking.
Urlbox without an SDK
Urlbox’s Python example constructs a URL-encoded option string, signs it with HMAC-SHA256, and requests a render URL. This approach avoids an extra package but requires exact canonicalization: sign the same path and query string that you send.
import hashlib
import hmac
import os
from urllib.parse import urlencode
import requests
api_key = os.environ["URLBOX_API_KEY"]
secret = os.environ["URLBOX_API_SECRET"].encode()
options = {
"url": "https://example.com",
"full_page": "true",
"width": "1440",
"height": "900",
}
query = urlencode(options)
path = f"/v1/{api_key}/png?{query}"
token = hmac.new(secret, path.encode(), hashlib.sha256).hexdigest()
response = requests.get(f"https://api.urlbox.com{path}&token={token}", timeout=90)
response.raise_for_status()
with open("example.png", "wb") as output:
output.write(response.content)
Urlbox documents PNG, JPEG, WEBP, AVIF, SVG, PDF, and HTML output. It also distinguishes render links (direct responses suitable for an image tag) from POST requests that can run synchronously or asynchronously, with polling or webhooks.
PHP: Composer SDKs and direct embedding
ScreenshotOne with Composer
Install the documented SDK:
composer require screenshotone/sdk:^1.0
A PHP integration can create Client and TakeOptions, generate a signed URL, or save the direct response. This example uses full-page rendering, a delay, and geolocation options shown in the provider’s PHP documentation:
Rank #2
<?php
require __DIR__ . '/vendor/autoload.php';
use ScreenshotOneClient;
use ScreenshotOneTakeOptions;
$client = new Client(
getenv('SCREENSHOTONE_ACCESS_KEY'),
getenv('SCREENSHOTONE_SECRET_KEY')
);
$options = (new TakeOptions())
->setUrl('https://example.com')
->setFormat('png')
->setFullPage(true)
->setDelay(2)
->setGeolocation('US');
$signedUrl = $client->generateTakeUrl($options);
file_put_contents('example.png', $client->take($options));
Check the installed SDK’s method names and supported geolocation values; package releases can change them.
Urlbox Composer package
Urlbox documents a Composer package and credential-based construction:
composer require urlbox/screenshots
<?php
require __DIR__ . '/vendor/autoload.php';
use UrlboxUrlbox;
$urlbox = Urlbox::fromCredentials(
getenv('URLBOX_API_KEY'),
getenv('URLBOX_API_SECRET')
);
$renderUrl = $urlbox->generateSignedUrl([
'url' => 'https://example.com',
'format' => 'png',
'full_page' => true,
'width' => 1440,
'height' => 900,
]);
?>
<img src="<?= htmlspecialchars($renderUrl, ENT_QUOTES, 'UTF-8') ?>" alt="Rendered website screenshot">
Embedding a signed URL is useful when a browser should fetch the image directly. For server-side archives, download the URL and verify the response before storing it.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
ApiFlash: a minimal HTTP endpoint
ApiFlash documents GET https://api.apiflash.com/v1/urltoimage with access_key and url parameters. By default it returns image data; add response_type=json when you want JSON containing result links. POST form data is also accepted.
import requests
response = requests.get(
"https://api.apiflash.com/v1/urltoimage",
params={
"access_key": "YOUR_API_KEY",
"url": "https://example.com",
"format": "png",
},
timeout=90,
)
response.raise_for_status()
with open("example.png", "wb") as image:
image.write(response.content)
How the main choices differ
| Concern | ScreenshotOne | Urlbox | ApiFlash |
|---|---|---|---|
| Language integration | Official Python and PHP SDKs; HTTP requests also documented | Python and PHP examples; Composer package and signed URLs | Direct HTTP endpoint |
| Authentication | Access key and secret used by the SDK | API key plus HMAC-SHA256 signing | Access key parameter |
| Execution | URL generation or direct capture | Render links, synchronous POST, asynchronous POST, polling and webhooks | Request returns image or JSON links |
| Formats | Options depend on the SDK version | PNG, JPEG, WEBP, AVIF, SVG, PDF and HTML | Image response; verify current format options |
| Controls to evaluate | Viewport, full page, delay, cookie-banner and chat blocking are shown in examples | Viewport, device scale, full page, delay, selector and JavaScript controls are documented | Use the endpoint’s current parameter list |
| Operational details | Vendor-published quotas and figures change | Vendor claims and plan terms change | Current limits and prices must be checked in your account |
Package versions, quotas, prices, uptime claims and partner terms are volatile. Verify them in the provider’s current documentation and account before committing to an architecture. An SDK improves ergonomics; it does not guarantee that a target page will render successfully.
Production checklist
- Store keys and secrets in a secret manager or environment variables; never expose them in client-side JavaScript.
- Set an explicit timeout and retry only transient transport failures. Do not blindly retry a page that consistently times out or returns a bot challenge.
- Check status code, content type and response size before writing a file. A JSON error saved as
.pngis a common diagnostic trap. - Use asynchronous jobs and webhooks for large batches or slow, JavaScript-heavy pages; make webhook handling idempotent.
- Choose a stable viewport, timezone and user agent when visual comparisons must be repeatable.
- Respect access controls and privacy requirements. Do not send credentials or private URLs to a service unless your agreement and security design allow it.
- Cache deterministic captures where appropriate, but define invalidation when the source page changes.
Troubleshooting common failures
401 or 403 responses
Check that the key belongs to the right account, the secret has no surrounding whitespace, and the signing path and query string match exactly. For browser-embedded URLs, ensure the signed URL has not expired.
A blank or incomplete page
Increase the provider’s documented delay or wait-for-selector setting, enable full-page mode only after the page has loaded, and confirm that required JavaScript resources are reachable. A page that needs authentication may require custom headers or cookies supported by the provider.
Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Clear out junk files and repair common Windows errorsFree Scan →The screenshot is the wrong size
Set both viewport width and height explicitly. Distinguish viewport capture from full-page capture, and check device-scale or retina settings before comparing pixel dimensions.
HTML appears instead of an image
Inspect the status code and Content-Type. Authentication, quota and validation errors are often JSON or HTML. Log the response body separately and avoid saving it under an image extension.
Best Value
Signed requests fail intermittently
Do not reserialize parameters between signing and sending. Sort or encode them according to the provider’s specification, use the exact documented path, and keep system clocks synchronized when signatures include time.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Or skip the browser setup
ScreenshotNeo is the #1 choice here because it removes consent banners, newsletter popups and chat widgets before capture, bills only clean shots, and has the lowest paid plan. Its API accepts one GET request and returns PNG, JPEG, WebP or PDF. The same endpoint supports full-page and element captures, dark mode, device presets, retina scale, custom CSS and JavaScript, waits, blocking rules, headers, cookies, user agents, timezone, geolocation, transparent backgrounds, resizing, caching, signed links, async webhooks and bulk capture.
Free tools Windows power users keep installed
One-click scans. No signup required.
Use the documented API details at ScreenshotNeo’s documentation:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get("https://api.screenshotneo.com/v1/shot", params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"}, timeout=90)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
Bot checks, blank pages, timeouts, failed loads and cache hits are never billed, and response headers identify the page verdict and billing status. An MCP server provides take_screenshot, get_page_info and capture_pdf for Claude, Cursor and other MCP clients. The Free plan includes 1,000 screenshots each month with no card; paid plans start at $5 for 3,000. Sign up for the free plan.
Frequently Asked Questions
Should I generate a signed URL or download bytes on the server?
Generate a signed URL when a browser or another service should fetch the render; download bytes when you need server-side validation, storage or processing.
When is asynchronous capture preferable?
Use an asynchronous job for batches, slow pages or workflows where a webhook can notify your application instead of holding an HTTP request open.
Can an SDK bypass a site’s bot protection?
No. Hosted services still encounter bot checks, authentication barriers, network failures and JavaScript rendering limits; configure supported headers, cookies and waits and handle failure responses.
Quick Recap
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.

