screenie
Screenie takes a screenshot of a webpage or a node on a webpage and returns said image as
a png
.
Endpoint GET /capture
Supported query params
-
src
(required) - full url of the website you want to screenshot. Authenticated pages aren't supported. -
selector
(optional) - CSS selector of the node you want to screenshot. Please make sure it has URL safe characters. For e.g.,#
will throw it off. -
viewportWidth
(optional (default:800px
)) - width of the headless Chrome instance. -
viewportHeight
(optional (default:600px
)) - height of the headless Chrome instance -
fullPage
(optional (default:true
)) - take a full page screenshot or not. Valid values aretrue
andfalse
. Only application when no selector is provided. -
omitBackground
(optional (default:false
)) - hides default white background and allows capturing screenshots with transparency
Note
For large viewport width and height, chrome-aws-lambda and puppeteer-core fail and throw.
Examples
Element screenshot -
/capture?src=https://mudit.xyz&selector=nav > ul > li:nth-child(3)
Full page screenshot -
/capture?src=https://stefanjudis.com&viewportWidth=1024&fullPage=true
Screenshot with transparent background -
/capture?src=https://screenie.zdx.cat&selector=header&omitBackground=true&viewportWidth=1200
View source on