Skip to main content

localscreenshot

Take a screenshot of any public web page from your terminal or from Python. This is the client of the localscreenshot API.

pipx run localscreenshot https://example.com

It saves the image in the current folder and tells you what it cost.

Install

pip install localscreenshot

Python 3.9 or later. No dependencies.

Your API key

Create a free account at localscreenshot.com/signup. A new account gets free credits, no card needed.

Then either set the key in your environment:

export LOCALSCREENSHOT_API_KEY=your_key

or save it once on this machine:

localscreenshot login

login asks for the key without showing it, checks it, and writes it to a file only you can read. localscreenshot logout removes it. The key is never accepted as a command line argument, so it does not end up in your shell history.

Examples

# The whole page, as a JPEG
localscreenshot https://example.com --full-page --format jpeg

# As seen from Brazil
localscreenshot https://www.netflix.com --country BR

# On a phone, in dark mode, without the cookie banner
localscreenshot https://example.com --device iphone_15 --dark --no-cookie-banners

# Click a menu first, then capture
localscreenshot https://www.notion.com --click-text "Product"

# Choose the file name
localscreenshot https://example.com -o home.png

Options

Option What it does
-o, --output <file> Where to write the image. Default: <host>-<time>.<ext>
--country <code> Load the page from this country, two letters
--full-page Capture the whole page
--device <name> Screen to render on, for example iphone_15, ipad, desktop_hd
--format <format> png (default), jpeg, webp or pdf
--click-text <text> Click the one element showing this text, then capture
--no-cookie-banners Hide cookie banners
--no-ads Hide ads
--dark Render in dark mode
--json Print the API answer as JSON
--force Overwrite the output file if it exists

Other commands:

localscreenshot countries   # the countries a page can be loaded from
localscreenshot credits     # the credits left on your account

From Python

from localscreenshot import screenshot

shot = screenshot("https://example.com", country="BR", full_page=True)
with open(f"example.{shot.extension}", "wb") as file:
    file.write(shot.image)

print(shot.width, shot.height, shot.credits_charged, shot.credits_remaining)

screenshot() takes the same options as the command: country, full_page, device, format, click_text, block_cookie_banners, block_ads, dark. It reads the key from LOCALSCREENSHOT_API_KEY or from the file written by localscreenshot login, or takes api_key=. It raises localscreenshot.ApiError, with the error code of the API, when a screenshot fails.

A screenshot uses credits from your account. A failed screenshot is not charged. The tool exits with a non-zero code when something fails, and prints the error code of the API.

For AI tools

localscreenshot also runs an MCP server, so that Claude, Cursor, VS Code and other tools can take screenshots on their own. Setup: localscreenshot.com/mcp.

MIT license.

Metadata

Release files for localscreenshot 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for localscreenshot 0.1.0
File Size Uploaded
localscreenshot-0.1.0.tar.gz 17.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for localscreenshot 0.1.0
File Interpreter ABI Platform
localscreenshot-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 30.5 kB

Release files / localscreenshot-0.1.0.tar.gz

Download URL localscreenshot-0.1.0.tar.gz
Size 17.3 kB
Tags Source
SHA-256 checksum
How to use checksums
1504837386a01e9cf0adbcc9e621ecaaa117a5fa1eaae4e34c8f7585d58318b7
BLAKE2b-256 checksum
How to use checksums
fe112295fda6e406babc2ad6f7a20e2c2391a7ed93c90ca051b22e5cc50f60d2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release files / localscreenshot-0.1.0-py3-none-any.whl

Download URL localscreenshot-0.1.0-py3-none-any.whl
Size 13.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
efdf11b95201a3b4e2fe8582d7effb447b2e5b4a1a909fd6232300b3bd407d2f
BLAKE2b-256 checksum
How to use checksums
54951277d35c453bb07d9a89abfc9165c0dbab15c1d4cbb2bb04d634abfb0643
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 12, 2026.

Transparency log

Release history Release notifications | RSS feed

0.1.1

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page