mockup to a template ID and Screenshotly places the capture inside a
device or browser frame in the same request. Mockups are available on the
Growth plan and above.
Templates
These six IDs are the complete list, and they are case-sensitive. Any other
value returns
400 Invalid request data. To read the list programmatically,
GET https://screenshotly.app/api/mockups returns the templates as JSON without
an API key; use each entry’s id and screenshotPlacement, and rely on the
table above for output sizes.
The output image always has the template’s size. Your capture is resized to
fill the template’s screen area exactly, so its proportions change if the
capture has a different shape from the screen area.
Size the capture to fit the frame
Choose a viewport with the same aspect ratio as the screen area, usingwidth
and height:
- Do not combine
mockupwithdevice. Adevicepreset overrideswidthandheight. For example,device: "mobile"captures at 375 × 812, which is narrower than theiphone-14screen area and is stretched sideways to fit. - Avoid
fullPagewith mockups. A full-page capture is squeezed vertically into the screen area. Capture the first viewport, or a specificselector, instead. - Use
deviceScaleFactorfor sharpness. The capture is resized to the screen area, so a capture smaller than the screen area is scaled up. For example,450 × 820atdeviceScaleFactor: 2produces 900 × 1640 pixels, which matches theiphone-14screen area exactly.
Formats and compatibility
Limits to plan around
- One frame per request. To show the same page in several frames, send one capture per frame; see Frame many pages at once.
- Fixed styling. Frames have no shadow, padding, background, color, or orientation options. Everything outside the screen area is the template image itself, and only the rounded corners are transparent. Add shadows, padding, or a backdrop in your own image pipeline.
- Fixed output size. There is no option to resize the framed image. If a destination needs exact pixel dimensions, such as a 1200 × 630 social card or an app store slot, resize or pad the output yourself and check that destination’s current requirements.
- Image region options still apply. With
png,jpeg, andwebp, you can useselectororclip; the selected region is what goes into the frame. - Normal capture limits apply. Navigation times out after 30 seconds, and each framed capture counts as one successful capture.
Clean up the page first
Cookie banners and chat widgets look out of place inside a polished frame. On Growth and above, combinemockup with hideSelectors for elements you know,
or aiRemoval for ones you don’t:
darkMode emulates prefers-color-scheme: dark, so sites with a dark theme
match the browser-dark frame.
Frame many pages at once
Every plan that includes mockups also includes batch jobs, so you can queue up to 20 framed captures in one request. Each item has its ownmockup and viewport, which
makes batches a good fit for producing several frames of the same page:
Node.js
Generate mockups in CI
To refresh marketing or documentation images on every release, keep a list of pages and frames in your repository and run a script in CI. This script captures sequentially, stops at the first failure, and writes predictable file names:scripts/generate-mockups.mjs
.github/workflows/mockups.yml
- Store the key as a repository secret and use a key dedicated to CI. Dashboard keys expire after 30 days, so add the rotation to your routine; see Managing API keys.
- The target pages must be reachable from the public internet. Staging hosts
that resolve to private addresses are rejected with
400 Unsafe URL. - For more than a handful of pages, switch the loop to a
batch job, or keep sequential requests within your
plan’s per-minute limit (80 on Growth, 200 on Scale). The retry pattern in
Capturing screenshots
handles
429responses.
Test your frames
Because each template has a fixed output size, a test can check the PNG header directly instead of comparing images. This test uses Node’s built-in test runner and makes one capture per template:mockup-frames.test.mjs
Migrating from older examples
Some older Screenshotly articles and third-party snippets show mockup options that the API does not accept. The request schema is strict, so these return400 Invalid request data:
The replacements are the closest available frames, not identical designs.
When to use a frame
Frames add context for landing pages, launch posts, and sales decks. For inline documentation, support articles, and internal reports, a plain capture usually reads better: the frame takes space and makes interface detail smaller.Next steps
- Capturing screenshots for AI element removal
- Async and batch jobs for queued captures
- Synchronous capture reference