DriversRecommendedOutdated drivers can make a good PC feel brokenScan driver issues before chasing fixes manually.Scan NowOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk6 min

How to Call the URL2PNG API from Python

A practical Python guide to URL2PNG v6 request signing, screenshot options, downloading image bytes, cache behavior, and common errors.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

URL2PNG’s v6 API can be called from Python by URL-encoding the request parameters, creating an MD5 token from that exact encoded query string plus your secret, and placing the API key and token in the request path. The example below builds the signed URL with Python’s standard library; it returns a URL you can open or pass to an HTTP client to download the screenshot.

What you need before making a request

  • A URL2PNG API key and secret from your account. The key identifies the account; the secret is used to sign requests. Keep the secret in server-side configuration or an environment variable rather than exposing it in client-side code.
  • Python 3, with no third-party packages needed for URL construction and signing.
  • A target page URL and the capture options you want to use.

The v6 authentication format and Python example are documented in the URL2PNG Quickstart Guide. Use the provider’s SSL endpoint where it is available for your account or plan; the plans page lists SSL as a feature: URL2PNG plans.

Build and sign a URL2PNG request in Python

This runnable example uses the standard-library urllib.parse and hashlib modules. Set the two environment variables before running it. It prints the signed PNG URL; it does not download the image.

import hashlib
import os
from urllib.parse import urlencode

API_KEY = os.environ["URL2PNG_API_KEY"]
SECRET = os.environ["URL2PNG_SECRET"]

params = {
    "url": "https://example.com/",
    "fullpage": "true",
    "thumbnail_max_width": 800,
    "unique": "20261003-001",
    "viewport": "1280x1024",
}

# Encode once, then use this identical string for signing and transmission.
query_string = urlencode(params)
token = hashlib.md5((query_string + SECRET).encode("utf-8")).hexdigest()
request_url = f"https://api.url2png.com/v6/{API_KEY}/{token}/png/?{query_string}"

print(request_url)

Replace https://example.com/ with the page to capture. The URL path follows the documented v6 pattern: API key, token, then /png/? and the encoded parameters. The token is the lowercase MD5 hex digest of the encoded query string followed by the secret.

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

Why the exact query string matters

Sign the query string that you actually send. URL encoding changes how values such as spaces and punctuation are represented, and changing parameter order or encoding after generating the token can cause authentication to fail. This example computes query_string once and appends that same string to the request URL.

Do not rebuild the query with a second encoding step or add, remove, or reorder parameters after signing. If you add a parameter, add it to params before calling urlencode.

Send boolean and zero values deliberately

The URL2PNG quickstart’s Python example filters falsey values when building parameters. That can accidentally omit explicit values such as fullpage=False or delay=0. In the example above, values are included as supplied, so an explicit false setting can be sent as a string:

Rank #2
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
  • 1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core
  • 4GB DDR4 System Memory; 128GB Solid State Drive
  • 11.6" HD (1366 x 768) Multi-Touch Display
  • Combo headphone/microphone jack - Noble Wedge Lock slot - HDMI; 2 USB 3.1 Gen 1
  • Windows 11 Pro
params["fullpage"] = "false"

Choose the provider’s accepted spelling for each option and keep it in the signed query string. Do not rely on Python truthiness to decide whether an option should be transmitted.

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

Download the screenshot bytes

The signed URL can be retrieved with an HTTP client. For example, install requests with python -m pip install requests, then use:

import requests

response = requests.get(request_url, timeout=90)
response.raise_for_status()
with open("screenshot.png", "wb") as image_file:
    image_file.write(response.content)

This download step assumes the API returned a successful image response. Check the response status and content before treating the body as an image; an unsuccessful API response may instead contain diagnostic text or an error page.

Rank #3
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
  • 256 GB SSD of storage.
  • Multitasking is easy with 16GB of RAM
  • Equipped with a blazing fast Core i5 2.00 GHz processor.

Choose the capture options that match the page

URL2PNG’s quickstart describes these relevant v6 parameters and behaviors:

Parameter Purpose and documented behavior
fullpage Set to true to ask for the entire document canvas. The documented default is viewport-only (false).
viewport Sets the viewport dimensions. The advanced-options documentation gives an API default of 1480x1037. The sample Python function uses 1280 by 1024 as its own default, which is a sample choice, not the API default.
thumbnail_max_width Constrains the rendered screenshot width.
unique Varies the request identity to request a fresh screenshot rather than reuse cached output. The docs suggest a timestamp.
custom_css_url Injects CSS loaded from a URL.
say_cheese Delays capture until a named element is available.
delay Adds a fixed delay after document readiness and assets load.
accept_languages Customizes the accepted language header.
user_agent Customizes the user-agent header.
ttl Sets screenshot time to live. The documented default is 2,592,000 seconds (30 days).

