Skip to main content

Headless browser rendering API — self-hostable on HF Spaces, Docker, or bare metal

Project description

VeilRender

PyPI version GitHub release CI Docker Pulls Docker Image License: MIT HF Spaces

中文 | English

Headless browser rendering API — self-hostable on HF Spaces, Docker, or bare metal.

VeilRender accepts a URL and returns the fully rendered page content (HTML, Markdown, readability-extracted article) using a headless Chromium browser. Designed as a fallback for fetch tools that fail on JavaScript-rendered pages.

Quick Start

Docker

docker run -p 7860:7860 -e VEILRENDER_API_TOKEN=your-secret ghcr.io/oaklight/veilrender

Local Development

pip install -e ".[dev]"
playwright install chromium
python -m veilrender

API

GET /health

Returns {"status": "ok"} if the service is running.

POST /render

Render a URL and return the page content.

curl -X POST http://localhost:7860/render \
  -H "Authorization: Bearer your-secret" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

Response:

{
  "content": {
    "html": "...",
    "markdown": "...",
    "readability": "..."
  },
  "metadata": {
    "title": "Example Domain",
    "url": "https://example.com",
    "status_code": 200
  },
  "links": [{"url": "https://www.iana.org/domains/example", "text": "More information..."}]
}

POST /screenshot

Capture a screenshot of a URL.

curl -X POST http://localhost:7860/screenshot \
  -H "Authorization: Bearer your-secret" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}' \
  -o screenshot.png

Configuration

All settings are configured via environment variables with the VEILRENDER_ prefix:

Variable Default Description
VEILRENDER_API_TOKEN (none) API token for authentication. If unset, auth is disabled.
VEILRENDER_PORT 7860 Server port
VEILRENDER_HOST 0.0.0.0 Server bind address
VEILRENDER_TIMEOUT 30000 Browser navigation timeout (ms)
VEILRENDER_VIEWPORT_WIDTH 1280 Browser viewport width
VEILRENDER_VIEWPORT_HEIGHT 720 Browser viewport height
VEILRENDER_MAX_CONCURRENT 3 Max concurrent browser contexts

Benchmark

Tested on HF Spaces (free tier, 2 vCPU) and a self-hosted VPS (3 vCPU, 1 GB container). 100% success rate across all 46 requests per target.

Test HF Spaces Self-hosted
Sequential × 5 (mixed URLs) 8.72 s total 11.81 s total
Concurrent × 10 (mixed URLs) 1.40 – 9.37 s 1.29 – 13.45 s
Rapid-fire × 20 (sequential) 0.885 s avg 1.029 s avg
Peak container memory 614 MiB / 1 GB

Full results: BENCHMARK.md

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

veilrender-0.1.0.tar.gz (89.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

veilrender-0.1.0-py3-none-any.whl (98.3 kB view details)

Uploaded Python 3

File details

Details for the file veilrender-0.1.0.tar.gz.

File metadata

  • Download URL: veilrender-0.1.0.tar.gz
  • Upload date:
  • Size: 89.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for veilrender-0.1.0.tar.gz
Algorithm Hash digest
SHA256 fbb00feb9cc0588cab855c50e529919c15e6e62e86a4b78a693d9d7bf03dac70
MD5 a5e5280e043557e55e2cf7912d1b4665
BLAKE2b-256 89c2020fa8838fe4ba4932a2d41cd1e96ca38f9f0d0f3c95a3a097c4a67dd6b5

See more details on using hashes here.

Provenance

The following attestation bundles were made for veilrender-0.1.0.tar.gz:

Publisher: release.yml on Oaklight/veilrender

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file veilrender-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: veilrender-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 98.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for veilrender-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9117940a0ac55eb3a5cb234f9595c03c18696b637440246eded623fd098cdfc8
MD5 22a2c9538e7ed2542008c0bf416aef52
BLAKE2b-256 eff120ba42123d9992562fb25fa61b7e4bf5a61e7fa7602515522d79284acdf3

See more details on using hashes here.

Provenance

The following attestation bundles were made for veilrender-0.1.0-py3-none-any.whl:

Publisher: release.yml on Oaklight/veilrender

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page