Learn how to use HTML/CSS to Image to generate a screenshot of a tweet. This example makes use of Twitter's embed code to reliably generate an image.
To customize this: swap out the link to the tweet with the link to any other tweet you want. Take note of the extra parameters set for this example. We set a selector and ms_delay. This helps with cropping and gives the Twitter JavaScript plenty of time to render.
Make changes to the code and click the Image button below
Use these settings to tweak your image even further. See our docs for full details on all the available options.
2
which is equivalent to a 4K monitor. Minimum: 1, Maximum: 3
Images are automatically cropped by default. We crop to the outermost HTML element. For extra tweaking, use these settings
By default the API generates a screenshot once everything is loaded. If the page executes JavaScript, you may want extra time before the image is rendered.
ScreenshotReady()
from JavaScript in your code to trigger the image generation. Learn more.
We run your HTML/CSS in a specialized instance of Google Chrome so that it renders exactly how you'd expect it to. Then we generate a screenshot from Chrome, crop it for you automatically and give you back a performance optimized URL to your image.
You can then use this URL anyway you'd like. You can download the image and host it somewhere else. Or directly use the URL in your apps and webpages.
We've spent years on this problem and our API generates millions of images each month. We continually improve it as people find new ways to use the API