For products that draw their own images
Lay out social cards and certificates in HTML, get a PNG back
Lay the image out in HTML and CSS, send it in the request, and get back a PNG at exactly the size you set.
The problem
Every blog post needs an Open Graph card, every course completion a certificate, every release a social image. Designing each one in an image editor does not scale, drawing them with a canvas library means relearning layout that CSS already does well, and running a rendering service of your own is one more thing to deploy and patch.
How domscout handles it
Send the markup as html instead of a url and set the viewport to the size the image must be: 1200 by 630 for an Open Graph card. Chromium lays it out, waits for the network to go quiet so the fonts and images it links to have arrived, and returns the picture. deviceScaleFactor: 1 keeps the file exactly the viewport size, captureSelector crops to one element when the card is part of a larger page, and render.transparentBackground leaves out the page background for a PNG you can place on anything.
Where it shows up
- An Open Graph image for every post, generated when it is published.
- Certificates and badges rendered from a course or event record.
- Share images for pages your users create: profiles, listings, playlists.
The request
POST /screenshot. Image output is on every plan, including the free Hobby plan, at 1 credit an image. The image is the viewport size multiplied by deviceScaleFactor, which defaults to 2. A request can carry up to 1,000,000 characters of HTML. Transparent backgrounds, under render, start at Pro.
Go further
More in Screenshots, images and PDFs: Thumbnails and link previews · PDFs from your own HTML · Web page to PDF · Screenshots of a list of URLs · Product screenshots for docs · Dashboard screenshots to chat · Monthly reports for clients · Email template previews · Full-page captures for review tools · All use cases
Give your product a browser.
Get clean web content and visual proof into your workflow in minutes.