Use Browshot’s Python client, BrowshotClient, to request a website screenshot. For a short, blocking workflow, call simple() and save the returned PNG bytes in binary mode. For explicit status checks or more control over the capture, use the full API: create the screenshot, poll until it finishes or errors, then retrieve the image.
Install and configure Browshot’s Python client
Browshot is a hosted screenshot service; its Python package is a client for the service, not a browser that runs locally. Follow the installation instructions on the official Browshot Python library page, then initialize BrowshotClient with your API key. Keep the key out of source control; load it from an environment variable or another secret store rather than hard-coding it in a committed file.
As an Amazon Associate I earn from qualifying purchases.
Browshot’s documentation warns that running its examples can consume credits. Requests to private and shared instances require a positive balance according to its API documentation; check your account and instance requirements before making a request.
Recommended Free Tools
Take and save a screenshot with the simple API
The simple client method is the shortest route: it blocks until the capture completes or fails, and returns a response containing a code and PNG data. Check the code before writing the bytes so an error response is not mistaken for an image.
#1 Best Overall
from browshot import BrowshotClient
client = BrowshotClient("YOUR_API_KEY")
result = client.simple("https://example.com", {})
if result.get("code") == 200 and result.get("png"):
with open("screenshot.png", "wb") as image_file:
image_file.write(result["png"])
else:
raise RuntimeError(f"Browshot screenshot failed: {result}")
Replace YOUR_API_KEY with your secret key and the example URL with the page you want to capture. The library documentation also shows a simple_file helper that writes to a named file and reports the path on success; check its current method signature in the library page for the package version you install.
Use the full API when you need status handling or capture options
The full workflow separates creation, status checking, and image retrieval. That makes the capture state explicit and gives you a place to inspect an error before trying to save an image. Browshot’s Python library documents the sequence below. Confirm method signatures against the current library release before using it in production; the published examples include older-style syntax.
Rank #2
import time
from browshot import BrowshotClient
client = BrowshotClient("YOUR_API_KEY")
created = client.screenshot_create("https://example.com", {})
screenshot_id = created["id"]
status = created.get("status")
while status not in ("finished", "error"):
time.sleep(1)
info = client.screenshot_info(screenshot_id)
status = info.get("status")
if status == "error":
raise RuntimeError(f"Browshot screenshot failed: {info.get('error', info)}")
image_bytes = client.screenshot_thumbnail(screenshot_id)
with open("screenshot.png", "wb") as image_file:
image_file.write(image_bytes)
The documented API endpoints are /api/v1/screenshot/create, /api/v1/screenshot/info, and /api/v1/screenshot/thumbnail. In the Python client, the corresponding methods are screenshot_create(), screenshot_info(), and screenshot_thumbnail(). If the service returns an error state, inspect the error rather than attempting to treat the result as a PNG.
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallChoose size, cache, delay, and viewport settings
The API documentation describes options that affect what Browshot captures and when:
size:screencaptures the visible screen-sized area;pagecaptures the full page.cache: reuses a recent screenshot for the same URL and instance. The documentation gives a 24-hour default; setcache=0to request a fresh capture.delay: waits after page load so JavaScript can run before the screenshot. Check the exact endpoint documentation for accepted limits, which are not consistent across mirrored documentation pages.screen_widthandscreen_height: set the desktop viewport dimensions.
Other documented options include targeting a CSS selector, sending custom headers, running scripts, and saving rendered HTML. Add options to the dictionary passed to the client method, using the names and values accepted by the endpoint you use. For example, a full-page capture with a fresh result could be expressed as:
options = {
"size": "page",
"cache": 0,
}
result = client.simple("https://example.com", options)
Use a delay only when the page needs extra time after load; a longer wait can make capture slower. A cache can avoid repeating a capture when a recent result is acceptable, while disabling cache asks for a fresh screenshot.
Understand responses and avoid saving error payloads
For the simple endpoint, Browshot documents HTTP 200 as a successful PNG response, HTTP 400 as an invalid request, HTTP 404 as a capture failure with an explanatory X-Error header, and HTTP 302 as a request still in progress that should be followed. The full API uses states including in_process, finished, and error. Treat success as an image only after checking the response code or final status. Exact response handling depends on whether you use the Python client or call an endpoint directly.
Troubleshoot common Browshot screenshot problems
- Invalid request or HTTP 400: check that the URL and option names and values are valid for the endpoint. Consult the API documentation for supported parameters.
- Capture failure or HTTP 404: read the
X-Errorheader where available. The target page may be inaccessible to the capture service, or the request may have failed; do not write the error response as a PNG. - The request is still running: a 302 from the simple endpoint indicates an in-progress request to follow. With the full API, poll
screenshot_info()until the state isfinishedorerror. - Insufficient credits: check the account balance and instance requirements. Browshot’s Python documentation warns its examples may cost credits, and the API documentation says private and shared instance requests require a positive balance.
- Blank or partially rendered content: check whether the page relies on JavaScript or delayed content. Try an appropriate
delay, confirm the target is reachable, and choosepagerather thanscreenif you need the full page. - Python example does not match your installed package: the library page contains older-style sample syntax in places. Check the current package documentation for the method signatures supported by your release.
Automate interactions before capturing
If a page requires actions before it can be captured, Browshot documents an automation steps argument. Its login guide describes actions such as typing, clicking, running JavaScript, sleeping, navigating, and taking a screenshot, with CSS selectors for targeting elements. This is more involved than a simple URL capture; use it when the page genuinely requires a sequence of browser interactions. See Browshot’s login automation guide for the documented flow.
Best Value
Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request can return a PNG, JPEG, WebP, or PDF. For example, using cURL:
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp
See the ScreenshotNeo documentation for API options. It accepts cookie or consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each cleanup step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and responses identify the page verdict and billing status in headers. Its MCP server provides take_screenshot, get_page_info, and capture_pdf tools for Claude, Cursor, and other MCP clients.
The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000 screenshots. Sign up for ScreenshotNeo free.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Frequently Asked Questions
Should I use Browshot’s simple method or the full API?
Use simple() for a compact blocking capture; use the full create, status, and retrieval workflow when you need explicit state handling or greater control.
Does this Python code run the browser on my computer?
No. Browshot is a hosted screenshot service, and its Python library sends requests to that service.
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.




