How to Take a Full-Page Screenshot with ScreenshotMachine Using a URL
Use ScreenshotMachine’s URL API to capture a full page, choose a width and format, and troubleshoot delays, caching, and public API calls.
To take a full-page screenshot with ScreenshotMachine, send a GET request to https://api.screenshotmachine.com/ with your account key, the page url, and a dimension whose height is full, such as 1366xfull. Percent-encode the target URL, especially if it contains query parameters. For long pages with images or animations, try a longer delay, such as 2000 milliseconds or more. [ScreenshotMachine API documentation]
1. Choose the browser form or API
For a one-off capture, ScreenshotMachine’s homepage has a URL field and a Full-page screenshot option. For repeatable captures in scripts or applications, call its API. The API exposes settings such as dimensions, device, format, delay, cache limit, and a CSS selector to click before capture. [ScreenshotMachine homepage] [API documentation]
2. Set the width and full-page height
The dimension value combines a width and height. Use a value such as 1366xfull or 1024xfull to capture the page at the chosen width and its full length. The documented full value requests a full-length webpage capture. Choose the width that matches the layout you need to inspect; responsive pages can look substantially different at different widths.
3. Make a full-page request with cURL
This example saves a PNG file. Replace the placeholder key and target URL. cURL handles query parameter encoding when values are passed with --data-urlencode.
curl -G "https://api.screenshotmachine.com/" \
--data-urlencode "key=YOUR_SCREENSHOTMACHINE_KEY" \
--data-urlencode "url=https://example.com/article?ref=docs&page=2" \
--data-urlencode "dimension=1366xfull" \
--data-urlencode "device=desktop" \
--data-urlencode "format=png" \
--data-urlencode "delay=2000" \
--output screenshot.png
The target URL above includes query parameters deliberately: encode the entire URL as the value of the API’s url parameter. Do not manually concatenate an unescaped target URL onto the endpoint, since its ampersands could be interpreted as parameters to ScreenshotMachine instead.
4. Call it from Python
Install the HTTP client with python -m pip install requests. This runnable example checks for an HTTP error before writing the response body.
import requests
params = {
"key": "YOUR_SCREENSHOTMACHINE_KEY",
"url": "https://example.com/article?ref=docs&page=2",
"dimension": "1366xfull",
"device": "desktop",
"format": "png",
"delay": 2000,
}
response = requests.get(
"https://api.screenshotmachine.com/",
params=params,
timeout=120,
)
response.raise_for_status()
with open("screenshot.png", "wb") as image_file:
image_file.write(response.content)
For production code, verify that the response is an image before saving it. An error response may be text or another body rather than a screenshot; check the response status and content type, and retain the response body when investigating failures.
5. Call it from Node.js
Node.js 18 and later provides fetch. This example uses URLSearchParams to encode each parameter, checks the HTTP status, and writes the returned bytes to a PNG file.
import { writeFile } from "node:fs/promises";
const params = new URLSearchParams({
key: "YOUR_SCREENSHOTMACHINE_KEY",
url: "https://example.com/article?ref=docs&page=2",
dimension: "1366xfull",
device: "desktop",
format: "png",
delay: "2000",
});
const response = await fetch(
`https://api.screenshotmachine.com/?${params.toString()}`
);
if (!response.ok) {
throw new Error(`ScreenshotMachine returned HTTP ${response.status}`);
}
const image = Buffer.from(await response.arrayBuffer());
await writeFile("screenshot.png", image);
6. Select the capture settings
| Parameter | How to use it | When it matters |
|---|---|---|
key |
Your ScreenshotMachine account key. | Required for API requests. Keep it out of public client-side code unless using the documented hash safeguard. |
url |
The page address to capture; percent-encode it as a parameter value. | Always required. Encoding is especially important for nested query strings and reserved characters. |
dimension |
Width and height, for example 1366xfull. |
Use full for the complete page height. Width controls responsive rendering. |
device |
desktop, phone, or tablet. |
Pick the form factor whose layout you want to capture. Documentation examples include desktop 1024×768, phone 480×800, and tablet 800×1280; for full-page capture, use an appropriate width with the xfull height. |
format |
jpg, png, or gif. |
Choose PNG for crisp interface details, JPG for smaller photographic output, or GIF where the documented output format suits your use case. |
delay |
A wait before the capture, in milliseconds. | For long pages with images or animations, ScreenshotMachine recommends considering 2000 ms or more. A delay is not a guarantee that every site has finished rendering. |
cacheLimit |
A cache lifetime from 0 to 14 days. | Set to 0 when you want the service to fetch a fresh screenshot rather than use a cached image. |
click |
A CSS selector for an element to click before capture. | Can trigger a page control such as a consent dismissal, if the selector and interaction work on that page. It is not guaranteed to dismiss every prompt. |
7. Handle URL encoding, keys, and public pages
Let an HTTP library encode parameter values, as the examples do. If constructing the request URL yourself, percent-encode the target URL as one value; encoding only some characters can break nested query strings or reserved characters.
A server-side integration should keep the account key in a secret store or environment variable and avoid logging it. If you call the API directly from public HTML, ScreenshotMachine documents a hash safeguard: calculate the hash using MD5 from the URL plus the account’s secret phrase, configured in account settings. Follow the vendor’s current instructions for the exact construction and parameter format. A public hash is intended to protect the account key in browser-facing calls; do not expose the secret phrase itself. [ScreenshotMachine API documentation]
8. Check the result and tune the capture
- Open the output and confirm the page width, full height, and expected content.
- If content near the bottom is missing, increase
delayand capture again. Lazy-loaded images may need time or page interaction before they appear. - If the layout is wrong, adjust the width and device setting; responsive breakpoints can change navigation, columns, and image sizes.
- If a consent prompt blocks the page, consider the documented
clickselector capability. Confirm the exact selector and behavior on the target site. - Use
cacheLimit=0when debugging changes or when you specifically need a fresh capture. For repeated unchanged pages, a cache may avoid unnecessary refreshes.
9. Troubleshooting
| Symptom | Likely cause | What to try |
|---|---|---|
| The request fails or returns an error body. | Missing/incorrect account key, malformed URL, or invalid parameter. | Check the key and required url; inspect the HTTP status and response body; encode parameter values with your client library. |
| The target URL opens the wrong page or loses its query string. | The nested URL was not encoded as one parameter value. | Use URLSearchParams, Python’s params, or cURL’s --data-urlencode. |
| The image is cut off at the viewport height. | The dimension did not use the full-height setting. | Set dimension to a width followed by xfull, for example 1366xfull. |
| Images or animations are missing. | The page had not completed loading when capture began. | Increase delay; try at least 2000 ms for long pages as the vendor suggests. Some pages may require more time or page-specific interactions. |
| A cookie prompt remains in the image. | The site’s prompt may need interaction, or the selector may not match. | Use the click option with a selector for the page’s dismissal control and verify its behavior. This capability may not work for every site. |
| The screenshot shows stale content. | A cached result may have been returned. | Set cacheLimit=0 to request a fresh capture. |
| A public page exposes an API key. | The key was placed directly in browser code. | Use a server-side request or the vendor-documented hash safeguard for public HTML calls. Keep the secret phrase private. |
| The saved file cannot be opened as an image. | The response may be an API error body, not an image. | Check status and content type before writing; log or inspect the error response safely, without exposing credentials. |
10. Performance, reliability, and cost
Full-page images can be large, especially at wide dimensions and on long pages. Request only the width and format you need, and use caching for repeat captures of pages that have not changed. Use cacheLimit=0 when freshness matters more than cache reuse. Longer delays can help pages with late-loading images and animations, but increase end-to-end wait time and do not guarantee complete rendering on every site.
The vendor’s pricing page, checked on 2026-10-03, listed a free Starter allowance of 100 fresh screenshots monthly, Basic at €9/month for 2,500, Pro at €59/month for 20,000, and Enterprise at €99/month for 50,000. It also stated that VAT may be added for non-business EU customers and additional screenshot billing is rounded down in groups of 1,000. Verify the live pricing page before relying on these figures, since plan details can change. These are vendor-listed terms, not independent performance measurements. [ScreenshotMachine pricing]
11. Or skip the browser setup
ScreenshotNeo is a website screenshot API and MCP server for developers. Its one-request API returns a PNG, JPEG, WebP, or PDF; the parameter names used by other screenshot APIs also work, which can make migration easier. See the ScreenshotNeo API documentation.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
import requests
r = requests.get(
"https://api.screenshotneo.com/v1/shot",
params={"access_key": "YOUR_API_KEY", "url": "https://stripe.com"},
timeout=90,
)
open("shot.webp", "wb").write(r.content)
const q = new URLSearchParams({ access_key: 'YOUR_API_KEY', url: 'https://stripe.com' });
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
- Cookie banners are accepted like a visitor, and 60+ known consent platforms, newsletter popups, and chat widgets are removed before the shot; each step can be turned off.
- Bot checks, blank pages, timeouts, and failed loads are never billed, and cache hits cost nothing. Response headers report the page verdict and whether it was billed.
- An MCP server provides
take_screenshot,get_page_info, andcapture_pdftools for Claude, Cursor, and other MCP clients. - 1,000 screenshots per month are free with no card; paid plans start at $5 for 3,000. Yearly billing gives two months free, and every feature is on every plan.
Sign up free for 1,000 screenshots a month with no card.
12. FAQ
Can I capture the whole page at a mobile width?
Yes. Choose a phone device or a suitable narrow width and keep the height as full, for example a width ending in xfull. Check the resulting layout because responsive sites may rearrange content.
Does a longer delay guarantee every image loads?
No. It gives the page additional time before capture. Site behavior, lazy loading, animations, and network conditions can still affect the result.
Can I use a screenshot URL in a public image tag?
ScreenshotMachine documents a hash safeguard for public HTML calls. Follow its current API instructions and do not expose the secret phrase used to create the hash.
Which format should I choose?
PNG is a straightforward choice for sharp interface details; JPG can suit photographic pages. ScreenshotMachine also documents GIF output. Choose based on how the result will be used and verify the returned file.


