Headless browser rendering API — self-hostable on HF Spaces, Docker, or bare metal
Project description
VeilRender
中文 | 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fbb00feb9cc0588cab855c50e529919c15e6e62e86a4b78a693d9d7bf03dac70
|
|
| MD5 |
a5e5280e043557e55e2cf7912d1b4665
|
|
| BLAKE2b-256 |
89c2020fa8838fe4ba4932a2d41cd1e96ca38f9f0d0f3c95a3a097c4a67dd6b5
|
Provenance
The following attestation bundles were made for veilrender-0.1.0.tar.gz:
Publisher:
release.yml on Oaklight/veilrender
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veilrender-0.1.0.tar.gz -
Subject digest:
fbb00feb9cc0588cab855c50e529919c15e6e62e86a4b78a693d9d7bf03dac70 - Sigstore transparency entry: 1806755170
- Sigstore integration time:
-
Permalink:
Oaklight/veilrender@ded2859300eafb12b5dc72abbf0ed17de2e9a26b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Oaklight
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ded2859300eafb12b5dc72abbf0ed17de2e9a26b -
Trigger Event:
push
-
Statement type:
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9117940a0ac55eb3a5cb234f9595c03c18696b637440246eded623fd098cdfc8
|
|
| MD5 |
22a2c9538e7ed2542008c0bf416aef52
|
|
| BLAKE2b-256 |
eff120ba42123d9992562fb25fa61b7e4bf5a61e7fa7602515522d79284acdf3
|
Provenance
The following attestation bundles were made for veilrender-0.1.0-py3-none-any.whl:
Publisher:
release.yml on Oaklight/veilrender
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
veilrender-0.1.0-py3-none-any.whl -
Subject digest:
9117940a0ac55eb3a5cb234f9595c03c18696b637440246eded623fd098cdfc8 - Sigstore transparency entry: 1806755217
- Sigstore integration time:
-
Permalink:
Oaklight/veilrender@ded2859300eafb12b5dc72abbf0ed17de2e9a26b -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/Oaklight
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@ded2859300eafb12b5dc72abbf0ed17de2e9a26b -
Trigger Event:
push
-
Statement type: