Back to articles
Capture Website Screenshots with a Simple API Call
How-ToTools

Capture Website Screenshots with a Simple API Call

via Dev.to TutorialShotaTanikawa

Capture Website Screenshots with a Simple API Call Need to generate thumbnails, create visual previews, or capture website screenshots programmatically? The Website Screenshot API lets you do it in one HTTP request. Quick Start curl -X POST https://screenshot-api-rouge-zeta.vercel.app/api/screenshot \ -H "Content-Type: application/json" \ -d '{"url": "https://github.com", "width": 1280, "height": 720}' \ --output screenshot.png That's it. You get a pixel-perfect PNG screenshot back. Options Parameter Type Default Description url string — URL to capture html string — Raw HTML to render format string "png" png, jpeg, or webp width number 1280 Viewport width (max 3840) height number 720 Viewport height (max 2160) fullPage boolean false Capture full scrollable page deviceScaleFactor number 1 Retina scaling (1-3) delay number 0 Wait ms after page load Python Example import requests response = requests . post ( " https://screenshot-api-rouge-zeta.vercel.app/api/screenshot " , json = { " url

Continue reading on Dev.to Tutorial

Opens in a new tab

Read Full Article
2 views

Related Articles