Serverless service that generates dynamic screenshots on demand.
parameter | type | description |
---|---|---|
url |
string |
Required e.g. https://wikipedia.org |
selector |
string |
css selector e.g. .central-featured |
viewport |
string |
viewport size default: 1024,768 |
dpr |
integer |
device scale factor default: 1 |
full |
boolean |
screenshot full page default: (empty), set full=1 to enable |
ua |
string |
user agent e.g. Googlebot/2.1 (+http://www.google.com/bot.html) |
css |
string |
custom css e.g. body{background:lightyellow} |
filetype |
string |
filetype default: png , or jpeg |
ℹ️ Don't forget to URL encode query string parameters
/screenshot
?url=https://yahoo.com
&selector=[data-yaft-module=stream_item_1]>div
First, npm install && npm run build
.
-
Setup vercel project
vercel
-
Start development server
vercel dev
npm start
docker-compose up