Browshot version 1.32.0
================================
Browshot (https://browshot.com/) is a web service to easily make screenshots of web pages in any screen size, as any device: iPhone, iPad, Android, PC, etc. Browshot has full Flash, JavaScript, CSS, & HTML5 support.
The latest API version is detailed at https://browshot.com/api/documentation. browshot follows the API documentation very closely: the function names are similar to the URLs used (screenshot/create becomes screenshot_create(), instance/list becomes instance_list(), etc.), the request arguments are exactly the same, etc.
The library version matches closely the API version it handles: browshot 1.0.0 is the first release for the API 1.0, browshot 1.1.1 is the second release for the API 1.1, etc.
browshot can handle most the API updates within the same major version, e.g. browshot 1.0.0 should be compatible with the API 1.1 or 1.2.
You can install the library from PyPI: https://pypi.python.org/pypi/Browshot
The source code can be found on github at https://github.com/juliensobrier/browshot-python
INSTALLATION
python3 -m pip install .
REQUIREMENTS
Python 3.9 or newer
requests (installed automatically by pip)
TESTS
python3 -m unittest discover -s tests -p '*_test.py'
LIVE TESTS
Set BROWSHOT_API_KEY to enable read-only checks with your account.
Set BROWSHOT_SCREENSHOT_ID to a finished capture and BROWSHOT_RETINA_ID to
a finished capture with retina and ad blocking. For artifact checks, set
BROWSHOT_PDF_ID, BROWSHOT_WEBM_ID, BROWSHOT_MP4_ID, and BROWSHOT_GIF_ID to
owned, finished captures of each format.
API 1.32
from browshot import BrowshotClient
import os
client = BrowshotClient(os.environ['BROWSHOT_API_KEY'])
capture = client.screenshot_create('https://example.com/', {
'instance_id': 373,
'pdf': 1,
'pdf_format': 'a4',
'pdf_margin': '10mm',
'device_scale': 2,
'hide_ads': 1,
})
Poll screenshot_info(capture['id']) until status is 'finished'. Download with
screenshot_pdf(capture['id']) or save with
screenshot_pdf_file(capture['id'], 'example.pdf').
PDF settings include pdf_format (letter, a4, or legal), pdf_background,
pdf_landscape, pdf_one_page, pdf_margin, and the per-side pdf_margin_top,
pdf_margin_bottom, pdf_margin_left, and pdf_margin_right.
Request a short video or animated GIF with the same capture method.
recording = client.screenshot_create('https://example.com/', {
'instance_id': 373,
'video': 1,
'video_format': 'gif',
'video_duration': 5,
'video_scale': 0.5,
})
After the capture finishes, use screenshot_video(recording['id']) to get the
bytes or screenshot_video_file(recording['id'], 'example.gif') to save them.
Accepted formats are webm (default), mp4, and gif. Set video_duration to 1–30
seconds, video_quality to 0–63, video_fps to 1–30, and video_scale to 0.1–1.
GIF uses 20 fps. An MP4 request can produce WebM where MP4 encoding is unavailable.
The download methods return bytes or b'' on failure. File helpers use the
supplied path in an existing directory and return that path, or '' on failure.
Downloads preserve the returned bytes.
Choose a capture country through instance_id. The IDs below are in order
Chrome, Firefox, iPhone 12, and Samsung S20.
France 373 374 375 376
India 377 378 379 380
Finland 381 382 383 384
United Kingdom 385 386 387 388
Each new instance costs one credit before options. PDF adds one credit per
capture. Recording adds one credit per started five seconds of requested
duration. Both require a paid Chrome-based instance, and video requires
device_scale=1. Retina (device_scale=2), ad blocking (hide_ads=1), and downloads
add no credits.
Metadata
Release files for Browshot 1.32.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| browshot-1.32.0.tar.gz | 6.7 kB | Without provenance | Details for browshot-1.32.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| browshot-1.32.0-py3-none-any.whl | Python 3 | none | any | Details for browshot-1.32.0-py3-none-any.whl |
Total release size: 13.6 kB
Release files / browshot-1.32.0.tar.gz
| Download URL | browshot-1.32.0.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
95393308824b713ce323aa70984f1fb8b794c4473021e9d9e5a0c41abc23f9a2
|
|
BLAKE2b-256 checksum How to use checksums |
881cfe137732c222aaafc0cfe12c9b43fe67db32bf6e9cc239070cbc140074a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Release files / browshot-1.32.0-py3-none-any.whl
| Download URL | browshot-1.32.0-py3-none-any.whl |
|---|---|
| Size | 6.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
24a07543bc0c32b5d637efbebbc40db17e974b8dfc817087633630cc436ead57
|
|
BLAKE2b-256 checksum How to use checksums |
a2cdff569711a23399f51b3fa17bff8917a3e5056af78cf322d408f9e73440fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.9
|
Security for Browshot 1.32.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.