lovablehtml logo - turn your SPA into a crawler-friendly websiteBLOGAPI PLATFORMPRICING

Render API

Render JavaScript pages into static, crawler-friendly HTML.

GET/api/prerender/render

Render a JavaScript page into static HTML. Returns rendered HTML (200) or a passthrough instruction (304 + Location) when prerendering does not apply.

Query Parameters

ParameterTypeDescription
urlrequiredstringURL-encoded target page to render. Must be a valid URL.

Response Headers

HeaderValuesDescription
x-lovablehtml-render-cachehit | missWhether response was served from cache
x-lovablehtml-snapshot-keystringR2 object key for the stored HTML snapshot
cache-controlpublic, max-age=N, s-maxage=NCache TTL based on your domain's configured refresh interval
etagW/"sha256"Weak etag derived from the HTML content hash

Response Body

On 200, returns the fully-rendered HTML string with Content-Type: text/html; charset=utf-8.

On 304, the body is empty. Follow the Location header to the origin URL.

Response Codes

200
Success — Returns rendered HTML with Content-Type: text/html
304
Passthrough — Static asset, non-HTML request, or real browser navigation. Location header contains origin URL.
401
Unauthorized — Missing or invalid API key.
402
Subscription required — Rendering via API requires an active plan.
403
Forbiddendomain_not_owned or api_key_domain_scope_mismatch.

Example

javascript
CopyDownload
const response = await fetch(
'https://lovablehtml.com/api/prerender/render?url=' +
encodeURIComponent('https://your-app.com/page'),
{
headers: {
'x-lovablehtml-api-key': '<API_KEY>',
'Accept': 'text/html'
}
}
);
const html = await response.text();
// Check response headers
const cacheStatus = response.headers.get('x-lovablehtml-render-cache');
// → "hit" (cached) or "miss" (fresh render)
const snapshotKey = response.headers.get('x-lovablehtml-snapshot-key');
// Useful for debugging: the stored HTML object key (when available)
bash
CopyDownload
curl -X GET \
"https://lovablehtml.com/api/prerender/render?url=https%3A%2F%2Fyour-app.com%2Fpage" \
-H "x-lovablehtml-api-key: <API_KEY>" \
-H "Accept: text/html"
python
CopyDownload
import requests
import urllib.parse
url = urllib.parse.quote('https://your-app.com/page', safe='')
response = requests.get(
f'https://lovablehtml.com/api/prerender/render?url={url}',
headers={
'x-lovablehtml-api-key': '<API_KEY>',
'Accept': 'text/html'
}
)
html = response.text
cache_status = response.headers.get('x-lovablehtml-render-cache')

Tip: Static assets (CSS, JS, images, fonts) are never prerendered. Follow the Location header or fetch directly from origin.

Avatar
How can we help?
Get instant answers to your questions or leave a message for an engineer will reach out
Ask our assistant anything
See our docs
Leave a message
Leave a message
We'll get back to you soon
Book a Meeting
Select a date & time
Avatar
Support Assistant
We typically reply instantly
Thinking
Preview
Powered by ReplyMaven
Avatar
Support Assistant
Hi, how can we help?