Screenshots
Community Resources:
Feed this runtime service a URL and it return a fully rendered screenshot image from that page (using Puppeteer):
Open Source #
Usage #
Try it out on the Eleventy API Explorer.
Image URLs have the format:
https://v1.screenshot.11ty.dev/:url/
https://v1.screenshot.11ty.dev/:url/:size/
https://v1.screenshot.11ty.dev/:url/:size/:aspectratio/
https://v1.screenshot.11ty.dev/:url/:size/:aspectratio/:zoom/
url
must be URI encoded.- Valid
size
values:small
: 375×___ (default)medium
: 650×___large
: 1024×___aspectratio
of9:16
is not supported (throws an error)
opengraph
: always 1200×630, works withzoom
aspectratio
is ignored (no errors thrown)
- Valid
aspectratio
values:1:1
(default)9:16
- Valid
zoom
values:bigger
(1.4devicePixelRatio
)smaller
(0.71devicePixelRatio
)
Samples #
<img src="https://v1.screenshot.11ty.dev/https%3A%2F%2Fwww.11ty.dev%2Fdocs%2F/small/9:16/bigger/" class="screenshot screenshot-first-example" width="375" height="667" loading="lazy" decoding="async" alt="Screenshot of 11ty.dev">