See the Quickstart Guide for the full documented parameter syntax. If the capture must reflect current page content, use a changing unique value; otherwise a cached result may be returned.

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

Cache behavior, usage, and plans

According to URL2PNG’s plans FAQ, a newly generated screenshot counts as one render, while loading a cached screenshot does not count against the plan. The FAQ says screenshots are cached for 30 days by default and that the TTL can be adjusted. This means request volume and billable fresh-render volume may differ when the same request is served from cache.

Rank #4
15.6 Inch Laptop Computer, N4020, 4GB DDR4 RAM, 128GB eMMC,with Windows 11
  • EFFORTLESS EVERYDAY PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 Home system, delivering reliable, low-power efficiency for daily tasks like document editing, email, online classes, and web browsing
  • 15.6-INCH FULL HD DISPLAY: Enjoy immersive visuals on the 15.6" FHD (1920x1080) anti-glare screen with micro-edge bezels. Delivers clear details and comfortable viewing for long study sessions, working on spreadsheets, and video playback
  • RESPONSIVE MULTITASKING & STORAGE: Built with 4GB LPDDR4 RAM and 128GB eMMC storage for smooth daily essential use. Expand your storage by up to 1TB via the integrated TF card slot to easily store movies, photos, and working files
  • ADVANCED CONNECTIVITY: Outfitted with 2x Full-Featured Type-C ports for data transfer, fast charging, and dual-monitor output, alongside 2x USB 3.2 Gen1 ports and a 3.5mm audio jack for complete peripheral compatibility
  • LIGHTWEIGHT & SILENT OPERATION: Slim and portable for effortless travel or commuting. Features a 1MP HD webcam for remote meetings, 38Wh battery with 45W Type-C fast charging, and a fanless silent design for peaceful work environments.

The following are vendor-listed monthly plan details on the URL2PNG plans page, checked October 3, 2026. Pricing and allowances can change; confirm the current terms before budgeting.

Plan Monthly fresh screenshots Monthly price Additional screenshot price Workers Support
Bootstrapped 5,000 $29 $0.006 each 10 Email
Traction 20,000 $99 $0.005 each 15 Email
Killinit 50,000 $199 $0.004 each 35 Priority
Enterprise Unlimited workers and screenshots listed Contact-based details Not stated Unlimited Premium support; annual billing listed

These are URL2PNG’s published figures, not independent pricing estimates. The same page lists SSL endpoint availability as a feature. Source: URL2PNG plans.

Or skip the browser setup

If you need a screenshot without building and maintaining the capture request yourself, ScreenshotNeo provides a one-request screenshot API and an MCP server for AI agents. Its API can return PNG, JPEG, WebP, or PDF output.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Best Value
Sale
15.6 Inch Win 11 Laptop Computer, N4020, 4GB DDR4 RAM, 128GB Storage
  • WINDOWS 11 | STABLE PERFORMANCE: Powered by Intel Celeron N4020 processor and Windows 11 system, this laptop delivers stable performance for everyday computing tasks. It supports web browsing, online learning, document editing, email communication, and basic office work with optimized power efficiency, providing a practical and reliable experience for essential daily use for daily use.
  • 15.6” FHD IPS DISPLAY: Features a 15.6-inch Full HD IPS display with narrow bezels, offering wider viewing angles and clearer image details compared to standard panels. The improved screen-to-body ratio enhances visual experience for study, reading, document work, and video playback, making it suitable for both productivity and entertainment use.
  • 4GB DDR4 + 128GB eMMC STORAGE: Equipped with 4GB DDR4 memory and 128GB eMMC storage for everyday basics such as browsing, documents, email, and online learning platforms. The built-in TF card slot supports storage expansion up to 1TB, giving you more flexibility for files, photos, videos, and daily documents. TF card not included.
  • CONNECTIVITY & PORTS: Includes 1× TF card slot, 2× USB 3.2 Gen1 ports, and 2× full-featured Type-C ports (USB 3.2 Gen1). The Type-C ports support data transfer, charging, and video output, enabling flexible connection with external devices such as monitors, storage, and peripherals for daily work and study use.
  • LIGHTWEIGHT DESIGN | ONLINE COMMUNICATION: Designed with a slim, portable profile, this laptop is easy to carry for school, commuting, and travel. A built-in 1MP front camera supports online classes, video meetings, remote communication, and everyday conferencing. The 3300mAh battery works with the low-power system design to support practical daily use, while thermal optimization helps maintain quieter operation during extended tasks.

cURL example (see the ScreenshotNeo API documentation for request options):

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

