URL to Image API: Convert Any Webpage to PNG, JPEG, or WebP
Need to convert a URL to an image? Whether you're building link previews, generating thumbnails for a CMS, or archiving web pages, a URL-to-image API gives you the result in one HTTP request.
Basic usage
curl -X POST https://screenshotapis.org/v1/screenshot \
-H "X-Api-Key: sk_live_your_key" \
-d '{"url": "https://example.com", "format": "png"}' \
--output screenshot.png
That's it. The API loads the page in a real Chromium browser, waits for it to render, and returns the image. JavaScript, CSS, web fonts — everything renders correctly.
Output formats
- PNG — lossless, best for screenshots with text. Larger files.
- JPEG — lossy, smaller files. Good for photo-heavy pages. Use
qualityto control compression. - WebP — modern format. 25-35% smaller than PNG at similar quality. Best for web display.
Common options
Full-page capture
Capture the entire scrollable page, not just the viewport:
{"url": "https://example.com", "full_page": true, "format": "png"}
Custom viewport
Simulate different screen sizes:
{"url": "https://example.com", "width": 375, "height": 812, "format": "png"}
Retina / HiDPI
Double the pixel density for crisp images on retina displays:
{"url": "https://example.com", "device_scale_factor": 2, "format": "png"}
Dark mode
Capture the page with the dark color scheme:
{"url": "https://example.com", "dark_mode": true, "format": "png"}
Element capture
Capture just one element on the page using a CSS selector:
{"url": "https://example.com", "selector": "#main-content", "format": "png"}
Use cases
Link previews
When a user pastes a URL into your app, fetch a thumbnail image to show alongside it. Slack, Twitter, and Notion all do this.
CMS thumbnails
Auto-generate preview images for articles, product pages, or portfolio entries. No manual screenshots needed.
Web archival
Capture a visual snapshot of any page at a point in time. Useful for compliance, legal evidence, or historical records.
Competitor monitoring
Screenshot competitor pricing pages or landing pages on a schedule. Track visual changes over time.
Code examples
Python
import requests
resp = requests.post(
"https://screenshotapis.org/v1/screenshot",
headers={"X-Api-Key": "sk_live_your_key"},
json={"url": "https://example.com", "format": "webp", "full_page": True},
)
with open("page.webp", "wb") as f:
f.write(resp.content)
Node.js
const resp = await fetch("https://screenshotapis.org/v1/screenshot", {
method: "POST",
headers: {
"X-Api-Key": "sk_live_your_key",
"Content-Type": "application/json",
},
body: JSON.stringify({ url: "https://example.com", format: "webp" }),
});
const buf = Buffer.from(await resp.arrayBuffer());
fs.writeFileSync("page.webp", buf);
Convert any URL to an image — 100 free renders per month
Get your API key — free