Driver FixRecommendedSound, Wi-Fi or graphics acting up? Check drivers firstFind missing or outdated drivers fast.Check DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsWindows FixRecommendedWindows errors stealing your time? Find the fix fastScan stability, cleanup and performance issues.Fix Now×
Skip to content
API Development

Screenshot API Result Retrieval Methods: Bytes, URLs, Jobs, Webhooks, and Base64

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

A screenshot API can return the image file itself, a JSON object containing a hosted image URL, an asynchronous job to poll, a webhook callback, or base64-encoded image data. Check the endpoint’s documented response mode before writing a decoder: inspect the HTTP status and Content-Type, then save bytes, download a URL, poll a job, verify a callback, or decode base64 as appropriate. There is no universal screenshot API response format.

First identify how the API delivers the result

“Get the screenshot back” can mean several different things. Some endpoints finish rendering during the request and return file bytes in the response body. Others return JSON containing a hosted URL, accept a job and provide an ID to poll, or send a completed result to your webhook. A JSON-friendly endpoint may instead place base64 data in a response. The provider’s contract determines what to do next.

Delivery pattern What the initial response gives you What your client does
Synchronous raw bytes The image or PDF in the response body Check status and content type, then write the body as bytes
Hosted URL JSON with a screenshot URL, or a redirect Extract or follow the URL and download the file
Asynchronous job A job ID and polling URL Poll until a documented terminal status, then use the result URL
Webhook An acknowledgement or render identifier Receive and verify the completion callback, then process its result
Base64 Text-encoded image data Decode the data before saving the file

Do not decide how to parse a response from the product category alone. For example, ScreenshotEngine documents direct file bytes, while Screenshot API documents a hosted URL and a redirect option; Cloudflare Browser Rendering documents a binary-or-base64 encoding choice. The relevant API references are ScreenshotEngine’s quickstart, its parameter reference, Screenshot API’s documentation, and Cloudflare Browser Rendering’s screenshot endpoint documentation.

Save a synchronous raw-byte response

With a raw-byte endpoint, the successful response body is the file—not JSON containing a download link. ScreenshotEngine documents HTTP 200 with raw file bytes on success and says there is no job ID, polling step, or download URL to extract from JSON. Its parameter reference lists image/jpeg, image/png, image/webp, application/pdf, and video/webm as successful response types. Check the selected endpoint’s own format options; do not assume every listed provider supports every type.

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

Safe retrieval sequence

  1. Send the request using the provider’s documented authentication and capture parameters.
  2. Check the HTTP status before treating the response as an image. Error responses may contain JSON or another diagnostic body.
  3. Read Content-Type and map known MIME types to a suitable extension, such as image/png to .png, image/jpeg to .jpg, and application/pdf to .pdf.
  4. Write the successful response body as bytes. Avoid text decoding, which can corrupt binary data.

A small Python pattern for any raw-byte endpoint, after adapting the URL and authentication to that provider’s documentation, looks like this:

import requests

response = requests.get(
    "https://provider.example/screenshot",
    params={"url": "https://example.com"},
    timeout=90,
)
response.raise_for_status()

content_type = response.headers.get("Content-Type", "").split(";", 1)[0].lower()
extensions = {
    "image/png": ".png",
    "image/jpeg": ".jpg",
    "image/webp": ".webp",
    "application/pdf": ".pdf",
    "video/webm": ".webm",
}
extension = extensions.get(content_type)
if extension is None:
    raise ValueError(f"Unexpected successful response type: {content_type!r}")

with open("screenshot" + extension, "wb") as output:
    output.write(response.content)

The example intentionally uses a placeholder host: replace it with the endpoint and parameters documented by the service you use. Do not write an error body to a file called screenshot.png just because the request was intended to create a PNG.

Retrieve a hosted screenshot URL or redirect

Some services separate rendering from retrieval by returning JSON with a URL. Screenshot API documents a JSON response with screenshotUrl; it also documents a redirect=1 option that returns an HTTP 302 redirect to the image or PDF. With JSON mode, parse the response, validate the URL field, and make a second HTTP request to download the asset. With redirect mode, use an HTTP client configured to follow redirects, then inspect the final response status and content type.

  1. Check the initial response status and content type. Parse JSON only when the response is JSON.
  2. Read the documented URL field (for Screenshot API, screenshotUrl) rather than guessing a property name.
  3. Download the returned URL with a timeout and redirect handling. Check the download’s status before saving its bytes.
  4. Use the asset’s response content type to choose the filename extension, and follow the vendor’s retention policy for how long you store or reuse the URL.

A URL is not necessarily a permanent asset address. The available documentation does not establish one retention duration for screenshot URLs across providers, so check the selected service’s terms and avoid assuming that a saved URL will work indefinitely.

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

Poll an asynchronous render job

An asynchronous endpoint returns before the screenshot is ready. AppScreenshotAPI documents a 202 Accepted response containing an id and polling_url. Its documented flow is to request the render, poll GET /v1/renders/{id}, and stop when the status is succeeded or failed. On success, consume the returned image URLs.

  1. Submit the render request and confirm the response is the documented accepted-job response.
  2. Persist the job ID and polling URL so the work can resume if your process restarts.
  3. Poll the supplied URL using bounded backoff, respecting any rate-limit or retry guidance in the provider’s docs.
  4. Stop on the provider’s documented terminal states. On succeeded, retrieve the result URL; on failed, record the error and decide whether a corrected request should be submitted.
  5. Apply your own maximum wait or deadline. Do not poll forever if the service never reaches a terminal state.

