Get faster screenshot API responses and smaller files at volume
A fast screenshot API call is mostly a matter of not doing work you will throw away. When you capture thousands of pages for thumbnails, link previews, monitoring or a search index, seconds and kilobytes add up, and most of the cost hides in defaults: metadata you do not read, retina density you do not display, timers that wait longer than needed. Each one is a single Screenshot API option away from being switched off.
Default screenshots do more work than a high-volume pipeline needs
Every screenshot request also extracts the page metadata, renders at the device’s native pixel density and waits for the page to settle. Those defaults make sense for a one-off capture and cost time on a batch of ten thousand thumbnails.
The usual reaction is to optimize after the fact: download the PNG, resize it, recompress it and upload it again. That doubles the storage traffic, adds an image pipeline to maintain and does nothing for the response time, because the browser already rendered every pixel you later threw away.
Turning off metadata with meta: false is usually the single biggest speedup. After that, a lower deviceScaleFactor, JPEG with a quality setting and selector-based waits shrink both the response time and the bytes you store and serve.
How to make screenshot API calls faster and images smaller
Apply the settings in this order. Each one is optional and each one is a plain request option, listed with the rest in the screenshot caching and performance guide.
import createClient from 'microlink.io'
const microlink = createClient({
apiKey: process.env.MICROLINK_API_KEY
})
const { url, size_pretty: size } = await microlink.screenshot(
'https://example.com',
{
meta: false,
type: 'jpeg',
quality: 60,
viewport: { deviceScaleFactor: 1 }
}
)meta: false skips metadata extraction, JPEG at quality 60 compresses harder than the default of 80, and deviceScaleFactor: 1 renders one device pixel per CSS pixel. size_pretty in the response shows the resulting file size.
import createClient from 'microlink.io'
const microlink = createClient({
apiKey: process.env.MICROLINK_API_KEY
})
const { url } = await microlink.screenshot('https://example.com', {
meta: false,
waitUntil: 'domcontentloaded',
waitForSelector: 'h1'
})The capture fires as soon as the heading is in the page instead of waiting for every image and third-party script. Screenshots of JavaScript-rendered pages covers the full set of wait options.
import createClient from 'microlink.io'
const microlink = createClient({
apiKey: process.env.MICROLINK_API_KEY
})
const { url } = await microlink.screenshot('https://example.com/docs', {
meta: false,
javascript: false
})javascript: false disables script execution in the browser page. Use it for server-rendered pages that are complete without it, and leave it on for client-rendered apps.
curl 'https://api.microlink.io/?url=https%3A%2F%2Fexample.com&meta=false&screenshot.type=jpeg&screenshot.quality=60&viewport.deviceScaleFactor=1'The request runs on the free endpoint. Compare the x-response-time header before and after to measure the gain on your own targets, and look for x-fetch-mode: skipped to confirm metadata was bypassed.
- meta false skips metadata detection and x-fetch-mode reports skipped. Default true.
- screenshot.type png (default) or jpeg. JPEG gives smaller files when transparency is not needed.
- screenshot.quality JPEG compression from 0 to 100; 80 by default. Ignored for PNG output.
- viewport deviceScaleFactor: 1 renders a quarter of the pixels of a 2x capture. Partial values merge with the device defaults.
- waitForSelector Finishes as soon as the element exists instead of a fixed delay.
- javascript false skips script execution for pages that are complete without it. Default true.
Keep adblock and animations at their defaults: blocking third-party requests and disabling transitions already make captures faster and more stable. Avoid fullPage when a viewport or an element capture is enough.
Why these screenshot speed settings matter at volume
Each option removes work the browser or the network would otherwise do on every single request.
When you do need some metadata next to the image, fetch only the metadata fields you need instead of all of them.
The CDN may still serve an optimized format such as WebP to compatible browsers, so the stored asset and the delivered asset can differ. Cropping to a single element is the other way to cut pixels.
When not to: pixel-perfect design reviews and visual regression need 2× density and PNG. Save the speed settings for previews, thumbnails and monitoring.
FAQ
What is the biggest speedup for screenshot API requests?
How do I reduce screenshot file size with JPEG quality?
Does a cached screenshot still take time to generate?
Is there a screenshot option that prioritizes speed automatically?
Does a lower deviceScaleFactor make screenshots blurry?
Solve the next problem with the same API
Screenshots under traffic spikes
Screenshots of JavaScript-rendered pages
Screenshot a single element
Mobile screenshots at any viewport
Dynamic Open Graph images
Only the fields you need
Ready for leaner screenshots?
Skip the work you do not need and capture faster on every plan. Start on the free tier and measure the difference on your own pages.