browserflare
Python library for the Cloudflare Browser Rendering APIs.
Prefer a GUI App? Look at our desktop app - browserflare.xyz.
Install
pip install browserflare
Setup
Add your Cloudflare credentials to .env:
CF_ACCOUNT_ID=your_account_id
CF_API_TOKEN=your_api_token
Usage
from browserflare import start_crawl, build_crawl_payload, poll_until_complete, save_results
# Build a crawl payload
payload = build_crawl_payload(
url="https://browserflare.xyz",
limit=10,
formats=["markdown"],
)
# Start the crawl
job_id, err = start_crawl(payload)
# Wait for completion
result, err = poll_until_complete(job_id)
# Save results
save_results(job_id, result, formats=["markdown"])
Screenshots
from browserflare import take_screenshot, build_screenshot_payload, save_screenshot
payload = build_screenshot_payload(url="https://browserflare.xyz", full_page=True)
image_bytes, content_type, err = take_screenshot(payload)
filepath = save_screenshot("https://browserflare.xyz", image_bytes, content_type)
PDFs
from browserflare import generate_pdf, build_pdf_payload, save_pdf
payload = build_pdf_payload(url="https://browserflare.xyz", format="a4")
pdf_bytes, content_type, err = generate_pdf(payload)
filepath = save_pdf("https://browserflare.xyz", pdf_bytes)
Project Structure
src/browserflare/
__init__.py # Public re-exports
exceptions.py # MissingCredentialsError, etc.
config.py # .env loading, API config, constants
api.py # HTTP: start, poll, paginate, cancel crawls
jobs.py # crawl_jobs.json management
output.py # Save crawl results, search, stats, diff
batch.py # Batch crawling from URL list
payloads.py # Payload builders for crawl, screenshot, PDF
screenshot_api.py # POST to /screenshot endpoint
screenshot_output.py # Save screenshots + JSON log
pdf_api.py # POST to /pdf endpoint
pdf_output.py # Save PDFs + JSON log
Metadata
Release files for browserflare 0.1.1
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 |
|---|---|---|---|---|
| browserflare-0.1.1.tar.gz | 10.8 kB | Without provenance | Details for browserflare-0.1.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| browserflare-0.1.1-py3-none-any.whl | Python 3 | none | any | Details for browserflare-0.1.1-py3-none-any.whl |
Total release size: 23.9 kB
Release files / browserflare-0.1.1.tar.gz
| Download URL | browserflare-0.1.1.tar.gz |
|---|---|
| Size | 10.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a9f73e492a62a9cc7639ad38db792c2b332f23246e9dec4ee5435bba9353b286
|
|
BLAKE2b-256 checksum How to use checksums |
c93ee4ed2f311208a022848ec2a5349763f7ce85ceff3deaaaac9141828495e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0
|
Release files / browserflare-0.1.1-py3-none-any.whl
| Download URL | browserflare-0.1.1-py3-none-any.whl |
|---|---|
| Size | 13.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
57586b6160a312b1c8e26efc7f07b9dc7be1b2cf69f6d4402c237296f4f918d0
|
|
BLAKE2b-256 checksum How to use checksums |
c7bca7569fbca2ac66a11066a2cd93e116ca9924160df4c2bfec408ce24c9478
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.0
|
Security for browserflare 0.1.1
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.