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.3.0.tar.gz (658.2 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.3.0-py3-none-any.whl (669.1 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for veilrender-0.3.0.tar.gz
Algorithm Hash digest
SHA256 23de55bf168fd89343401c565acc39c4c4584e955de17d57614ccd7c2fb8417e
MD5 ec1315670a9ad116d373ef365c72215f
BLAKE2b-256 63cd4a77fb993550838fbe1241e6cc8f91d414bcb7d3174998424e18dfaeb70e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: veilrender-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 669.1 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.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3c1b1fe9ee3ae48218c4970a9a3c7d02c06d682507a29bb674297a025a2b2443
MD5 82cac9a0c529a9ec482d722f7e7045ff
BLAKE2b-256 79cfef6f20de40a6965db44cf414c91aa4fb01872784edb9bfef0295b164ec30

See more details on using hashes here.

Provenance

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