Home API Tools Posts Hire Me About
Sign In Create Account
Live Free tier included

Capture Screenshots of Any URL

Take pixel-perfect screenshots of any webpage using headless Chrome. Full-page captures, custom viewports, dark mode, delay options — all via a simple API call.

Headless Chrome Full Page Dark Mode PNG / JPEG / WebP

Try it Free

Enter any URL and capture a screenshot with custom viewport settings.

Try Free
Result

Enter a URL and click Capture

API Documentation

Capture pixel-perfect screenshots of any URL using headless Chrome. Full-page captures, custom viewports, dark mode, multiple formats. Powered by Puppeteer.

Endpoint

POSThttps://www.mahmoudalhabash.com/api/v1/screenshot

Send a URL with viewport and format options. The API launches headless Chrome, captures the page, and returns a base64-encoded image.

Request Parameters

ParameterTypeRequiredDefaultDescription
urlstringrequiredURL to screenshot
widthintegeroptional1280Viewport width (320–3840)
heightintegeroptional800Viewport height (200–2160)
full_pagebooleanoptionalfalseCapture the full scrollable page
formatstringoptionalpngpng, jpeg, or webp
qualityintegeroptional85JPEG/WebP quality (1–100)
delayintegeroptional0Delay in ms before capture (0–10000)
dark_modebooleanoptionalfalseForce dark mode

Response Fields

status "success" or "error"
url The URL that was captured
format Output image format
width / height Viewport dimensions
size_bytes / size_human Image file size
took_ms Total capture time in ms
image Base64 data URI of the screenshot

Code Examples

cURL
curl -X POST https://www.mahmoudalhabash.com/api/v1/screenshot \ -H "Content-Type: application/json" \ -d '{ "url": "https://github.com", "width": 1280, "height": 800, "format": "png", "full_page": false }'
Response 200JSON
{ "status": "success", "url": "https://github.com", "format": "png", "width": 1280, "height": 800, "size_bytes": 456789, "size_human": "446.1 KB", "took_ms": 3200, "image": "data:image/png;base64,iVBOR..." }

Error Codes

422 Validation failed — URL required, invalid dimensions
429 Rate limit exceeded
500 Chrome/Puppeteer failed to capture the page

Rate Limits

Unlimited — Free during beta

Powered by headless Chromium via Puppeteer. Typical capture takes 2-5 seconds. Max viewport 3840×2160.