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 Live Demo

中文 | English

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

Try it now (no auth needed)

curl -X POST https://oaklight-veilrender-public.hf.space/render \
  -H "Content-Type: application/json" \
  -d '{"url": "https://example.com"}'

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 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.2.0.tar.gz (92.8 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.2.0-py3-none-any.whl (102.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for veilrender-0.2.0.tar.gz
Algorithm Hash digest
SHA256 174956d4f729bcdae5ffbea6f96003d5d169f077f86c0833e2dadd0625e72b07
MD5 8060b2d60ddf0885d077b80a59be8df5
BLAKE2b-256 5c8d7548b94f1160c7ab6e372563bff6e5034a48d3bb78fd36671f82448a5de4

See more details on using hashes here.

Provenance

The following attestation bundles were made for veilrender-0.2.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.2.0-py3-none-any.whl.

File metadata

  • Download URL: veilrender-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 102.5 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d01d217b6ba9d15a18d4ebb7ac8be26353e412d51f15ca74a37126d5713975aa
MD5 55fb91ef596bc227432e961d26cdc0d6
BLAKE2b-256 46e4fe60e7fe78ad94163369aa6658ad755356081f2a03678d51bfbae717a5eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for veilrender-0.2.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