ScreenshotMachine API: How to Capture a Full-Page Website Screenshot
Capture a full-page website screenshot with ScreenshotMachine’s API. Learn the dimension syntax, request options, delay settings, code examples, and troubleshooting steps.
To capture a full-page website screenshot with ScreenshotMachine, send a GET request to https://api.screenshotmachine.com/ with your API key, the page URL, and a dimension such as 1366xfull. The width is in pixels; full asks for the page’s full length instead of a fixed-height viewport. For long pages with images or animations, ScreenshotMachine recommends increasing delay, for example to 2000 milliseconds or more.
This guide covers ScreenshotMachine’s request format, runnable cURL, Python, and Node.js examples, the options relevant to full-page captures, and fixes for common failures. For exact parameter availability, check the ScreenshotMachine API documentation.
1. Build the full-page request
The API uses HTTP GET query parameters. A minimal request needs:
key: your ScreenshotMachine customer API key.url: the absolute URL of the page to capture.dimension: a width and height in the form[width]x[height]. Usefullas the height for a full-page image, such as1366xfull.
ScreenshotMachine documents widths from 100 to 1920 pixels. Numeric heights range from 100 to 9999 pixels; full is a separate supported value. A full-page capture may be very tall, so choose a width that suits the page and how the image will be viewed.
cURL
curl -G 'https://api.screenshotmachine.com/' \
--data-urlencode 'key=YOUR_SCREENSHOTMACHINE_KEY' \
--data-urlencode 'url=https://example.com/page' \
--data-urlencode 'dimension=1366xfull' \
--data-urlencode 'format=png' \
--data-urlencode 'delay=2000' \
-o full-page.png
--data-urlencode encodes the target URL and other parameter values for the query string. Replace the example URL and key before running the command.
Python
import requests
params = {
"key": "YOUR_SCREENSHOTMACHINE_KEY",
"url": "https://example.com/page",
"dimension": "1366xfull",
"format": "png",
"delay": 2000,
}
response = requests.get(
"https://api.screenshotmachine.com/",
params=params,
timeout=90,
)
response.raise_for_status()
with open("full-page.png", "wb") as image_file:
image_file.write(response.content)
Install the HTTP client with python -m pip install requests if it is not already available. The API key is included in the request URL as a query parameter, so do not print complete request URLs in shared logs.
Node.js
const params = new URLSearchParams({
key: 'YOUR_SCREENSHOTMACHINE_KEY',
url: 'https://example.com/page',
dimension: '1366xfull',
format: 'png',
delay: '2000',
});
const response = await fetch(
`https://api.screenshotmachine.com/?${params}`
);
if (!response.ok) {
throw new Error(`Screenshot request failed: HTTP ${response.status}`);
}
const image = Buffer.from(await response.arrayBuffer());
await import('node:fs/promises').then(fs => fs.writeFile('full-page.png', image));
Save the response as binary data. Treating an image response as text can corrupt the file. The example uses Node.js versions with the built-in fetch API.
2. Choose dimensions and capture settings
| Parameter | What it controls | Documented values and notes |
|---|---|---|
dimension |
Output width and height. | Format is widthxheight. Width: 100–1920 pixels. Numeric height: 100–9999 pixels. Use full for the full page, for example 1024xfull. |
device |
Device profile. | desktop, phone, or tablet; default is desktop. |
format |
Image output format. | jpg, png, or gif; default is JPG. |
delay |
Wait time before creating the screenshot. | Supported values are 0, 200, 400, 600, 800, 1000, then 2000–10000 in 1000 ms steps. Default is 200 ms. |
cacheLimit |
How long a screenshot can be served from cache. | 0–14 days; default is 14. A value of 0 requests a fresh screenshot. |
zoom |
Scale applied before capture. | 10–400 percent; default is 100. The documentation says optimization may ignore zoom for screenshots smaller than typical device dimensions. |
click |
CSS selector to click before capture. | For example, a selector can target a control that closes a banner. |
hash |
Request authentication for publicly available HTML pages when a secret phrase is configured. | The documented hash is an MD5 value calculated from the URL and the account’s secret phrase. Requests with a missing or incorrect hash are ignored when a secret phrase is configured. |
Use a numeric height when you need a fixed-size image. Use full when the output should include the entire page. A full-page image is not a screenshot of one fixed-height viewport: its height follows the page content.
Pick a format for the output
- PNG: useful when you want lossless image output, such as for text-heavy pages or further image processing.
- JPG: the documented default format.
- GIF: also listed as a supported output format.
The API documentation lists these formats but does not provide a universal file-size or quality comparison. Choose based on the receiving system and inspect the resulting file for your use case.
Use delay for content that appears late
ScreenshotMachine’s default delay is 200 ms. Its documentation recommends a greater delay for long pages with many images or animations, giving delay=2000 or more as an example. Use a supported value and increase it when the first capture misses content that needs extra time to appear.
A longer delay is guidance, not a guarantee that every page will finish loading. Content behind interaction, authentication, or a site-specific gate may still be unavailable to the capture. Check the saved image after changing the delay.
3. Cache behavior, cost, and request hygiene
The cacheLimit setting controls cache freshness. Its documented default is 14 days, and cacheLimit=0 means always fetch a fresh screenshot. The provider’s pricing page says cached screenshots do not count as newly billed fresh screenshots. If a page changes frequently, set the cache behavior to match how fresh the image needs to be; if it changes rarely, reusing cached output can avoid unnecessary fresh captures.
ScreenshotMachine’s pricing page lists a free Starter plan with 100 fresh screenshots per month, Basic at 9 EUR per month for 2,500, Pro at 59 EUR per month for 20,000, and Enterprise at 99 EUR per month for 50,000. The page also lists additional-screenshot rates and says overages are billed in groups of 1,000 rounded down. These are provider-published prices and quotas; check the current pricing page before choosing a plan.
- Keep the API key on a server or in a secret store rather than embedding it in public client-side code.
- Encode query parameters, especially the target URL. The examples use URL encoding utilities to handle punctuation and nested query strings.
- For a fresh capture, set
cacheLimit=0; otherwise account for the configured cache period when a page update does not appear. - Full-page captures can produce tall images. Confirm that the receiving application can store, display, or process the resulting dimensions.
- A longer delay increases the time a request takes to complete. Raise it only as far as needed for the page’s content.
4. Troubleshooting
| Symptom | Likely cause | What to try |
|---|---|---|
| The capture has a fixed or unexpectedly short height. | The request uses a numeric height rather than the full-page value, or the width-height syntax is malformed. | Set dimension to a valid value such as 1366xfull. Check the documented width range and spelling. |
| Images or animated content are missing. | The page needed more time before capture. | Increase delay to a supported value, such as 2000 ms, then inspect the output. The provider recommends a greater delay for long pages with images or animations. |
| The screenshot looks old after the page changed. | The cached image may still be within its cache period. | Set cacheLimit=0 when you need a fresh screenshot, or adjust the cache period to suit the page’s update frequency. |
| The request is ignored when a secret phrase is enabled. | The required hash is missing or incorrect. |
Calculate the documented MD5 hash from the target URL and account secret phrase, then include it as required by the API documentation. |
| The API rejects the dimensions. | The width or numeric height is outside its documented range, or the dimension string is invalid. | Use a width from 100 to 1920 and, for numeric heights, 100 to 9999. For full page, use the literal full height. |
| The saved file cannot be opened. | The response may have been handled as text, or the requested format and file extension do not match. | Save the response body as binary data and use an extension that matches the requested format. Check the HTTP status before writing the file. |
| The page still omits content after increasing delay. | The missing content may depend on interaction, a gate, or behavior not resolved by waiting alone. | Try the documented click option for a relevant CSS selector if a click can reveal or close the needed element. Confirm the page is publicly reachable and review the result. |
5. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server. One GET request returns an image or PDF. The following cURL command saves a WebP screenshot; see the ScreenshotNeo API documentation for request options.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
ScreenshotNeo accepts cookie and consent banners like a visitor and removes more than 60 known consent platforms, newsletter popups, and chat widgets before capture; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, and response headers say which page verdict applied and whether it was billed. Its MCP server gives AI agents tools for screenshots, page information, and PDF capture. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000.
Sign up free for 1,000 screenshots a month, with no card required.
6. FAQ
Does 1366xfull mean a 1366-pixel-tall screenshot?
No. It specifies a width of 1366 pixels and requests the full page height. Use a numeric height when you want a fixed-height capture.
What is the maximum full-page height?
The documentation gives a numeric height range up to 9999 and separately accepts full for a full-length page. It does not define full as a fixed pixel limit.
Will a longer delay make every lazy-loaded image appear?
Not necessarily. ScreenshotMachine recommends a higher delay for long pages with images or animations, but that does not guarantee that all site-specific or gated content will load. Inspect the output and adjust the request for the target page.
How can I prevent an old cached screenshot from being returned?
Set cacheLimit=0 to request a fresh screenshot, as described in ScreenshotMachine’s API documentation.
Sources
- ScreenshotMachine Website Screenshot API documentation: request syntax, parameter ranges, examples, and full-page delay guidance.
- ScreenshotMachine pricing: published plans, fresh screenshot quotas, cache billing notes, and overage details.