Asynchronous rendering is useful when your application should not hold a request open while a longer render completes or when you need to manage a queue of work. It adds state management and polling or callback handling. The cited documentation establishes the flow for that service, not a common retry interval, job-retention period, or completion-time guarantee for all providers.

Receive the result through a webhook

A webhook lets the provider notify your server when a render completes instead of requiring continuous polling. Screenshot API’s guide describes a render_id, result URL, and HMAC-SHA256 signature header, but warns that callbacks are currently unavailable on that deployment. ScreenshotOne documents asynchronous requests, optional S3-compatible upload, webhook delivery, and a screenshot_url when JSON response mode is used. Treat availability and configuration as provider- and deployment-specific; do not design around a callback feature that the endpoint has not enabled.

Webhook handling safeguards

  • Verify the provider’s signature, such as the documented HMAC-SHA256 signature, against the raw request body and your secret before trusting the callback.
  • Make processing idempotent. A repeated callback for the same render should not trigger duplicate downstream work.
  • Acknowledge promptly with the 2xx response required by the provider, then queue downloading or image processing rather than doing lengthy work inside the request handler.
  • Validate the render identifier and result URL, and apply your normal download timeout and status checks.
  • Check the provider’s retry behavior and retention terms. The documentation cited here does not establish a single webhook retry or asset-retention standard.

Decode base64 returned in JSON

Cloudflare Browser Rendering exposes an encoding choice of binary or base64. Base64 can help when an intermediary accepts text but not arbitrary binary bytes. It is still an encoded file: decode it before saving, and expect the textual representation to be larger than the original binary payload.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

# encoded_image is the base64 value returned by the documented JSON response.
image_bytes = base64.b64decode(encoded_image, validate=True)
with open("screenshot.png", "wb") as output:
    output.write(image_bytes)

Use the response’s documented field and image format rather than assuming that the example variable or PNG extension applies to every endpoint. If the API returns a data URI rather than bare base64, handle its prefix according to that API’s contract before decoding.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server. A GET request returns a PNG, JPEG, WebP, or PDF; its response headers identify the page verdict and whether the request was billed. Its cleaning steps can accept cookie or consent banners and remove more than 60 known consent platforms, newsletter popups, and chat widgets before capture, and each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed. An MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.

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

For a reliable downloader, inspect the response status and headers before choosing the filename; the example saves the response to shot.webp. See the ScreenshotNeo API documentation for authentication, formats, parameters, and response handling. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 shots, and yearly billing gives two months free. Every feature is available on every plan. Sign up free for 1,000 screenshots a month with no card.

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

Troubleshooting retrieval failures

Symptom Likely cause What to check or change
The saved “image” is unreadable or looks like JSON An error response was saved as binary, or JSON mode was parsed as an image Check HTTP status and Content-Type before writing bytes; inspect the error body when unsuccessful
The file opens with the wrong application or has a misleading extension The extension was assumed rather than derived from the response Map the successful response MIME type to the file extension
The JSON response has no expected URL field The endpoint uses a different response mode or field name Check the provider’s current response schema and request mode; do not assume all APIs use screenshotUrl
A polling loop never ends The client does not stop on terminal states, or the job is stalled Stop on documented success or failure, use bounded backoff and a maximum wait, and retain the last status for diagnosis
A webhook is rejected or processes twice Signature verification is incorrect, raw-body handling differs, or delivery is repeated Follow the provider’s signature procedure and make the handler idempotent
Base64 decoding fails The response field is not bare base64, was truncated, or contains a data-URI prefix Validate the documented field and encoding; strip or parse any documented prefix before decoding
A previously stored screenshot URL no longer downloads The URL may be temporary or expired Check the vendor’s URL retention terms and download or store the asset within the allowed period

Performance, reliability, and cost implications

Raw-byte responses avoid a separate URL-download request, but the client waits for the render and transfer in one request. URL mode separates the render response from the asset download, adding a second network step. Polling introduces delay and repeated requests; webhooks avoid regular polling but require an available, secure callback handler. Base64 is convenient for text-only transports but expands the payload and requires decoding. These are architectural trade-offs, not measured speed rankings.

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.

For production use, set explicit request and download timeouts, bound retries, and log status codes, content types, job IDs, and terminal states without exposing credentials. For asynchronous work, persist enough state to resume after a restart. For callbacks, verify signatures and deduplicate events. Before choosing a provider, compare its documented delivery modes, supported formats, authentication, quotas, URL retention, webhook signing and retries, and error semantics. The cited provider documentation does not establish a cross-vendor standard for retention or retries, so verify those terms directly.

Frequently Asked Questions

Does every screenshot API return an image file?

No. Depending on the endpoint and mode, it may return raw bytes, JSON with a URL, a job resource, a webhook result, or base64 data.

Should I save a screenshot API response as text or bytes?

Save successful image or PDF response bodies as bytes. Parse JSON only when the endpoint returns JSON, and decode base64 when the documented response uses that encoding.

Do I always need to poll for a screenshot?

No. Poll only when the API returns an asynchronous job and documents a polling flow; synchronous raw-byte endpoints need no polling.

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

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.

Read next

Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

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.