Skip to content

Guide

Screenshot API vs. Playwright

Use Playwright when you need to control the browser: a local or private page, an exact pixel size, a full-page image, or a click before the picture. Use a screenshot API when a public page and a named viewport are enough and you do not want to run Chromium. On this site, that API is POST /api/screenshots. It is not a general-purpose browser.

Published by
DataTuber
Published
Updated
Reading time
11 min read

Key takeaways

  • Playwright is the better fit for localhost, a scripted login, a custom width and height, or a full-page capture.
  • POST /api/screenshots is the better fit for a public https URL when desktop, tablet, or mobile is enough.
  • This page compares those responsibilities. It does not measure speed or image quality, and it does not rank other screenshot products.
  • A successful DataTuber response is image bytes. Any other status is JSON with a message. The route has no full-page field and no pixel-size field.
  • The free beta does not collect a card. No price is published. Paid plans are not available before January 1, 2027.

What Playwright does

Playwright is a browser automation library. Your program installs it, downloads a browser, launches that browser, opens a URL, and asks for an image. You choose the width and height. You can capture the viewport or the full document height. You can click, type, and wait for a selector before the screenshot.

The machine running the script is the machine that has to reach the page. Localhost and a page behind a login you can script are normal Playwright work. Chromium updates, missing system libraries, and pages that never finish loading are also yours to handle. The Node.js guide and the Python guide each contain a complete script.

What a screenshot API does

A screenshot API takes a URL over HTTP and returns an image. You do not install a browser in the program that makes the call. You do accept that service’s fields, its allowed hosts, and its failure messages.

This website’s route is POST https://datatuber.com/api/screenshots. The JSON body is url, viewport, and format. viewport is one of desktop 1280×720, tablet 768×1024, mobile 390×844. format is png or jpg. jpeg is accepted and stored as jpeg. There is no width, no height, and no full-page flag. The URL has to be public https, with no username, password, port, or IP address. Do not send the call to api.datatuber.com. That host is not this API. Screenshots is the field list. Getting started shows the body in four languages.

How this comparison was made

The Playwright column is the calls printed later on this page: launch Chromium, set a viewport, open a URL, check the navigation status, and write a PNG. This repository does not depend on Playwright. No Playwright version, operating system, or timed run is reported. The scripts were checked as Python syntax. They were not executed here, and this page does not show a captured image from them.

The API column is the route implemented in this repository, read on November 6, 2026. That includes the required JSON fields, the three viewport presets, png and jpg, the public-https URL checks, bearer authentication, an image body on success, JSON with a message otherwise, storage only when the call has a workspace, and the beta quotas in the account migration.

The rows compare what you install, who runs the browser, which URLs open, how size works, whether a full-page capture exists, whether you can click first, how a failure shows up, and what you can say about cost from published facts. Latency, uptime, visual quality, and other vendors were not compared. A blank in that sense is intentional. This is not a ranking.

Side by side

Responsibilities of Playwright compared with POST /api/screenshots on this website. Not a speed, quality, or price ranking.

Setup

Playwright
Install the library and Chromium
POST /api/screenshots
Send JSON from Python 3 or any HTTP client

Who runs the browser

Playwright
The process you operate
POST /api/screenshots
This website’s capture route

URLs

Playwright
Whatever that machine can open, including localhost
POST /api/screenshots
Public https URLs only

Size

Playwright
Any width and height
POST /api/screenshots
desktop, tablet, or mobile

Full page

Playwright
full_page=True, or fullPage in Node
POST /api/screenshots
Not a field

Clicks and logins

Playwright
You can script them before the screenshot
POST /api/screenshots
Not part of this request

Failure

Playwright
An exception in your process
POST /api/screenshots
An HTTP status and a JSON message

Stored image

Playwright
The file path you pass
POST /api/screenshots
Stored for a keyed workspace. The homepage demo is not stored.

Cost you can verify here

Playwright
You pay for the computer that runs Chromium. This page has no price for that.
POST /api/screenshots
Free beta: 100 screenshots in a UTC month for a verified account. No card and no published price.

Setup

Playwright’s setup is two installs and a long-running browser. The library from pip or npm does not include Chromium. The browser download is a second step, and it has to be repeated in each environment, including CI. The first script on the Python guide is a complete local capture. The Node guide is the same idea in JavaScript.

The API setup is an HTTP client you already have. This page’s example uses Python’s urllib. No SDK is required. A key is required only when you want the image stored on a workspace. Authentication describes the email link and the bearer token. The homepage form calls the same path with no key.

pip install playwright
playwright install chromium
python screenshot.py

Playwright’s Python install. The API example does not use these commands.

Infrastructure

With Playwright, you provide the CPU, memory, and disk for Chromium, plus the operating system libraries that browser expects. A laptop is enough for a script you run by hand. A server or a CI job is what you operate when the capture has to happen without you. You also decide how many browsers run at once, and you restart them when they leak or crash.

With this route, the calling program only needs to make an HTTPS request. The browser does not run in that program. You do not patch Chromium there. You do live with the route’s limits, and with a failure mode you see only as an HTTP response. If the deployment has no capture credentials, the message is "Screenshot capture is not configured on this server."

Scaling

Playwright scales by adding machines or by running fewer browsers per machine. Each capture holds a browser process. This page does not state how many captures fit on a given server, because that was not measured. What you can plan for is the shape of the work: concurrent pages mean more memory, and a page that never goes idle can occupy a browser until your timeout fires.

This route scales inside the limits implemented for the beta. A verified workspace can take 100 screenshots in a UTC month and 6 requests a minute. Every capture, keyed or not, also waits on a shared 11 second gap. The homepage demo, which sends no key, allows 5 captures an hour for a hashed IP. Those numbers are quotas, not a measurement of how fast a picture comes back. Past them, the route returns 429 and asks you to wait.