ScreenshotNeo accepts cookie and consent banners and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and each response identifies the page verdict and billing status in headers. An MCP server offers take_screenshot, get_page_info, and capture_pdf for Claude, Cursor, and other MCP clients. The Free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000 screenshots.

Sign up for ScreenshotNeo’s free plan.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common request problems

Authentication or invalid-token response

  • Confirm that the token uses the complete URL-encoded query string followed by the secret, with no separator inserted between them.
  • Make sure the encoded query in the URL is exactly the one used to calculate the token.
  • Check that the API key and secret belong together and that the secret has not been accidentally trimmed or replaced.

Unexpected default capture or missing option

  • Check that the option appears in the final query string, not just in the Python dictionary.
  • Avoid filtering parameters by truthiness if you need to transmit explicit false or zero values.
  • Remember that viewport-only capture is the documented default; set fullpage=true when you want the full document canvas.

Old screenshot returned

The plans FAQ describes caching, with a 30-day default TTL. To request a new capture, vary unique (for example, use a timestamp) and sign the updated query string again.

Screenshot is cut off or content is missing

  • Set the viewport intentionally; the API documentation’s default is 1480×1037, while the sample function’s 1280×1024 is merely its own default.
  • For a page whose content appears after initial readiness, use say_cheese to wait for a named element or delay to add a fixed post-readiness wait.
  • For content that extends beyond the viewport, request full-page capture.

Python raises an environment-variable error

os.environ["URL2PNG_API_KEY"] and os.environ["URL2PNG_SECRET"] raise an error if the variables are not set. Define both in the process environment, or replace those lines with a secure server-side configuration source. Avoid committing the secret to a repository.

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

Security and operational notes

  • Keep the signing secret on a trusted server. Anyone who obtains it can create signed requests under the associated account.
  • Use the SSL endpoint where it is available for your plan so the request is sent over HTTPS.
  • Use an explicit timeout when downloading images, and handle HTTP errors instead of saving every response body as a PNG.
  • Account for cache hits separately from fresh renders when estimating usage, since URL2PNG says cached loads do not count as new renders.

Frequently Asked Questions

Does URL2PNG’s Python example download the screenshot?

No. The documented Python snippet constructs and returns the request URL; use an HTTP client such as Requests to retrieve the image bytes.

Can I use Python’s standard library for signing?

Yes. The v6 signing example uses the standard-library `urllib.parse` and `hashlib` modules.

Quick Recap

Bestseller No. 1
HP 14' HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
HP 14" HD Laptop, Windows 11, Intel Celeron Dual-Core Processor Up to 2.60GHz, 4GB RAM, 64GB SSD, Webcam, Dale Pink (Renewed)
14" diagonal, 1366x768 resolution, HD BrightView LED, Glossy NON-TOUCH Display
$249.99
Bestseller No. 2
Dell Latitude 3190 11.6' HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
Dell Latitude 3190 11.6" HD 2-in-1 Touchscreen Laptop Intel N5030 1.1Ghz 4GB Ram 128GB SSD Windows 11 Professional (Renewed)
1.1 GHz (boost up to 2.4GHz) Intel Celeron N5030 Quad-Core; 4GB DDR4 System Memory; 128GB Solid State Drive
Bestseller No. 3
Dell Latitude 5420 14' FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
Dell Latitude 5420 14" FHD Business Laptop Computer, Intel Quad-Core i5-1145G7, 16GB DDR4 RAM, 256GB SSD, Camera, HDMI, Windows 11 Pro (Renewed)
256 GB SSD of storage.; Multitasking is easy with 16GB of RAM; Equipped with a blazing fast Core i5 2.00 GHz processor.
$304.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.

Leave a Reply

Your email address will not be published. Required fields are marked *

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

More from the Wire

  1. Shenzhen desk3 min
    HONOR Expands Beyond Smartphones With Humanoid Robot RevealHONOR said it unveiled its first humanoid robot at MWC 2026 and named shopping assistance, workplace inspections, and supportive companionship as intended uses. Later Robotics D1 claims and a reported…
  2. Cupertino desk5 min
    Apple Unveils AirPods Max 2: The Upgrade That Should Have Happened Years AgoAirPods Max 2 adds H2-powered audio features and Apple claims up to 1.5× more effective ANC, but its design, Smart Case, and 20-hour battery rating are unchanged. Wired lossless audio…
  3. Cupertino desk4 min
    Apple’s OLED Touch MacBooks Are Coming—but the Dynamic Island Is the Real GambleApple has not announced an OLED touchscreen MacBook, but reports point to high-end models arriving in late 2026 or early 2027. The reported Mac Dynamic Island could be useful, but…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.