API Documentation
Everything you need to generate screenshots and images with Rendly.
Base URL: https://rendly-api.fly.dev
Authentication
All API requests require a Bearer token in the Authorization header.
Authorization: Bearer ren_live_your_api_key_here
Get your API key by registering an account, or from the dashboard.
Quick Start
Take a screenshot in your language of choice:
Node.js
const res = await fetch('https://rendly-api.fly.dev/api/v1/screenshots', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({ url: 'https://example.com' })
});
const data = await res.json();
console.log(data.image_url);
Python
import requests
resp = requests.post('https://rendly-api.fly.dev/api/v1/screenshots',
headers={'Authorization': 'Bearer YOUR_API_KEY'},
json={'url': 'https://example.com'})
print(resp.json()['image_url'])
Ruby
require 'net/http'
require 'json'
uri = URI('https://rendly-api.fly.dev/api/v1/screenshots')
req = Net::HTTP::Post.new(uri, 'Authorization' => 'Bearer YOUR_API_KEY',
'Content-Type' => 'application/json')
req.body = { url: 'https://example.com' }.to_json
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |h| h.request(req) }
puts JSON.parse(res.body)['image_url']
Error Codes
| Code | Meaning |
|---|---|
400 | Bad request — missing or invalid parameters |
401 | Unauthorized — invalid or missing API key |
404 | Not found — resource doesn't exist |
422 | Unprocessable — validation failed |
429 | Rate limited — too many requests |
500 | Server error — something went wrong on our end |
Error responses include a JSON body:
{ "error": "Plan limit reached. Upgrade at /api/v1/billing/checkout" }
Rate Limits
API requests are limited to 60 requests per minute per API key. Additionally, renders are limited by your plan's monthly allowance.
Screenshots
Capture a screenshot of any URL.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
url | string | Yes | URL to screenshot |
viewport | object | No | { width, height } — default 1280×720 |
device_scale | number | No | 1 or 2 (retina) — default 1 |
format | string | No | png, jpeg, webp — default png |
full_page | boolean | No | Capture full scrollable page |
selector | string | No | CSS selector to crop to |
wait_for | string | No | CSS selector to wait for before capture |
delay_ms | number | No | Extra delay after page load (ms) |
dark_mode | boolean | No | Emulate dark color scheme |
custom_css | string | No | Inject custom CSS |
custom_js | string | No | Inject custom JavaScript |
Example
curl -X POST https://rendly-api.fly.dev/api/v1/screenshots \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"url": "https://example.com",
"viewport": {"width": 1280, "height": 720},
"format": "png",
"device_scale": 2
}'
Response
{
"id": "render_abc123",
"status": "completed",
"url": "https://cdn.rendly.io/render_abc123.png",
"width": 2560,
"height": 1440,
"format": "png",
"render_time_ms": 1240,
"created_at": "2026-02-14T15:00:00Z"
}
HTML to Image
Render HTML/CSS to an image.
Parameters
| Param | Type | Required | Description |
|---|---|---|---|
html | string | Yes | HTML content to render |
css | string | No | CSS styles to apply |
viewport | object | No | { width, height } — default 1200×630 |
device_scale | number | No | 1 or 2 (retina) |
format | string | No | png, jpeg, webp |
google_fonts | array | No | Google Fonts to load |
selector | string | No | CSS selector to crop to |
Example
curl -X POST https://rendly-api.fly.dev/api/v1/images \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"html": "Hello World",
"viewport": {"width": 1200, "height": 630},
"format": "png"
}'
Templates
List all available templates (built-in and custom).
curl https://rendly-api.fly.dev/api/v1/templates \
-H "Authorization: Bearer YOUR_API_KEY"
Create a custom template (paid plans).
curl -X POST https://rendly-api.fly.dev/api/v1/templates \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Blog Card",
"slug": "blog-card",
"html": "{{ title }} by {{ author }}",
"css": "div { font-size: 32px; padding: 40px; }",
"variables_schema": {
"title": {"type": "string", "required": true},
"author": {"type": "string", "required": true}
}
}'
Render Template
Render a template with variables.
curl -X POST https://rendly-api.fly.dev/api/v1/templates/og-blog-post/render \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"variables": {
"title": "How to Build an API",
"author": "Thomas",
"date": "Feb 14, 2026",
"read_time": "5 min"
},
"format": "png"
}'
Usage
Check current usage and plan limits.
curl https://rendly-api.fly.dev/api/v1/usage \
-H "Authorization: Bearer YOUR_API_KEY"
Response
{
"plan": "free",
"renders_used": 42,
"renders_limit": 100,
"overage_count": 0,
"period_start": "2026-02-01",
"period_end": "2026-02-28"
}
Billing
Create a Stripe checkout session to upgrade your plan.
curl -X POST https://rendly-api.fly.dev/api/v1/billing/checkout \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"plan": "growth"}'
Get a Stripe customer portal URL to manage your subscription.
Register
Create an account and get your first API key.
curl -X POST https://rendly-api.fly.dev/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "dev@example.com",
"password": "securepassword",
"password_confirmation": "securepassword"
}'
Response
{
"user": {"id": 1, "email": "dev@example.com"},
"api_key": {"id": 1, "key": "ren_live_abc123...", "name": null}
}
API Keys
Create an additional API key.
curl -X POST https://rendly-api.fly.dev/auth/api_keys \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"name": "production"}'
Revoke an API key.