Reliability and maintenance

Playwright fails in your process. A missing browser, a navigation timeout, a certificate error, and a blank image are all visible where the script runs. You choose when to update Playwright and Chromium. You also own the fixes when a site changes and your selector or your wait is wrong.

This route fails as HTTP. Success is image/png or image/jpeg. Anything else is JSON. "Send a URL, viewport, and format." means the body was not one of the accepted shapes. A network refusal is HTTP 403 with error.code URL_SECURITY_BLOCKED. The message does not name the blocked address. Content-policy and review results are described on the Content Safety Policy. You do not maintain the browser. You also cannot change its wait, its pixel size, or its full-page behavior, because those are not request fields.

Neither column is a promise of uptime. This page does not report an error rate for Playwright or for the capture route.

Cost

Playwright’s library is free to install. The cost you actually pay is the computer that runs the browser: a developer machine, a CI minute, or a server you keep online. This page has no figure for that, because it depends on your host and it was not measured here.

DataTuber’s beta does not collect a card. A verified account’s allowance is 100 screenshots in a UTC month. Pricing has no checkout and no published price. Paid plans are not available before January 1, 2027. Do not read a dollar amount into this comparison. None is stated because none is on sale.

When Playwright is the better fit

Use Playwright when any of these are true. The page is localhost, an IP address, or a private host. You need a width and height that are not 1280×720, 768×1024, or 390×844. You need the full document height, or one element, rather than the viewport. Someone has to log in, dismiss a dialog, or wait for a selector before the picture is meaningful. You already run Playwright for tests, and the screenshot is one more step in that run.

Those are the cases this website’s route cannot cover. Picking Playwright there is not a criticism of the API. It is the tool that has the missing control. Replace example.com in the script with your own URL, including http://127.0.0.1 and a port, when the page is on your machine.

from playwright.sync_api import sync_playwright

with sync_playwright() as playwright:
    browser = playwright.chromium.launch()
    page = browser.new_page(viewport={"width": 1280, "height": 720})
    try:
        response = page.goto(
            "https://example.com",
            wait_until="load",
            timeout=30_000,
        )
        if response is None or not response.ok:
            status = response.status if response else "no response"
            raise RuntimeError(f"Navigation failed ({status}).")
        page.screenshot(path="full-page.png", type="png", full_page=True)
    finally:
        browser.close()

Save as screenshot.py. It captures the full document height of example.com. It does not call DataTuber. Point goto at a local URL when that is the page you need.

When the API is the better fit

Use POST /api/screenshots when the page is already on the public web, a named viewport is enough, and you do not want Chromium in that program. A short script in a language that can send HTTP, a backend that should not carry a browser, and a workspace where the image should be stored for later are the ordinary fits.

It is the wrong tool when you need the exceptions in the previous section. Do not send localhost to it. Do not send a pixel size. Do not expect a full-page image. The Python guide requests desktop and mobile in one file. The script below is the desktop call with the status check.

import json
from pathlib import Path
from urllib.error import HTTPError, URLError
from urllib.request import Request, urlopen

request = Request(
    "https://datatuber.com/api/screenshots",
    data=json.dumps(
        {
            "url": "https://www.python.org",
            "viewport": "desktop",
            "format": "png",
        }
    ).encode(),
    headers={
        "Authorization": "Bearer YOUR_API_KEY",
        "Content-Type": "application/json",
    },
    method="POST",
)
try:
    with urlopen(request) as response:
        content_type = response.headers.get("Content-Type", "")
        if not content_type.startswith("image/"):
            raise RuntimeError("Expected an image, got " + (content_type or "no content type") + ".")
        Path("desktop.png").write_bytes(response.read())
except HTTPError as error:
    raw = error.read().decode("utf-8", errors="replace")
    try:
        payload = json.loads(raw)
    except json.JSONDecodeError:
        payload = None
    message = payload.get("message") if isinstance(payload, dict) else None
    if not isinstance(message, str):
        message = "HTTP " + str(error.code)
    raise RuntimeError(message) from error
except URLError as error:
    raise RuntimeError("The request did not connect: " + str(error.reason)) from error

Python 3. YOUR_API_KEY is a placeholder. Change viewport to tablet or mobile for the other presets. The origin is https://datatuber.com.

Using both is reasonable. Playwright can capture the app you are developing. The HTTP route can capture public pages you do not host. They are not substitutes for every job.

What this page is based on

Playwright
The sync Python calls on this page: launch, new_page, goto, and screenshot with full_page. No version pin and no timed run.
This website
POST /api/screenshots, the viewport presets, URL checks, response types, and the beta quotas in the account migration. Checked November 6, 2026.
Not included
No timings, no image-quality scores, no prices beyond the unpublished paid plan, and no comparison with other screenshot vendors. The samples were not executed against the live route.

Questions

Can I use Playwright and the API in the same product?

Yes. Playwright fits the pages your process can open and manipulate. POST /api/screenshots fits public https URLs at the three named viewports. They answer different constraints.

Which should I use for a local app?

Playwright. This site’s route rejects localhost, IP addresses, and private hosts. Point the Playwright script at the URL your machine can already open.

Does the DataTuber route capture the full page?

No. Full-page capture is not a field on POST /api/screenshots. Playwright’s screenshot call accepts full_page=True in Python and fullPage: true in Node.

Do these examples require an account?

The Playwright script does not. The API script uses a placeholder key so a verified workspace can store the image. The homepage capture uses the same path without a key and does not store the image. Create a free account if you need the key.

Will either option charge a card on this site?

Playwright is not a DataTuber product, and this page does not price the computer that runs it. DataTuber does not collect payment before January 1, 2027. Pricing has no checkout.